Requested

Smoothing Motions


Completed
This feature request has been completed. Install the latest ARC Pro to experience the newest features and bug fixes.

Get ARC Pro

@DJ, I recently saw this video by James. He shows how he adds a couple of lines of adruino code to smooth out positions for servos. You can see his solution starting at about 5:00 in the video. Not sure if this is something that could easily be added to ARC? Its something we have talked about for years.


ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

PRO
Synthiam
#1  

Here's the settings in ARC for accomplishing that with servos that support those two options. I believe feetech and dynamixel do. You'd have to check the robot skill manual for each and see if it's mentioned.

User-inserted image

On to what he is doing - isn't modular. He's using the full clock cycle of the arduino to barely run 2 or 3 servos - because of how it is accomplished. An ideal option would be if there was a PWM servo library that supported acceleration - but I doubt it'll be powerful enough to do more than a few servos. Does the SSC-32 support acceleration? Might be worthwhile looking into a servo controller that supports acceleration and let me know what you find. I can always add support for that controller if you come across one.

PRO
Synthiam
#2  

This might be a worthwhile servo library to test on an arduino ezb firmware: https://github.com/cansik/smooth-servo

It's an old library but might still work. There's no details if the project was completed or not

PRO
Synthiam
#3  

Nope - that github is not a real project. Just some guy talking about something he doesn't know how to do.

I did find this, which might be complete? Hard to tell with open source projects.  https://www.arduino.cc/reference/en/libraries/servoeasing/

PRO
Synthiam
#4  

Ah, so that servoeasing library seems to be complete but only can control 2 servos. And the entire system pauses until the servo has moved. To get around that, they created an idea of having a second servo controller connected to the arduino. They recommend a PCA9685 expander. So the solution for a custom ezb firmware for smoothing PWM hobby servos would require an Arduino and a PCA9685 expander. I'd have to do more digging and testing because nothing open-source ever works first try :)

The trouble is that controlling one or two pwm hobby servos with calculations for smoothing would use up all of the microcontroller's capability. The way a hobby servo works is by sending pulses in a microsecond resolution. A servo has a PWM packet that repeats every 20ms. But, the resolution is how long the PWM is in 1 ms of time. If you can split 1ms into 180 resolutions, then you can get 180 resolutions. Doing that with 1 or 2 servos and having calculations for smoothing wouldn't be possible with more servos on a single micro. That's why they use an expander. So the expander takes control of the servo pwm position signal, and the arduino calculates the position. They're splitting the task across multiple microcontrollers.

PRO
Synthiam
#5  

Here's what you're up against when trying to use a PWM hobby servo for smoothing acceleration. You'll see how precise the resolution must be. That's why we're not seeing this capability on servo controllers. At least not without connecting a few together such as the expander mentioned above combined with an arduino. Still something might be possible though - just have to think more on that.

My biggest question is it worthwhile since pwm hobby servos are blech anyway? :D

PRO
USA
#6   — Edited

Ahh ok good to know. Just first time I’ve got to look around with robot stuff today.. turkey day here in the states and I have the weekend off. I’ll take a look around at your links! Hope you guys are well!

I think we posted at the same time........ FANTASTIC VIDEO THANK YOU!

PRO
Synthiam
#7  

Haha yah. Happy turkey day to you! Weekend + Robots = awesome

I think that servo expander and a small arduino would actually work for this idea. I'm putting a few pieces together in my mind. I'd have to get it to work with a regular arduino first to see how reliable it is. If so, it could be something easily achievable to give pwm hobby servos some form of acceleration

#8   — Edited

James Bruton is a god and we should all favorite his youtube channel. I liked it in the olden days when you could reproduce what he was making without a lot of cash but hie has upped his game with new sponsors

PRO
Synthiam
#9  

This conversation was about hobby-style PWM servos supporting acceleration. While there's already support for acceleration with smart servos (i.e., dynamixel and feetech), a new robot skill supports acceleration with PWM.

Here is the robot skill that supports acceleration with PWM hobby servos: https://synthiam.com/Support/Skills/Servo/Maestro-Servo-Controller?id=21056

PRO
Canada
#10  

Nice, it always makes me chuckle when you question if it is worthwhile to add a new feature and then you add it anyway :)

PRO
Synthiam
#11  

Hahaha - well, it was added for a different reason. The Maestro from Polulululululu was on our partner request robot skill list. I was sitting watching a movie and saw the list and figured that this would be an easy skill to whip out. It turns out it uses PWM servos and has an Acceleration parameter. That's when I had a hazy memory of someone asking about that. So I looked on the feature request page and found this.

So by doing the polulululululu Maestro servo controller, I got two birds stoned with one robot skill.

PRO
Synthiam
#12  

Oh, I did order a PCA9685 expander as well. So I'd like to eventually try that solution with the Arduino library mentioned above. It can convert a regular Arduino into a servo controller with acceleration and velocity... I think... if it works. But it's open-source, so my expectations are low. :D