AX2550 Motor Controller
Hello everyone, I am currently working on a project in which I need to use the javelin stamp interfaced to a motor controller provided by Roboteq. I am having a problem when sending the byte for the carriage return which is required by the motor controller before executing any commands. I have attached the code that I wrote. In the code there are comments that basically explain the communication required by the Ax2550. Also, I have attached the datasheet of the motor controller. I tried to attached the entire manual but it was too long. The most important facts about the controller are the following:
communication settings:
9600 bits/s, 7-bit data, 1 Start bit, 1 Stop bit, Even Parity
echo:
Character Echo
At the most fundamental level, the AX2550 will echo back to the PC or Microcontroller
every valid character it has received. If no echo is received, one of the following is occurring:
• the controller is not in the RS232 mode
• the controller is Off
• the controller may be defective
to rs-232:
If the controller is configured in R/C or Analog mode, it will not be able to accept and recognize
RS232 commands immediately.
However, the controller will be “listening” to the serial port and will enter the serial mode
after it has received 10 continuous “Enter” (Carriage Return) characters. At that point, the
controller will output an “OK” message, indicating that it has entered the RS232 mode and
that it is now ready to accept commands.
at last· (nn is a two digit hexadecimal number to specify the speed of the motors):
TABLE 24. Controller’s basic Commands and Queries
Command Type Description
%rrrrrr Command Reset Controller
!Ann Command Channel 1, forward command to value nn
!ann Command Channel 1, reverse command to value nn
!Bnn Command Channel 2, forward command to value nn
!bnn Command Channel 2, reverse command to value nn
!C Command Turn Accessory Output C n
!c Command Turn Accessory Output C Off
?a or ?A Query Read Battery Amps
?v or ?V Query Read Power Level applied to motors
?p or ?P Query Read Analog Inputs 1 and 2
?r or ?R Query Read Analog Inputs 3 and 4
communication settings:
9600 bits/s, 7-bit data, 1 Start bit, 1 Stop bit, Even Parity
echo:
Character Echo
At the most fundamental level, the AX2550 will echo back to the PC or Microcontroller
every valid character it has received. If no echo is received, one of the following is occurring:
• the controller is not in the RS232 mode
• the controller is Off
• the controller may be defective
to rs-232:
If the controller is configured in R/C or Analog mode, it will not be able to accept and recognize
RS232 commands immediately.
However, the controller will be “listening” to the serial port and will enter the serial mode
after it has received 10 continuous “Enter” (Carriage Return) characters. At that point, the
controller will output an “OK” message, indicating that it has entered the RS232 mode and
that it is now ready to accept commands.
at last· (nn is a two digit hexadecimal number to specify the speed of the motors):
TABLE 24. Controller’s basic Commands and Queries
Command Type Description
%rrrrrr Command Reset Controller
!Ann Command Channel 1, forward command to value nn
!ann Command Channel 1, reverse command to value nn
!Bnn Command Channel 2, forward command to value nn
!bnn Command Channel 2, reverse command to value nn
!C Command Turn Accessory Output C n
!c Command Turn Accessory Output C Off
?a or ?A Query Read Battery Amps
?v or ?V Query Read Power Level applied to motors
?p or ?P Query Read Analog Inputs 1 and 2
?r or ?R Query Read Analog Inputs 3 and 4
pdf
![](/plugins/FileUpload/images/file.png)
569K
Comments
regards peter
The attached file has a method evenParity that does it for you.
Place the file in folder ...\lib\stamp\core
regards peter