PDA

View Full Version : USB Servo controller permanent ramp speed limitation



Burk
03-30-2012, 11:37 AM
Is there a way to make the Parallax servo controller (28830) never ramp faster than a certain value? Been browsing the firmware source code but i'm new to this propellor chip and didn't see the 'magic spot' yet.

Mike G
03-30-2012, 01:21 PM
Ramp is part of the position command. Don't send a ramp larger than some max value when issuing a position command.



PRI ValidateMaxRamp(value)
if(value > MY_MAX_RAMP_VALUE)
value := MY_MAX_RAMP_VALUE

return value

Burk
03-30-2012, 02:30 PM
Thank you, but i need to change the code so it will never ramp fast not even on startup/reset which might be impossible in the end if the controller doesn't know the servo's position. Guess i should try a hardware solution.

Duane Degn
03-30-2012, 04:08 PM
Thank you, but i need to change the code so it will never ramp fast not even on startup/reset which might be impossible in the end if the controller doesn't know the servo's position. Guess i should try a hardware solution.

I think normally the PSC doesn't know the servo positions at start up but you could save these values to EEPROM or some other external memory and use these positions as the initial position when starting the servos.

One problem I see, if you write to the EEPROM continuously as your device is being used, you might wear out the EEPROM.

Burk
03-30-2012, 04:25 PM
Yeah i thought of that too but it would still be a partial solution, if you'd move the servo(s) by hand it could still ramp the sh*t out of something on startup/reset.

Duane Degn
03-30-2012, 05:54 PM
If the servos can be moved while the system is off, you'd need some way of detecting there positions when starting up the servo controller.

I plan to make circuit boards for some magnetic encoders (http://forums.parallax.com/showthread.php?138736-Magnetic-Encoder-Project-(AS5055))soon. I'm hoping to make a board small enough to replace a servo's pot. I'm not sure how to go about attaching a magnet to the inside of the servo yet.

Mounting this type of encoder externally might also be an option.

Burk
03-30-2012, 06:38 PM
Not sure what i'll do yet, i might go for a servo that simply doesn't have the power to wreck things.

If you have an A/D converter available you could just read the pot in the servo to detect its position.

Duane Degn
03-30-2012, 07:03 PM
Not sure what i'll do yet, i might go for a servo that simply doesn't have the power to wreck things.

If you have an A/D converter available you could just read the pot in the servo to detect its position.

I think Rayman is working on something like this.

Beau also has a method for reading a servo's position. I thought I had a link to Beau's method in my index but I couldn't find it.

Burk
04-09-2012, 12:32 PM
With ramping enabled a servo will ramp if you disable en enable it (not cool), is there a newer firmware revision perhaps that doesn't?

E: Never mind, sort of got it working.. i'll get there...