Shop OBEX P1 Docs P2 Docs Learn Events
stamp and robotq ax2550 — Parallax Forums

stamp and robotq ax2550

bernbern Posts: 6
edited 2009-05-19 16:28 in BASIC Stamp
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

Comments

  • JDJD Posts: 570
    edited 2009-04-28 18:28
    Bern,

    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
  • bernbern Posts: 6
    edited 2009-04-28 18:49
    here are some pics of the student project, the seaholm segway.

    thanks
    bern
    2048 x 1536 - 1M
    2048 x 1536 - 1M
    1536 x 2048 - 1M
    2048 x 1536 - 1M
  • bernbern Posts: 6
    edited 2009-04-28 18:51
    attached is the link for the manual for the motor controller.· the chapter on rs232 communication seems to be the relevant chapter.· thanks again for any hep.

    the third section "users manual" is the one to select.

    http://www.roboteq.com/tech-support/technical-documentation.html

    bern
  • JDJD Posts: 570
    edited 2009-04-28 18:56
    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
  • JDJD Posts: 570
    edited 2009-04-28 19:05
    Bern,

    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
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2009-04-28 19:30
    It also looks like you can use the controller in R/C mode and in that case it would just look like a pair of large servo's. Since there are lots of examples for using a stamp to control those you may want to consider that method we well.
  • JDJD Posts: 570
    edited 2009-04-28 19:49
    That is a very good point; there are various examples of ramping, scaling a pulse from an input, and general control available from the texts available and sample code on the forums. If you stick with the serial communication option, you may have some slightly more detailed programming that will need to be done, and not near as many types of sample code. You would want to review the options that the RS232 provides and see if you would use those commands, such as Read Battery Amps and·Turn Accessory Output C on/off, to see if those commands will be used. If not, an easier programming method might help get it running faster.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com

    Post Edited (Joshua Donelson (Parallax)) : 4/28/2009 7:59:12 PM GMT
  • NWUpgradesNWUpgrades Posts: 292
    edited 2009-04-29 05:51
    Just out of curiosity, where did you get the motors?
  • Mike SarzMike Sarz Posts: 2
    edited 2009-05-05 13:21
    Hello all, I am the one who is doing the programming and I have·a problem I hope you can fix.·I just strated to write the program but the value I am getting is not negative (It is in the high thousands). I need it to be negative in some occations. Any suggestions.

    '{$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
  • bernbern Posts: 6
    edited 2009-05-08 13:32
    I am posting file from student who has been working on segway-balancing robot.



    please take a look at and see if makes sense, I have also sent to roboteq.com as well.

    bern
  • bernbern Posts: 6
    edited 2009-05-15 13:07
    the motors (t74) and motor controller came from robotmarketplace.com.



    bern
  • JDJD Posts: 570
    edited 2009-05-15 21:49
    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
  • bernbern Posts: 6
    edited 2009-05-15 22:53
    we get values we understand, however, not in format for correct roboteq controller.· the accelerometer and pot swith function exaclty as they should.· Not sure if data is being sent through serial port of stamp or not.· when e plug into roboteq, no response.· We have read manuals from roboteq, however, not computer savvy enough to understand.·· I believe we can unplug stamp from computer and still have program running as we plug into roboteq, not 100% we are doing that right.·



    thanks again for support

    bern
  • JDJD Posts: 570
    edited 2009-05-15 23:44
    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
  • Mike SarzMike Sarz Posts: 2
    edited 2009-05-19 13:19
    Heres my other program

    '{$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
  • JDJD Posts: 570
    edited 2009-05-19 16:28
    Mike,

    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
Sign In or Register to comment.