Hello all,
I am a newbie. Please help me! I have a problem when i use lib PID to control 2 DC motors. Code is ok. I send position + "X" to motorA and position + "Y" to motor B. But motor just receive PWM >0 in one time. And the others have pwm=0, I dont know how code can do that.
Please help me! Thanks in advance!
sorry, because i am a newbie. But my code, build is ok. I printed this char and this char was exactly position. And when inputString.toCharArray(buf, 4) and char buf just have 3 characters.
I dont use serial monitor, I use webcam and c++ to send position for arduino.
Thanks you, because reply
No, it isn't. You may not have experienced an issue yet, but your code is wrong. You can not write 5 elements into a 4 element array.
I dont use serial monitor, I use webcam and c++ to send position for arduino.
So, Input is a position. The position of what? Setpoint is never given a value, so the PID algorithm is computing Output to make Input converge on 0. Is that what you expect?