Serial Communication Issue

8 years 11 months ago #29526175 by DWDY
We are having some interfacing problems in Roborealm. When we try to communicate with our Roboteq AX2550 Motor Controller, we send a hexadecimal command “!A19” which should command our channel 1 motor roughly %20 throttle, forward. We first sent this as a trial, from our motor controller’s software (Roborun), to the motor controller (Roboteq Ax2550). The motor controller reads and echoes (+) it correctly and our motors respond. When we send that same command from Roborealm’s console serial module, it echoes the same command we sent but we aren’t getting any response from our motors. (a “+” response from the motor controller equals an executed command)
We think Roborealm is changing our command, due to the same command being sent ,with different results. Another potential problem may be the start bit(removing the start bit),. Roboteq is very specific in what serial it wants (9600 baud, 7-bit data, 1 start bit, 1 stop bit, even parity). We are able to set all of these parameters correctly, with the exception of the start bit.

Is there perhaps some kind of special protocol to be used in addition to the RS 232?

Any information/help would be greatly appreciated.

Thanks in Advance,

Please Log in or Create an account to join the conversation.

8 years 11 months ago #29526177 by roboteq
Replied by roboteq on topic Re:Serial Communication Issue
Start bits are not an optional parameter when configuring a RS232 port. If you can configure the 9600bps, 7 bits data and even partity, you should be OK. Your problem may be due to Robotrealm terminating string with a new line character 0x0a, instead of cariage return 0x0d.

Please Log in or Create an account to join the conversation.

8 years 11 months ago #29526179 by DWDY
Replied by DWDY on topic Re:Serial Communication Issue
Thanks for the quick response, we\'ve resolved most of the issues we were having. We found out that the issue of no motor response was due to the lack of a correct carriage return\"<cr>\". Initially we had placed it at the end of our VB script we concatenated it with the command structure that the roboteq motor controller expected and it wouldn\'t execute the command, but it would execute motor commands by manually sending them in the serial console window
( !A7F<cr> = Channel 1 100% forward) . We then removed the \"<cr>\" from the VB script and manually put in the carriage return in the \"send sequence\" serial window and it has been working well ( [Variable]<cr> ). Also, apparently the start bit is automatically inserted into the frame, so no problem there.

This is the code we are using currently

nvLMotor128 = GetVariable(\"NV_L_MOTOR_128\")
SetVariable \"left_motor\", hex(nvLMotor128/128*(32)+00)
left_motor = hex(nvLMotor128/128*(32)+48)

nvRMotor128 = GetVariable(\"NV_R_MOTOR_128\")
SetVariable \"right_motor\", hex(nvRMotor128/128*(32)+00)
right_motor = hex(nvRMotor128/128*(32)+48)

SetVariable \"Output_L\", \"!B\" & left_motor
SetVariable \"Output_R\", \"!A\" & right_motor

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.113 seconds