verlab / hero_common

This project contributes to an open source ROS-based framework for swarm robotics. We propose an low cost, high availability swarm system that could be printed and assembled multiple times without special knowledge or hardware skills.
https://verlab.github.io/hero_common/
64 stars 16 forks source link

PID Controller Issue #34

Open Khaled3ly opened 7 months ago

Khaled3ly commented 7 months ago

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
varunraveendra commented 5 months ago

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