View Single Post
  #10   Spotlight this post!  
Unread 06-01-2016, 11:08
Beaker's Avatar
Beaker Beaker is offline
624 Programming Alum
AKA: Justin K.
no team (No Team)
Team Role: Alumni
 
Join Date: Mar 2014
Rookie Year: 2013
Location: United States
Posts: 61
Beaker is a splendid one to beholdBeaker is a splendid one to beholdBeaker is a splendid one to beholdBeaker is a splendid one to beholdBeaker is a splendid one to beholdBeaker is a splendid one to beholdBeaker is a splendid one to behold
Re: pic: Team 624 2015 Offseason Tesbed

Quote:
Originally Posted by RyanCahoon View Post
I assume everything is feed-forward. I'm interested if you would describe (a graph would be great) the control signal that you output in order to achieve a trapezoidal velocity profile
The only "graphing utility" I have access to at the moment is MS Paint, so I will post graphs for clarity later. Below is a technical description of our program that hopefully answers your question.

Given a distance, the robot generates a piecewise function. Since we know a maximum acceleration, we can create a triangular graph to determine max reachable velocity. The area of this triangle (integral of the velocity) must be the distance, and since we know the acceleration (slope of hypotenuse) we can find the max reachable velocity and the total time required for the profile.

After finding these two things, there are two possible cases. Either a) The max reachable velocity is less than the max allowed velocity or b) the max reachable velocity is more than the max allowed velocity, where the max allowed velocity is the maximum speed of the robot.

If case A is true, then motion profiling is simple. We make a piecewise function with 2 pieces, accel and decel. Each piece is v=at.

If case B is true, its a bit more complex. We now have to determine the time spent cruising. This can be achieved through geometry; All that needs to be done is find the base of the trapezoid that represents cruising velocity, and since you already know max velocity (height) and base 1 (total time), the math is not that hard. After these calculations, we have 3 times for 3 pieces of the function, 2 of these are v=at, then the cruise phase (the second piece) is v=cruise_vel.

Finally, our program outputs velocity and acceleration. However, motor controllers take in powers. What has to be done now is that we need to scale the outputs to create a power. Since we use the Talon SRX, we can assume that the scale is linear. The conversion to power goes as follows:

Motor Power = (Kv*velocity) + (Ka*acceleration)

We coerce this value between -1 and 1, just in case. All that is left to be done is to output this power to the motor controller.

I encourage you to read through the 254 presentation if I missed something. There are some graphs there and in the other (non Youtube) link that might clarify some things I have said.

Quote:
Originally Posted by RyanCahoon View Post
Are you doing anything to compensate for battery charge level? Have you tried running your controller with batteries at different levels of discharge?
Not yet, which is why integration with feedback is still important. If the battery level is low, feed-forward will not behave quite as expected, but the feedback system should be able to compensate.
__________________
Team 624 (Student) 2013-2016
BBQ FIRST Creator
Reply With Quote