I am trying to control some RC servo’s using simulink real time windows target.
I have been successful in controlling them using regular simulink however this is not in real time.
I am trying to use a “packet output” block set to use the serial port with a baud rate of 9600.
I have for the moment connected a constant block up with a vector containing the numbers to send
to move the motors (will swap this later, i just want to get it working for now).
Only thing is for some reason it doesnt seem to be sending the signal (and the “data error” output of the
"packet output" block is 1, indicating something is wrong).
Does anyone have any experience with this?
If so any advice would be great, as i am stumped on why i cant get it working.
Ok, well after alot of playing around with simulink real time windows target i am still unable to get this working.
I have determined that real time windows target is sending serial signals by connecting a CRO to the serial input line.
The strange thing is that even when it is sending the signals the LED’s do not flash (i only get a momentary blip from the yellow LED when
i “connect to target” in the simulation). I have tried a range of baud rates in the specified range and different sampling rates in my model
with no success.
I really don’t know why this would be happening as the LED’s will usually flash when a serial signal is received, even if
there is something wrong with the format etc. (even red flashing LED’s are better than nothing).
I have achieved serial communication in regular simulink so i know that it is definitely not the hardware setup.
If anyone has any ideas what is going wrong i would greatly appreciate your input.