-
Simulink Real time
Hi All,
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.
My servo motor controller uses a serial port connection to the computer. It takes a vector of numbers as input to determine which motors to move etc..
I am trying to use a "packet output" block set to use the serial port with a baud rate of 9600 (required by the controller).
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.
-
A useful tool for debugging serial communication problems is the Hyperterm app that comes with Windows or minicom with Linux/unix. You make a crossover cable with the data pins cross connected 2-3, 3-2 and ground. Start the terminal program and configure it to match your speed and word-length. This allows you to see what if anything is being transmitted and when. Minicom has the ability to show hex values, so you can see all transmitted values, not just the printable ones.
I can't offer any advice on the simulink stuff, sorry.
Good Luck,
BobH