Hi @Antun_Skuric,
first of all thank you for you great library.
Now, I try to explain what I mean with Motion Planner.
With Trapezoidal I mean the velocity profile. From Google:
How you can see, with this motion profile we can limit the acceleration and so we can avoid discontinuity (so high current peaks). For high level application, you can find the S-curve profile and so you can limit even the Jerk.
Ok, I’ll stop
Without a motion planner, you say to the motor: from
0.0 rad, try to reach 6.28 rad. If you have a load with high inertia, you can’t control the trajectory and so you can have a lot of overshoot during the positioning. One solution can be trying to increase gains, but you can make system unstable.What I do with the motion planner is: set max speed, acceleration and deceleration of the movement. By dividing the “trip” in a lot of steps, the setpoint position is not
6.28 rad, but setpoint is each step in order to reach your final destination by making the motor follow a particular trajectory. In this way to have 2 advantages:
- You can increase gains and so you can improve the system response;
- The smoother the profile, the more dynamically better the system is (with a trapezoidal trajectory, you are avoiding acceleration discontinuity).
I hope I’ve been sufficiently clear. In the next few days (work permitting) I will try to post what I have implemented for the trapezoidal planner.
With the ESP32 the result is excellent because it is a really powerful microcontroller.
DG
