Shop OBEX P1 Docs P2 Docs Learn Events
Servo Control — Parallax Forums

Servo Control

whitelancerwhitelancer Posts: 23
edited 2006-06-16 15:14 in General Discussion
To whoever can help me,

I am an engineer doing reserach on micro robots that resemble nature. I am using a Javelin Stamp to control five servo motors that need to move to a specific position at a certain time. The Stamp needs to communicate with a servo control and give it six byte commands to move the motors. I was wondering what command would best be suited for the project. Thank you for anyone that can provide help.

Sincerely,
Jon

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-06-08 16:02
    You need to provide more info.
    Which servo controller?
    Apparently you have this info, otherwise how do you know
    that the servo commands are six bytes?

    If you don't have decided on a servo controller,
    there is this one:
    http://www.parallax.com/detail.asp?product_id=910-28023

    There is already a javelin class for this servo controller.

    regards peter
  • whitelancerwhitelancer Posts: 23
    edited 2006-06-08 16:20
    Thanks for getting back so quick...

    I am using a Pololu Micro Serial Servo Controller seen at the website posted below. Connected are five Pico Servo Motors from the same company. Let me know if you need any more info.

    Sincerely,

    http://www.pololu.com/products/pololu/0207/
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-06-08 17:04
    I skipped through the manual
    http://www.pololu.com/products/pololu/0207/ssc03a_guide.pdf

    and this is quite straightforward and well documented regarding the protocols.
    For an example how to setup a class for this controller,
    take a look at the psc class (parallax servo controller).

    regards peter
  • ParasarParasar Posts: 2
    edited 2006-06-12 19:28
    Thank you for the files. They have been a great help in providing a starting point for the programming.

    Sincerely,

    Jon
  • ParasarParasar Posts: 2
    edited 2006-06-12 20:12
    To anyone that can help,

    I have attached programs that I am trying to use to test my Pololu servo controller. They are based on the example programs and I am hoping for help with the details. Thank you.

    Sincerely,
  • whitelancerwhitelancer Posts: 23
    edited 2006-06-12 20:19
    Yes I am also working on something very similar and I am curious how you send out data to a the servo controller.

    Thanks!
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-06-12 20:34
    I put the pololu_msc.java in package stamp.peripheral.servo.pololu
    (create folder lib/stamp/peripheral/servo/pololu)

    Now both files compile

    regards peter
  • whitelancerwhitelancer Posts: 23
    edited 2006-06-14 15:52
    Thanks for the help,

    I am using the starter kit and trying to send out the data to the servo controller via pin 0, however the controller is not registring that anyting is being recieved. I have checked the connections and believe that it is somthing with the test program. I was hoping someone could check the program that is posted above or if if it is something with my connections.

    Thanks!
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-06-14 17:28
    I simplified your test program.
    Now it merely reads the used servo numbers and the green led should flash to identify the servo numbers.
    (default servo numbers is 0-7 and the led flashes 1 time, see manual)
    The reading is repeated every 3 seconds.

    regards peter
  • whitelancerwhitelancer Posts: 23
    edited 2006-06-15 20:09
    Thanks for the help...

    I am now trying to check to see if I am reciveing or even sending data correctly. I was hoping that this program would do the trick; however, I am running into some problems. Please let me know if you can help. Thanks again.

    Sincerely,
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-06-15 20:30
    The manual states the baudrates must be 2000-40000 so your 1200 is pointless.
    I suggest to stick to 9600, at this baudrate the javelin throughput (about 10kbits/s) equals
    the baudrate, meaning the uart buffer is emptied at the same rate as you can fill it.

    Did my test program make the led flash as it is supposed to do according to the manual page 8?

    If not, try Uart.invert instead of Uart.dontInvert and see if that works.

    regards peter
  • whitelancerwhitelancer Posts: 23
    edited 2006-06-16 14:09
    Thanks for the help,

    The test program is not making the led flash. I played around with the connections, the baud rate, and anything else I could think of. Do you think that it is a hardware problem with the servo controller?

    Sincerely
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-06-16 14:16
    You must have the following connections:
    javelin transmit pin to servo board logic level serial input
    javelin gnd to servo board gnd AND power gnd (all gnd's must be tied together)

    Do not power the servo board from the javelin vdd pin.

    Do you have it setup that way?

    regards peter
  • whitelancerwhitelancer Posts: 23
    edited 2006-06-16 14:31
    I am using the Javelin Starter Kit with board and I'm a little confused on what you mean by tying all the gnds together. Thanks for walking me through this.

    Sincerely
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-06-16 14:42
    Normally the servo's are powered by their own power supply.
    Connect that power supply to the servo board pins labelled
    VIN and GND (left lower corner on picture at page 2 of manual)

    Power the javelin using another power supply. Connect that power
    supply as instructed in the javelin manual.

    Now connect 2 wires from javelin board to servo board.
    One wire goes from transmit pin (pin0 in javelin test code)
    to the servo board pin labelled Logic level serial input.
    The second wire goes from GND at the javelin board to
    GND at the servo board.

    Then try the test program again. Change the Uart.dontInvert setting if
    it does not work.

    Edit: just noted there is a seperate servo power connection on the servo board.
    So you may power the servo board at VIN connection using the same power supply
    as used by the javelin.

    regards peter
  • whitelancerwhitelancer Posts: 23
    edited 2006-06-16 15:07
    Yep,

    I needed to connect the gnds to each other and the code was dontInvert. Thank you so much. I really appreciate the time and effort that you spent. Nowhere else is anyone able to provide the support found here. Thank you again.

    Sincerely,
    Jon
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-06-16 15:14
    Now that you have the connections right,
    you can test your original program.

    regards peter
Sign In or Register to comment.