ME 597D Advanced Mechatronics Final Project
  • Home
  • Index
  • Getting Started
  • Read Encoders
  • RS-232 Solution
  • DEMO

RS 232 Solution constrained by Roboteq

The Roboteq is a digital controller. By default it is in RC mode, but can switch to RS 232 by sending at least 13 carriage return. The velocity command format is "!AXX", where A is the motor ( it can be A , B, a or b , capital or lower case according if the command is forward or backward direction) and XX are the two digits in hexadecimal from 00 to 7F.

The Roboteq works with 7 bits a start bit and a stop bit,  9600 baudrate and 12V -40 V input voltage for the motors ( 12 V for itself).

Another interesting point about this, is the target PC doesn't need any extra board.  It uses the Main board.
Picture

Troubleshooting

In order to send the specific commands that Roboteq requires I used differents methods.
I did the Loop back test. It consists in plugging a RS-232 null cable, and connecting pin 2 with pin 3, i.e transmitter and receiver. Then we are receiving what we send.

I also downloaded a free application called TERA TERM. It is really useful to connect with different devices with TCP IP or Serial ports.


In the pictures below you can appreciate the ASCII encode block window, and a possible solution for the command format.

The second picture is the first model that worked, sending a command in decimal, at left as a constant and it was converted to the actual command and send it to the Teraterm to check it.

The third picture is the model of an increment of velocity by one everysecond ( that what the matlab function at left is). The other matlab function sends the 13 carriage return many times, such that we switch to RS 232 mode, and then it converts the double that receives into a uint8.

The fourth picture would be this code, inside of the embeded matlab block placed in the midle.


Create a free web site with Weebly