Micro servo controller

To anyone that can help,

I am engineer and I am using a Javelin Stamp to run five servo motors for a robot that will mimic nature. When I try and send information to the controller it gives me a constant yellow when I am connected to the logic level serial input. When i am connected to the RS-232 input i get a flashing green and constant red light. I would greatly appreciate anyone that could help me out. Below is the simple test code that i have been using in Java. Thanks!!!

Sincerely,

import stamp.peripheral.servo.pololu.*;
import stamp.core.*;

public class pololu_msc_test {

  static Uart tx = new Uart(Uart.dirTransmit,CPU.pin1,Uart.dontInvert,Uart.speed9600,Uart.stop1);

  static void main() {
    System.out.println("Pololu mode (jumper not installed) test program");

    while (true) {
      //get servo numbers, the green led will flash to identify servo numbers
      tx.sendByte(0x80);
      tx.sendByte(0x02);
      tx.sendByte(0x10);
      CPU.delay(31500); //wait 3 secs
    }
  }
 }

Hello,

The yellow LED stays on until the servo controller sees activity on the serial line. Until that changes, you’re apparently not sending anything to the servo controller. If the serial rate is too fast, you will get the red LED on with the green flashing. If you are connecting directly from a small microcontroller, you most likely want to use the logic-level input.

- Jan

Thanks for the reply. I am using a very simple code and I am getting serial activity when I use the same code for the RS-232 line but no activity when using the serial input line. Is there anymore advice that you may have? Can I use the RS-232 line for the code and change the baud rate? Is there something wrong with the controller? The microprocessor and servos all work indpendent of the controller. Thank you again for your help.

The RS-232 input goes to the same pin on the microcontroller, so it is extremely unlikely for the RS-232 input to work and the logic level input to not work. Therefore, I strongly suspect that you have a bad connection. Since the solid yellow light means the device sees no activity, try just toggling the line. If you can’t get that working, perhaps you can send inverted serial to the RS-232 input.

- Jan

Hey,

The servo controller works great, however, I am having trouble sending data to get a range of say 100 degrees. I am using Pololu mode and I am sending the data as hexadecimal with the absolute position command. I was hoping you could clarify what numbers i should be using to find get such a range out of the Pico servo motors. Thanks for your help and support.

Sincerely,
Jon

You should be able to send smaller and smaller positions to find one limit of the servo, and larger and larger positions to find the other limit. As you get to the mechanical limit, you will see and hear it; be careful to go gradually and back off right away when you find the limit. Each servo will be different, so if you want to get a large range, you will need to calibrate each one. However, you should easily be able to get over 120 degrees using the same numbers, centered at 1.5 ms (=1500 us, or 3000 for the absolute position parameter), for most servos.

- Jan

Hey,

I have been using my micro servo controller for several weeks and it has been working really well. However, all of a sudden today the three LED lights remain on even when I disconnect power and then reconnect with no signal coming in. I was wondering if anyone had any suggestions to help.

Thanks!

All LEDs on means that the serial input is staying low. Make sure you don’t have a short from your serial input to ground, or from the RS-232 input (which has an inverter on it) to power.

- Jan

I can’t seem to get the micro controller to work. I am using the serial input (not RS-232) and all the LEDS remain on no matter what i do. How do I determine if there is a short for the serial input to the ground. I was also wondering if you have to send signals to the controller in hexadecimal form or if you can simply send it it decimal form. Thank you for your time and consideration.

Sincerely,
Jon

You can use a multimeter for looking for a short. If you don’t have one, it would be a good investment if you want to work with robotics.

For your other question, you should look around for some information about numbers because you have some major misunderstandings. Briefly, a number, say 5, is that number regardless of if we represent it as “5” or “V” (roman numerals) or “five”. Whether you write “.20” (decimal) or 0x14 (hex) or b’00010100’" (binary), the concept is always “the number twenty”; the different notations are just different ways of communicating that same number to your compiler or assembler (or to other people). Internally, everything is stored in a binary representation and sent as a binary representation, where different voltages correspond to ones and zeros and different physical or temporal locations indicate the position of that digit.

- Jan