Society of Robots - Robot Forum

General Misc => Misc => Topic started by: PAT_McUser on September 30, 2011, 01:28:34 PM

Title: Pololu Micro Serial Servo Controller (ssc2-code)
Post by: PAT_McUser on September 30, 2011, 01:28:34 PM
hi everyone,
I've just bought this:
http://www.pololu.com/file/0J37/ssc03a_guide.pdf (http://www.pololu.com/file/0J37/ssc03a_guide.pdf)
I have the old axon and tried to make the ssc II Code work via the uart.
Here my code:
Code: [Select]
void Micro_Servo_SSC2(u08 servo, u08 Pos)
{
uartSetBaudRate(3,9600 ); //select baud
rprintf("\r\n sending Position %d to Servo %d.",Pos,servo);
uart3SendByte(0xFF); //Startbyte
uart3SendByte(servo); //servo
uart3SendByte(Pos); //Position
}
I inited the uart 3 with 9600 in the axon.c, but nothing happens.
what do I make wrong? tho only thing happen is the yellow led burning.

PS:
I think the serial controller doesn't understand the message, because after every byte the uart sends a stopbit.
In this case the only thing i need to know is how can i send three byte without a stopbit between the bytes.

Can someone help me... ...I don't know what to do.


PSS: Yes, I had googled and I reed the post with "look in the uart documentation"
Title: Re: Pololu Micro Serial Servo Controller (ssc2-code)
Post by: Gertlex on September 30, 2011, 02:58:36 PM
First thing first, did you put the jumper on the two pins to put the SSC in MiniSSCII mode?

I've used the original Scott Edwards SSC with the Axon, and I have the pololu mini one, but have never used the latter.

This is the code I had 3 years ago when I did this (pre-webbotlib):

Code: [Select]
void minissc(u08 servo,u08 position)
    {
    rprintf("%c",255);
    delay_us(10);

    rprintf("%c",servo);
    delay_us(10);

    rprintf("%c",position);
    delay_us(10);

    return;

    }
You might try the delays between commands...

Other than that, I've got no idea, but might see if I can get mine working with my Axon this weekend (busy weekend though)
Title: Re: Pololu Micro Serial Servo Controller (ssc2-code)
Post by: PAT_McUser on October 01, 2011, 09:24:10 AM
Quote
First thing first, did you put the jumper on the two pins to put the SSC in MiniSSCII mode?
Yes, the jumper is in place.
Quote
I've used the original Scott Edwards SSC with the Axon, and I have the pololu mini one, but have never used the latter.

This is the code I had 3 years ago when I did this (pre-webbotlib):


Code:

void minissc(u08 servo,u08 position)
    {
    rprintf("%c",255);
    delay_us(10);

    rprintf("%c",servo);
    delay_us(10);

    rprintf("%c",position);
    delay_us(10);

    return;

    }
Am I right, if I think your rprintf is configures on the uart where the device is connected?
So the only difference is the delay between the messages
Quote

You might try the delays between commands...
I will do so. Maybe that's it.
Quote
Other than that, I've got no idea, but might see if I can get mine working with my Axon this weekend (busy weekend though)
I'm with you, my weekends have more work than the hole week too. ;-)
Thanks for the reply, if I have tested it I'll give a information about what happens.

cu
Title: Re: Pololu Micro Serial Servo Controller (ssc2-code)
Post by: PAT_McUser on October 01, 2011, 09:41:10 AM
no change with delay.

ADD: if found the "u08 uartSendBuffer(u08 nUart, char *buffer, u16 nBytes)" fkt,
used it like this
Quote
         u08 data[3];
         data[0] = 0xFF;
         data[1] = servo;
         data[2] = Pos;
         uartSendBuffer(3, data, 3);
nothing happens

I hope it's plugged right, if the axons T (transmit) is connected to the SIN (logiclevel serial input) and not to the COM (RS-232 serial input)

(It must be right, but I'm so confused of this thing.)

I'll keep trying (still hoping someone wants to share his knowledge with me)

ADD2:tested this
Quote
   rprintfInit(uart3SendByte);
   rprintf("%c",0xFF);
   rprintf("%c",0x00);
   rprintf("%c",0xFF);
   delay_ms(500);
   rprintf("%c%c%c",0xFF,0x00,0xFF);
   delay_ms(500);
   rprintf("%c %c %c",0xFF,0x00,0xFF);
   delay_ms(500);
   rprintf("%c, %c, %c",0xFF,0x00,0xFF);
nothiong happens
Title: Re: Pololu Micro Serial Servo Controller (ssc2-code)
Post by: Gertlex on October 03, 2011, 06:21:25 PM
No time at the moment...  I forgot earlier that this protocol is supported in Webbotlib, which  you should really use :)

How I'd go about setting up for this:
-Download the Webbotlib Downloader and run it http://webbot.org.uk/iPoint/48.page (http://webbot.org.uk/iPoint/48.page)
-In said downloader, install Webbotlib V2
-Then install Project Designer
-Make a new project with the Axon, add a serial servo driver from left pane (Actuators -> Serial Servo Driver) and configure that (choose UART, add a servo)
-Tools->Generate
-Open the resulting .aps file in AVR Studio and compile the existing code, and upload it to Axon.

You DON'T need to write any code for this test.  Project designer gives you initial code that moves all actuators back and forth with a 10 s cycle time.

If that works, you can then investigate what the software is doing, and go from there.  The code file you'll want to look at will be "projectname.c".

Hope that works!
-Gertlex
Title: Re: Pololu Micro Serial Servo Controller (ssc2-code)
Post by: Gertlex on April 15, 2012, 06:20:11 PM
So this never got resolved, and I'm finally putting my board to use. Or trying :(

I've spent 4 hours so far with almost no luck. It's as though there's something special about this board.  I've tried two computers (Win 7 and Win XP) with Python (http://dmt195.wordpress.com/2009/01/19/python-to-interface-with-the-pololu-8-channel-servo-controller/), one of the computers with Pololu's byte-sending tool (http://www.pololu.com/docs/0J23), and two different Axons (both Webbotlib code, and coding by hand).  I'm trying to use MiniSSC mode at 9600 Baud, and of course have the jumper for that.

I can get it to work via computer (I spent way too long hooking up RX backwards).  But Axon's are failing, possibly for the same reason the OP's is failing. But not enough details there...

What I am seeing is that I power on the board, and yellow LED stays on indefinitely, and sending signals does nothing.  I can short the input to ground (input "line to go high"), and the yellow LED flashes while the red LED stays lit (baud rate too low...).

It seems to be an issue pertaining to page 4 of the manual, second paragraph under Serial Input.  Theres the whole talk about input being pulled low, then pulled back to high, which is the idling state.  Is this a normal functionality? Is this something I actively have to toggle/do with UART?

I'm going to post on the Pololu forum, as well, and see if I get any resolution to this.