View Single Post
  #2   Spotlight this post!  
Unread 16-10-2014, 16:56
NotInControl NotInControl is offline
Controls Engineer
AKA: Kevin
FRC #2168 (Aluminum Falcons)
Team Role: Engineer
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Groton, CT
Posts: 261
NotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond repute
Re: Smooth Path Generator for RoboRio 2015

Quote:
Originally Posted by faust1706 View Post

Kevin, +1 for using gradient descent. I love that algorithm. Noob question: why not use the normal equation: (XX')^-1 X'y to solve for you thetas?
The algorithm is modified for the purpose of what we are trying to do here. Its actually a combination of 2 separate gradient functions playing tug of war against each other, one pushing each point and the other pulling each point. Alpha and Beta control who is "stronger" in the tug. One pulling the point away from its origin point, the other pushing it back. A happy medium generates smooth transitions. If we didn't modify the approach and used a single gradient method to try to minimize the distance between all points, the solution will always be a straight line from the first node to the last node. You can achieve this result, by making Alpha zero, which essentially takes one half of the algorithm out of the tug of war and thus with only Beta active, will pull the solution to a straight line. This doesn't work for us. Another reason why I avoid the format you posted, is based on my own best practice that I try to live by, is avoid having to calculate the inverse of a variable because can lead to problems dealing with singularizes and crashes when you do not control the dataset, as in most algorithm cases.

Quote:
Originally Posted by faust1706 View Post
You mentioned this was part of you PhD thesis (first of all, that's really impressive. Some of my lab mates are working on theirs and it looks incredibly stressful). For your project of "developing a controller for an Autonomous Car," are you given a path already? I'm curious because I wrote a pathfinding algorithm (really just an adaption of a*) over the summer and I'm taking the path generated from that and putting it into my program that generates velocity profiles of the left and right side for the robot. I am just wondering if you're doing a similar thing.
We have no apriori knowledge other than map definition data (gps location of streets, 1-way, or 2-way, sidewalks, stores, etc) and a destination. We also have speed limit definitions for each roads.


Quote:
Originally Posted by faust1706 View Post
"If the algorithm does not converge, the program will simply never finish, so it is pretty easy to identify." Luckily for an autonomous period, everything will be calculated long before the match starts, unless you develop a new path moments before the match, so you'll have ample time investigate why it fails to converge.
This is true for if you only plan to calculate the path once before the match. The reason I made that statement is subtle, but it alludes to a teams desire to calculate new paths in real-time. This would be useful for example if you got nudged in a match, and wanted to course correct. The primary reason for this approach to the problem was to support real-time or near real-time path re-planning on an embedded device. However, this is where you need to pay very close attention to the parameters, and do a lot of testing for convergence and other problems. If I have a chance, I will post some test results, I can't post anything related to my PhD study, because that is proprietary.

Quote:
Originally Posted by artK View Post
Kevin, can you talk a little more about the convergence of Alpha and Beta combinations? How did you determine whether or not certain parameters converge? And would convergence be related with the original path (Like would a path with an right or acute angle between segments have different convergence properties than a closer to straight path)?
Majority of these values were determined imperially during my previous study. I provide them here, because they still make sense, and are still valid. The default parameters have the best convergence ratio based on the algorithm structure itself. While I can not guarantee convergence for anything, I am fairly confident you will not have issues if you stay within the bounds of the table. It doesn't mean values outside of it won't work for your particular test set. If anyone runs into a convergence issue, I would like to know, because it helps everyone.

Let me think more about your second question. My hunch right now is that valid path data regardless of its actual shape should have no affect on the convergence rate of a set of parameters. But let me think about it some more, and possibly do some calcs on it and get back to you. I would assume we are talking about valid, realistic paths only, and nothing which is intentionally malformed.

Quote:
Originally Posted by GuyM142 View Post
Correct me if I'm wrong:
The code generates an array of velocities which the robot has to reach at specific times of the auto (each side independently) and with encoders on each side and a PID loop I need to make the wheels actually get to that velocity.
Did I get it right?

If so, what is the best way to use PID for velocity control?
Yes that is correct. Jared, posted some good points in the previous post. I have also had a good conversation with Austin from Team 971 on this exact topic. We share how we approach controls on each respective team, and I think a lot of useful information is in that thread. If you have a chance, give it a read. http://www.chiefdelphi.com/forums/sh...d.php?t=129574

Quote:
Originally Posted by yash101 View Post

Kevin,
Thank you for sharing this with me as now I have an almost identical piece of software that works, so I can have an example to learn off of.
No problem, let me know how it works for you. I wish I could release this under a beerware license, but this is a HS community lol.

Regards,
Kevin
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner

Last edited by NotInControl : 16-10-2014 at 17:11.