|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#5
|
||||
|
||||
|
Re: Motion Profiling
Quote:
We started with the same profiling setup that you use, but we found that the wheels on the robot would slip during faster acceleration, so we switched to a jerk limited control - using trapezoids for acceleration instead of velocity. It just adds another degree of smoothness which helped for fast moves. We are using something that was described to me by a member of team 254 at St. Louis last year. We start by coming up with a big table of position, velocity, and acceleration for each .05 seconds that meet the desired position, max velocity, max acceleration, and max jerk goals. We have a thread that runs every .05 seconds and reads the next position, acceleration, and velocity values from the list. It takes the roboRIO about 100ms to generate all possible profiles that we would want to run and store them in memory. The output for our motors is Code:
output = k_a * acc + k_v * vel + k_p * (desired-actual) Our method to calculate the motion profile isn't super efficient, super fast, and uses lots of memory, but it was written in a really short amount of time. We start by generating the acceleration ramp up part until we reach maximum acceleration. Next, we continue at maximum acceleration until we reach half of our maximum velocity. At that point, we mirror the acceleration curve so that the acceleration ramps down as we reach our maximum speed. The last step is to continue at maximum velocity until we reach half our distance setpoint, and then we mirror everything. You can check out the code for making profiles here https://github.com/dicarlo236/2015-R...Generator.java Our follower is here https://github.com/dicarlo236/2015-R...eFollower.java You can see it running in this video https://www.youtube.com/watch?v=sGQk0-u0HMI |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|