verlab/hero_common

PID Controller Issue

Khaled3ly opened this issue · 1 comments

Hello @rezeck,

I can't understand how does the PID controller work as the input signal is velocity (cm/s) and encoder reading is also velocity (cm/s) while the output is PWM.... is there a transfer function that takes output (cm/s) and transfers it to PWM ?

Thanks in advance.

Screenshot 2024-04-21 at 2 14 21 AM

Hi @Khaled3ly ,
I have been working on Hero robots for a while now. Talking about the PID controller, I believe that it takes in the desired and the current velocity and outputs adjusted velocity. This is then summed with the MotorDeadZone value. If you are looking at raw values of the adjusted velocity, then you might notice that it can go up to +250 or -250. The code below under VelocityControl.ino might give you a better explanation:
Screenshot 2024-06-29 at 7 08 11 PM

I hope this helps.

-Varun Raveendra