Society of Robots - Robot Forum

Software => Software => Topic started by: Webbot on May 18, 2010, 11:36:35 AM

Title: WebbotLib application to center a servo
Post by: Webbot on May 18, 2010, 11:36:35 AM
Calling all WebbotLib'ers

When using servos with WebbotLib you need to specify the center position (normally 1500us) and the range either side (normally 500us). However these numbers (especially the range) can vary for different models of servos. For home modified continuous rotation servos you also need to change the center position to match your servo.

I was thinking of writing a computer application (like Project Designer, Gait Designer etc) that is just for centering a servo and finding the active range of a servo.

ie download a provided hex file to the Axon, Axon II, etc and then run the application on your computer that talks to the board/servo over USB/UART. Then move some sliders around in the computer window to find the correct values for center and range and note them down (or better to write on a sticky label and stick to servo).

Of course you can do this yourself iteratively by: changing the values, compiling, flashing, test, repeat until the values are ok. But its very time consuming

Sound useful, any takers?

Title: Re: WebbotLib application to center a servo
Post by: TrickyNekro on May 18, 2010, 11:57:33 AM
Instead of a pc program this can be simply don't with a trimmer...  ::)

Set the trimmer, center the servo then sent with Uart/ USB the center.... simple as this....
Title: Re: WebbotLib application to center a servo
Post by: Webbot on May 18, 2010, 12:03:34 PM
Well not quite - you are thinking of a trimmer to find the center position of continuous rotation servo.

But the center position, even of a non-modified servo, is an abstract thing. For example I have a Lynxmotion Brat biped which uses unmodified servos. The servos for the 'ankles' do not put the foot flat onto the ground. So I want to change the center position away from 1500us until the foot is flat on the floor. Much easier to do this in software than to take the servo apart and add extra components!
Title: Re: WebbotLib application to center a servo
Post by: huevon on May 18, 2010, 12:07:23 PM
I am rubbish at programming and your idea is a 100% match with what I need at the moment. I am not the only noob around, so definately will be useful more than once
Title: Re: WebbotLib application to center a servo
Post by: TrickyNekro on May 18, 2010, 12:09:48 PM
No no no no... I was talking about a trimmer on a ADC channel... you know... to set the offset... ;-)
If the value of the servo PWM stays the same for some cycles then send center position via UART/USB!

So you wouldn't mess writing a program for win, mac linux... etc etc etc....
Just a simple terminal is more than enough  ;)
Title: Re: WebbotLib application to center a servo
Post by: Webbot on May 18, 2010, 12:17:40 PM
Oh ok. But then your finished robot also needs the trimmers on the ADC ports.

EDIT:- and you would also need a trimmer for each servo for the 'range'. So two trimmers and two ADC channels per servo.

My suggestion was to just use software to find the correct values,  put them into your code, and all done - no extra hardware required.

Don't worry about the Mac, PC, Linux issue - thats my problem! Since all of the other Webbot applications are Java based then it runs on most platforms anyway.

Title: Re: WebbotLib application to center a servo
Post by: TrickyNekro on May 18, 2010, 12:23:13 PM
No you won't need a trimmer on your final robot... But you will need a trimmer in the beginning...
Since your project, I can only suggest...  :P
Getting a trimmer can't be that hard anyways.

This is the method I use ;)
The extra software can some times annoy  :P
Title: Re: WebbotLib application to center a servo
Post by: Webbot on May 18, 2010, 12:31:52 PM
@Tricky - I think we are talking at cross purposes here. You are talking about a specific project whereas I am talking about generic stuff.

Consider my Gait Designer (at http://webbot.org.uk (http://webbot.org.uk)). Lets say I create some gaits for the Brat ie stand up, squat, walk, run, punch, kick etc then these gaits work by moving servos to a position that is relative to their 'center' position.

Now someone else downloads the gaits for their own Brat. I cannot guarantee that their servos are 'identical' to mine even if they are the same make and model. They need to do some tuning.

So by allowing each person to calibrate their own servos then we are all suddenly talking about the same thing and the gait should then work on any Brat.

Thats just one example.
Title: Re: WebbotLib application to center a servo
Post by: TrickyNekro on May 18, 2010, 12:38:48 PM
We are talking exactly about the same thing but it seems that we can not understand each other.... :P
Title: Re: WebbotLib application to center a servo
Post by: Canabots on May 18, 2010, 02:27:06 PM
I would find something like this VERY useful. I have a bunch of HXT900s I'm trying to use on a quadruped, and it is fairly difficult for me to find the center and range for each individual one.

I'm all for it!
Title: Re: WebbotLib application to center a servo
Post by: Admin on May 20, 2010, 12:57:32 AM
Webbot, I've written a program similar to this and find it a necessity.

It uses keys on my keyboard to move servos and Hyperterminal to output the position - no recompiling or reuploading needed.

A cleaned up version of this built into a WebbotLib function would be great for everyone.