Acceleration deacceleration on straight(), Wheel delay, and adjusting built in PID values #2078
-
Hi all! I have encountered a strange problem. I've made a custom PID loop using robot.drive() with my custom acceleration deacceleration, but when I use it I see that one wheel always starts a noticable while after the other, which I think is hindering the performance of it. However when using robot.straight() it doesn't happen so i've a few questions:
PID using robot.drive()
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The drive base functions all use their own PID controller, so this code builds another on top of that. Two nested or conflicting controllers probably don't give you the desired result. If you'd like to build your own controllers, it is better to power the motors with Alternatively, you can change the P/I/D for the existing controllers to achieve a similar effect. Then something to think about 💡
Numerical derivatives like these can be quite inaccurate. What is the mathematical expression for the time derivative of |
Beta Was this translation helpful? Give feedback.
The drive base functions all use their own PID controller, so this code builds another on top of that. Two nested or conflicting controllers probably don't give you the desired result. If you'd like to build your own controllers, it is better to power the motors with
motor.dc(value)
so only your own controller if active.Alternatively, you can change the P/I/D for the existing controllers to achieve a similar effect.
Then something to think about 💡
Numerical derivatives like these can be quite inaccurate. What is the mathematical expression for the time derivative of
error
in your case? Can you compute it exactl…