Go to Post ...we might be able to take the 'out' out of 'outsourcing' - if we all share a strong cultural set of values, who exactly is 'out'? I think FIRST is a great way to do this, ... - Ian Mackenzie [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 08-05-2015, 18:46
Necroterra's Avatar
Necroterra Necroterra is offline
Registered User
FRC #4183 (Bit Buckets)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Tucson
Posts: 26
Necroterra will become famous soon enough
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.
__________________

2015 Arizona East - Regional Winners, Creativity Award
  #2   Spotlight this post!  
Unread 08-05-2015, 19:22
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,614
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
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.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.

Last edited by GeeTwo : 08-05-2015 at 19:26.
  #3   Spotlight this post!  
Unread 08-05-2015, 19:44
Necroterra's Avatar
Necroterra Necroterra is offline
Registered User
FRC #4183 (Bit Buckets)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Tucson
Posts: 26
Necroterra will become famous soon enough
Re: Help with S-Curve Generator

@geetwo, thank you a ton. I'll look into the options you mentioned!
__________________

2015 Arizona East - Regional Winners, Creativity Award
  #4   Spotlight this post!  
Unread 08-05-2015, 21:24
TheHolyHades1 TheHolyHades1 is offline
Registered User
no team
 
Join Date: Jan 2014
Rookie Year: 2010
Location: usa
Posts: 145
TheHolyHades1 is a jewel in the roughTheHolyHades1 is a jewel in the roughTheHolyHades1 is a jewel in the rough
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.
  #5   Spotlight this post!  
Unread 08-05-2015, 21:59
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Help with S-Curve Generator

Quote:
Originally Posted by TheHolyHades1 View Post
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

~
  #6   Spotlight this post!  
Unread 08-05-2015, 21:23
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Help with S-Curve Generator

Quote:
Originally Posted by Necroterra View Post
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.

~
  #7   Spotlight this post!  
Unread 08-05-2015, 21:35
Necroterra's Avatar
Necroterra Necroterra is offline
Registered User
FRC #4183 (Bit Buckets)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Tucson
Posts: 26
Necroterra will become famous soon enough
Re: Help with S-Curve Generator

Quote:
Originally Posted by Ether View Post
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.
__________________

2015 Arizona East - Regional Winners, Creativity Award
  #8   Spotlight this post!  
Unread 08-05-2015, 21:51
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
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.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
  #9   Spotlight this post!  
Unread 08-05-2015, 21:53
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Help with S-Curve Generator

Quote:
Originally Posted by Necroterra View Post
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

~
  #10   Spotlight this post!  
Unread 09-05-2015, 11:15
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Help with S-Curve Generator

Quote:
Originally Posted by Necroterra View Post
I would love to see the explanation / derivation of that.
This sketch may be a bit clearer.


  #11   Spotlight this post!  
Unread 08-05-2015, 21:30
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Help with S-Curve Generator

Quote:
Originally Posted by Necroterra View Post
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.

~
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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