VEXCode motion profiling

Hello,
I have been hearing about PROS and coding motion profiling in PROS, but I want to know exactly how to do motion profiling in VEXCode. I understand PID but I have no experience as to what motion profiling is and how it operates. I tried to figure out how to code motion profiling on my own, since I cannot find any resource, yet I seem to fail at times. If anyone has an explanation of how to code motion profiling (heck examples would be great) that would be very useful.
Thank you

2 Likes

I’m a PROS user and I use motion profiling ( I think so but I’m not an expert). It’s when you change the velocities of the motors based on its position. I use a trapezoidal auto drive function in which it accelerates, maintains continuous velocity, and then decelerates. The graph of position and velocity should look like this:

Here’s a graph that shows position, velocity and acceleration:

https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&ved=2ahUKEwjLncWLsNvmAhUET98KHZdaCDwQjRx6BAgBEAQ&url=https%3A%2F%2Facme-robotics.gitbook.io%2Froad-runner%2Ftour%2Fmotion-profiling&psig=AOvVaw3PREnJFZ5Gcx6s5vIBqhft&ust=1577726694435771

2 Likes

Thank you so much! This does make sense and I appreciate the documentation.

1 Like

Im still a bit confused upon how to code it. Would I require an equation to fill in?

You could check out how Pros/OKapi implement it

https://github.com/purduesigbots/pros-docs/blob/master/v5/okapi/api/control/async/async-linear-motion-profile-controller.rst

https://pros.cs.purdue.edu/v5/okapi/tutorials/concepts/2dmotionprofiling.html

5 Likes