ā05-17-2018 01:14 PM
hi, i need help can any one tell me how i use the ease algorithm to smooth servo motors in the following code.i don't understand.Am very thank full if someone help me.https://www.youtube.com/watch?v=s1wftbwu96g
ā05-18-2018 09:10 AM
Hey Qasim,
Not quite sure where the code you posted is at, but the way I implement ease equations is basically through a type of fuzzy logic. I noticed in the video that your servo basically has one speed and that creates jarring and jerking when it changes direction. What I do in that case is have a loop keeping track of the position of the servo and adjusting the max speed when it approaches the sides. For instance, if the max speed is 50 in the video. The servo constantly goes 50 and creates the jarring that you showed. I would have Max_Speed = 50 if between 25-75 and if between 0-24 or 76-100 be 25 or 10. If you wanted to break it down even more you could as well.
That's the simplest albeit brute force approach to adjusting smoothness.
-Bear
ā05-18-2018 09:29 AM
A Web Search for Easing Algorithm turned up a number of references, including some from the person credited with inventing the algorithm. It doesn't look all that difficult to implement, but (of course) the Devil is in the Details. Basically, it involves "easing" (meaning "gradually changing" into a motion -- for example, instead of going instanteously from position a to position b (a step function would be rather "jerky"), you can move at constant velocity (and not too fast) from a to b, or you can accelerate (at not too fast) to a not-too-fast constant velocity, then decelerate to end up at b, or use some other function.
Go read about the algorithm, then try to implement it yourself. If you cannot, at least implement the "step" algorithm, i.e. develop some code that takes the servo from Point a to Point b. Post the code, describe what you've tried to get Easing to work, and someone will surely come forward to help. But we need a better understanding of (a) your problem, (b) your LabVIEW skill, and (c) to know we aren't functioning as a "Free Homework Service" for you.
Bob Schor
ā05-18-2018 11:54 AM
Thanks for your reply .
ā05-18-2018 12:07 PM
i just downloaded this project from the NI forum named by mytracker,when i run this project on myrio it not work quite well as shown in video. https://www.youtube.com/watch?v=DrHPyBcQAW8.when i search the main page where that project posted.https://forums.ni.com/t5/myRIO-Student-Projects/myTracker-An-autonomous-color-tracking-camera/ta-p/3... i found easing algorithm to smooth the servo motors.https://forums.ni.com/t5/Example-Programs/Servo-Easing-algorithm-using-LabVIEW/ta-p/3504112
but i don't understand how i put this easing algorithm in the mytracker project to smooth the servo.
ā05-18-2018 12:13 PM
i just downloaded project from the NI forum named by mytracker,when i run this project on myrio it not work quite well as shown in video. https://www.youtube.com/watch?v=DrHPyBcQAW8.when i search the main page where that project posted.https://forums.ni.com/t5/myRIO-Student-Projects/myTracker-An-autonomous-color-tracking-camera/ta-p/3... i found easing algorithm to smooth the servo motors.https://forums.ni.com/t5/Example-Programs/Servo-Easing-algorithm-using-LabVIEW/ta-p/3504112
but i don't understand how i put this easing algorithm in the mytracker project to smooth the servo. can anyone help me.
ā05-19-2018 09:23 AM
I think you might be making this more complicated than it needs to be. It might also be the case that you might not be too familiar with Servo systems, as you haven't given much relevant information to help us understand the level of your knowledge and experience.
I've worked with several different types of servo systems, and realize (in retrospect) that I've used a form of "easing" without even noticing it. The first question to ask is what kind of servo drive do you have -- is it a "position" system (like a stepper motor, where you can say "go 1000 steps to this position"), or is it a "velocity" system (where you give a current or voltage that means "turn at this speed")? The second question is what are you trying to control, the velocity or the position?
The simplest conceptual situation is where you have a position drive and you want to control position. Well, if you are already at the correct position, just stay there, no need to do anything. But what if you want to move to a new position? What you typically want to do is to say "I want to go from Here to There, but with a certain velocity (so I don't break anything by moving too quickly) and with a certain acceleration (so there is minimal "jerk" at the beginning and end of the movement). It is not a bad exercise to work out the equations of motion to program into the Servo System to take it on a determined-by-you path from A to B with the Velocity and Acceleration constraints given. If you think about this, you are probably doing second-order Easing -- all you have to do is to tell your Servo System to "go to this Position at this time" and trace out the Position curve that makes the nice acceleration-to-constant velocity-to-deceleration-to-stop at final Position curve.
It can get a little more complicated when the Servo system and/or the Control variable is velocity ...
Bob Schor