stamp and robotq ax2550
bern
Posts: 6
hello all, I am trying to control a robotq ax2550 with my stamp(basic stamp homework board rev b).· I have the mesmic 2125 acclerometer that I want to collect data and send infor to motor controller(1x2550).· basically, a segway type vehicle.· can anyone help me with some sample code or direct me to a good resource.
thanks
bern
thanks
bern
Comments
When you upload the pictures of the project, and link to the manual; can you also provide any sample code you already have if there is any?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
thanks
bern
the third section "users manual" is the one to select.
http://www.roboteq.com/tech-support/technical-documentation.html
bern
This is the manual you are referring to correct?
AX2550/AX2850 User's Manual:
http://www.roboteq.com/files_n_images/files/manuals/ax2550man19b-060107.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
Here are the two PDF links that we spoke about;·BASIC Stamp Syntax & Reference Manual, which will help with the SEROUT/SERIN command that you will use to communicate with the motor controller, and the Smart Sensors & Applications Text, which will help explain the operation of the Memsic 2125 module and provide some samples to get you started.
BASIC Stamp Syntax & Reference Manual [noparse][[/noparse] review SERIN & SEROUT for baud table ]:
http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf
Smart Sensors & Applications [noparse][[/noparse] review chapter 3 ]:
http://www.parallax.com/Portals/0/Downloads/docs/prod/sic/3rdPrintSmartSensors-v1.0.pdf
From my understanding from the motor controller you are using, is use the·following settings for communication:
9600 bits/s, 7-bit data, 1 Start bit, 1 Stop bit, Even Parity, and no flow control.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
Post Edited (Joshua Donelson (Parallax)) : 4/28/2009 7:59:12 PM GMT
'{$STAMP BS2}
'{$PBASIC 2.5}
x······ VAR·· Word
y······ VAR·· Word
value·· VAR·· Word
DO
· PULSIN 6, 1, x
· PULSIN 7, 1, y
· value = (x MIN 2180 MAX 2820) - 2180 ** 26112 - 127
· DEBUG CLS, ? value
· PAUSE 100
LOOP
please take a look at and see if makes sense, I have also sent to roboteq.com as well.
bern
bern
When you run the code, do you get the expected valued from the tilt sensor and only the motors are not working properly; of what exactly is or is not working?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
thanks again for support
bern
The BASIC Stamp can be disconnected from the PC. The values you are getting from the sensor will have to be converted to a usable format; which is why the pulse method might be a little bit easier than serial.
Can you try sending a Pulse to the controller and see if you can get them to recognize that command?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
'{$STAMP BS2}
'{$PBASIC 2.5}
x VAR Word
time VAR Word
right VAR Word
left VAR Word
DO
· PULSIN 6, 1, x
· x = (x MIN 2180 MAX 2819) - 2180 ** 26112
· HIGH 3
· RCTIME 3, 1, time
· time= time */ 20
· time= time - 10
· right = x - time
· left= x + time
· right= (right MIN 0 MAX 254)
· left= (left MIN 0 MAX 254)
· SEROUT 7, 8276 , [noparse][[/noparse]right]
· SEROUT 8, 8276 , [noparse][[/noparse]left]
· DEBUG "x=", SDEC x, CR
· DEBUG "time=", SDEC time, CR
· DEBUG "right=", SDEC right, CR
· DEBUG "left=", SDEC left, CR
LOOP
Can you explain the operation when you run this code? It looks like you are scaling time from the RCTIME input; and then assigning it to left and right with MIN and MAX values. Can you get the serial commands to work properly with the controller? How did you come up with the baud rate of 8276?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com