Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Help with S-Curve Generator (http://www.chiefdelphi.com/forums/showthread.php?t=137190)

Necroterra 08-05-2015 18:46

Help with S-Curve Generator
 
I am currently trying to write an algorithm that will output an array of values representing a 3rd order (finite jerk) motion path. I was wondering whether I should be spit out an array of position values and then send that to a Talon SRX Positional PID controller, or an array of velocities and send that to a Talon SRX Velocity PID controller. I feel the positional control would likely be more accurate, but possibly less smooth.

GeeTwo 08-05-2015 19:22

Re: Help with S-Curve Generator
 
As with so many questions on Chief Delphi, "it depends."

If ending up at the right spot is much more important than controlling the jerk, then yes, go with the positional control. Ex: placing a heavy piece into a tight-fit cradle.

If controlling jerk is more important, and end position doesn't matter too much, control velocity. Ex: Place the glass about there on the table without spilling a drop.

If both are important, you will need to use a true closed-loop control. One of the features of the Talon SRX is that it will perform an internal closed loop. This enables you to drive it using an open loop control as far as the computer is concerned, provided that the SRX will do what you desire. However, this increase in simplicity comes with limitations as to what it actually will do. To achieve both results simultaneously, a simple PID loop as implemented on the SRX will not solve your problem; you will need to bring the sensor results back to the computer to make adjustments for a multi-variable closed loop. As I recall, the CAN driver software provides methods to get these numbers.

Whether you drive the SRX in its own closed loop to control one variable, and tweak it with the computer to get to the final endpoint, or do both parts within the computer is a matter of personal preference/ability and finer details of the task. For example, if the load is not always the same weight, you will more likely find success controlling the motor directly from the computer; you may even find it helpful to use an encoder and let the 'RIO do the integration into position for you rather than install a position sensor and differentiate to turn that into speed. If the process is highly repeatable, then letting the SRX do its thing with just a tweak here or there is probably viable.

Necroterra 08-05-2015 19:44

Re: Help with S-Curve Generator
 
@geetwo, thank you a ton. I'll look into the options you mentioned!

Ether 08-05-2015 21:23

Re: Help with S-Curve Generator
 
Quote:

Originally Posted by Necroterra (Post 1481102)
I was wondering whether I should be spit out an array of position values and then send that to a Talon SRX Positional PID controller, or an array of velocities and send that to a Talon SRX Velocity PID controller. I feel the positional control would likely be more accurate, but possibly less smooth.

You could do both:

Put the Talon in closed-loop speed control mode.

Generate x(t), v(t) , and a(t), and use those with a cascaded controller.

~

TheHolyHades1 08-05-2015 21:24

Re: Help with S-Curve Generator
 
You may also want to look at some of the methods the Cheesy Poofs implemented this year and the year before. Their code is open source, and they summarized their algorithms well in their presentation at champs this year. I've been searching and can't seem to find a link to it, but perhaps someone will be able to provide one.

Ether 08-05-2015 21:30

Re: Help with S-Curve Generator
 
Quote:

Originally Posted by Necroterra (Post 1481102)
I am currently trying to write an algorithm that will output an array of values representing a 3rd order (finite jerk) motion path.

If your goal is to start and end at zero speed, and go in a straight line, take a look at a sinusoidal accel profile.

~

Necroterra 08-05-2015 21:35

Re: Help with S-Curve Generator
 
Quote:

Originally Posted by Ether (Post 1481128)
You could do both:

Put the Talon in closed-loop speed control mode.

Generate x(t), v(t) , and a(t), and use those with a cascaded controller.

~

Is that link from a textbook or is it something you could link me too? I would love to see the explanation / derivation of that.

Joe Johnson 08-05-2015 21:51

Re: Help with S-Curve Generator
 
I have to get smart on this because I fear that my info may be out of date, but from what I currently understand, the best controllers put a velocity control loop at the lowest level with a supervisory higher level control that is doing the path planning, limiting accels/decels, ...

Just today I asked a true roboticist that I work with (I'm looking at you Shamlian.net) for a "robot arm controls for dummies" sort of a book. He promised to give it some thought and get back to me next week.

Stay tuned.

Joe J.

Ether 08-05-2015 21:53

Re: Help with S-Curve Generator
 
Quote:

Originally Posted by Necroterra (Post 1481135)
Is that link from a textbook or is it something you could link me too? I would love to see the explanation / derivation of that.

http://tinyurl.com/mfumj2w ... Chapter 17

~

Ether 08-05-2015 21:59

Re: Help with S-Curve Generator
 
Quote:

Originally Posted by TheHolyHades1 (Post 1481129)
You may also want to look at some of the methods the Cheesy Poofs implemented this year and the year before. Their code is open source, and they summarized their algorithms well in their presentation at champs this year. I've been searching and can't seem to find a link to it, but perhaps someone will be able to provide one.

http://www.chiefdelphi.com/forums/sh...8&postcount=24

~

Ether 09-05-2015 11:15

Re: Help with S-Curve Generator
 
Quote:

Originally Posted by Necroterra (Post 1481135)
I would love to see the explanation / derivation of that.

This sketch may be a bit clearer.




All times are GMT -5. The time now is 01:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi