Hi, I want to write a code that use PID to control two wheels.
like this PIC Lesson: PID – Blog Kejuruteraan Dan Teknologi
Things get complicate when two PID controls involved,I want to control my car's wheels to move with same distance every one rotation and keep roating .How dose people combine two or more pid controls in a function simultaneously?
I'm not a PID control expert, but I think you're chasing the wrong dream.
PID on a single driven actuator (wheel) seems ok, but to apply PID algorithms said mulraneously to two wheels independently will require sophisticated ground feedback to keep the vehicle on course.
What are you trying to achieve with the PID capability?
It sounds like you're may want route planning, and a way to deliver that to the motors 'smoothly' in order to realise the best curve fitting through whatever waypoints are defined.
If it's really as simple as making sure each wheel turns the same amount... why two motors... or if you mean both wheels travel the same distance, then you're the n another game altogether - using feedback from the surface to determine distance (actually) travelled.