Ways to tune top speed or acceleration #251
-
Hey there, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
The time the path planner GUI shows, is the robot travel time of the path/s based on the max vel and max acc set in the GUI. When building trajectories, these speeds can be pulled from the GUI values (from the path files) or hard coded in the constructor, depending on the how you have written your code. So the execution time and GUI time could be different if you are using hard coded values that are different to the GUI values. When a path is being followed, it is sampled using a timer so there is no real way that the it could "run slow". Also, do you have your robot stopping and waiting for commands to end at stop points. Because the total time in the path planner GUI doesn't account for this. |
Beta Was this translation helpful? Give feedback.
-
Simple, increase the acceleration value. Your max speed can be as high as you like, but if the acceleration is too low it will never reach this max speed. What is your drive base? Believe it or not, but we found accuracy improved the faster we went when using a swerve drive base. NB: You need your drivebase to be setup properly (ie when you tell it to go 1m/s it actually does 1meter per sec). For us we ran velocity control mode on the Falcons Motors directly and scaled our encoder counts per 100ms using the gear ratios and wheel diameter. I suggest changing your code to read the values from the GUI and then you can use the graph option (far right icon on the bottom of the Pathplanner GUI) to see what everything is supposed to be doing. Also this lets you tweak the speeds without having to do a recompile every time you make a change to the speeds. All you have to do is a "deploy code" and provided the code hasn't changed this will only take a couple of seconds to copy across the the .path files. You can even use a third party ftp program to move the paths across. Meaning you can free up one of your "programming" laptops. NB: The paths will have to be copied across to the "programming laptop" eventually as any paths that have manually been copied across will be overwritten the next time the code is pushed from the programming laptop. Good Luck. Word of warning, if you are using the speed and acceleration values from the GUI, MAKE SURE you set them to values you want every time you make a new path. |
Beta Was this translation helpful? Give feedback.
-
Lets go back a few steps. The points are generated by the trajectory generator when you load a path, they contain an x, y , theta, time stamp, velocity, amongst some other things. Check out the trajectory point struct to see the finer details. These points are created using the max velocity and max acceleration values that are passed to the trajectory generator. So this is the weird part about your trajectories taking longer to execute than what the GUI is saying they should take. The time taken to follow the trajectory is locked in once the trajectory point are generated. |
Beta Was this translation helpful? Give feedback.
Simple, increase the acceleration value. Your max speed can be as high as you like, but if the acceleration is too low it will never reach this max speed.
Simple way to think of this is, if the max Vel is 3m/s and the max Acc is 1.5m/s^2 its going to take 2 seconds for the robot to reach its max speed.
What is your drive base?
If you are using SDS 4i Swerve Modules with L2 gearing with Falcons (This seems to be the most common these days for the teams that are using PathPlanner) You should be able to get up to 5m per second top speed. I've run 3m/s^2 values for acceleration in the past and not had wheel slip.
Believe it or not,…