Hello, I'm Fabio and I'd like to know how to send a reference signal to my Arduino board (Arduino Mega 2560) for a closed loop control.
This reference signal is a variable that evolves in time (for example it is a sinusoidal set).
So my questions are:
How to send this kind of variable? The transmission of this signal is only via serial monitor or could be done by Simulink?
Should I send an array or should I send each time a different variable?
Thank you in advance for your help.
The answer to your question depends on several factors including
How fast is the variable changing ?
What range of values does it vary over ?
Can the other system output the "variable" as a voltage ?
Is the data being processed on the Arduino in real time as it arrives or periodically depending on time ?
More details of what you are doing would help formulate an answer.
The ideal would be a communication from matlab, as I have the availability of:
The ideal would be for you to take your tap dancing shoes off, and tell us about your project.
You can't send a sine wave via the serial port. You MIGHT be able to send discrete values that represent points on the sine wave at some point in time.
What are you intending to do with this data? Replicating the sine wave on the Arduino just doesn't seem likely.
My question, as ignorant man, is:
it is possible to send a reference input from my computer to Arduino by USB connection?
The project is to use that reference signal for a closed loop control.
FabioM:
My question, as ignorant man, is:
it is possible to send a reference input from my computer to Arduino by USB connection?
The project is to use that reference signal for a closed loop control.
You seem to be missing the point that "a reference input" may be meaningful to you but it is not meaningful for people here or for an Arduino.
If what you are trying to say is that you would like to send a series of numbers, one after the other, from a PC to an Arduino the answer is YES.
What the numbers are, or what the Arduino is expected to do with them have nothing to do with the ability to transmit them.