Shop OBEX P1 Docs P2 Docs Learn Events
Servo controller with the javelin stamp booting issue — Parallax Forums

Servo controller with the javelin stamp booting issue

SIMECorpSIMECorp Posts: 4
edited 2005-04-28 18:46 in General Discussion
I am using 2 servo controllers with the javelin stamp and I am having peculiar problems with booting up the system. I am using 8 servos on one controller and 9 on the other. These servos are large ones which can draw up to 800 mA each when turning. I know the limit is 10A per controller and I am using a 12 A 5v supply for everything.
The strange behavior is that when I boot the system (note I added a delay in the javelin to give the servo controllers time to boot) there is a sudden jerk. After power on and the initial jerk, if there are more than 10 servos connected to the system the servo controllers respond to the javelin (reporting position for example) but the servos do not move. With less than 10 servos the system boots and runs fine, I can even then connect the rest of the servos and the system will continue to work.
Has anyone seen similar behavior or know what is going on? More importantly does anyone have any ideas of what to try?

Comments

  • KrayBluKrayBlu Posts: 2
    edited 2005-04-18 07:11
    im trying to interface the javelin stamp with the parallax servo controller can u post some sample code that you used to controll your servos? i cant get anywhere
  • Jon KeinathJon Keinath Posts: 146
    edited 2005-04-18 16:17
    KrayBlu -

    I don't have my code with me, but I will post it tonight when I get home if someone doesn't beat me to it.
  • KrayBluKrayBlu Posts: 2
    edited 2005-04-18 16:44
    Jon,

    Thanks alot...I'll be waiting!!! but Im still trying also
  • Jon KeinathJon Keinath Posts: 146
    edited 2005-04-19 00:17
    Alright, here is some code that I use to communicate with the servo controller.

    import stamp.core.*;
    public class PSCExample
        {
        static Uart txUart = new Uart(Uart.dirTransmit,CPU.pin13,Uart.dontInvert,//Pin13 is the pin I have it connected to
                        Uart.speed2400,Uart.stop1); //Creates a Uart for Communication
        public static void main()
            {
            //Code to send new position for servo to PSC
            txUart.sendString("!SC");     //Servo Controller
            txUart.sendByte(pscChannel);  //Channel that the Servo is on (0-15)
            txUart.sendByte(ramp);        //Ramp Value (speed at which servo will attempt to reach new position)
            txUart.sendByte(pulseWidth);  //Value you want the servo to move to (250-1250,750=center)
            txUart.sendByte(pulseWidth>>>8);
            txUart.sendByte(0x0D);       //End command
            }
        }
    
    



    This is the basic structure of the program. Of course You will have to define the variables and actually make the code do something.

    I have attached a sample program that will move a servo in (port 0 with the PSC on pin 13) back and forth from 0* to 180*. I also have the code for increasing the baud speed, if you need that I can post that also (I plan to soon post it on my website too).

    If you have any questions just ask, I'll be happy to answer them if I can.

    -Jon
  • SIMECorpSIMECorp Posts: 4
    edited 2005-04-28 18:38
    I have attached the servo class I created. It handles creating a servo (with limited range if needed) and can be tested to see if moving.
    Note I commented out the backlash handeling. This has been very stable.

    If you have any questions do not hesitate to email me.

    Hope this helps

    Alan
  • SIMECorpSIMECorp Posts: 4
    edited 2005-04-28 18:46
    Forgot to mention that the Servo.class works in degrees (since I am lazy) with 0 being a centered servo and +-90 is the normal range

    the initalizer is
    Servo( int servoChannel )
    or
    Servo( int servoChannel, int zeroPosition, int limit ) where zeroPosition is the center and limit is in degrees

    operations are
    int setPosition( int newPosition )
    boolean finished( )

    Alan
Sign In or Register to comment.