Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 5 months ago.
Two instances of PID controller causing problem
I'm trying to use the PID Controller library (http://mbed.org/cookbook/PID) to make a two wheeled buggy with mismatched go in a straight line using PWM. The code at the moment (not all shown) should create two instances of PID - one for the left and one for the right wheel. I can create one and it works ok, but if I add both it will stop the SevenSegmentDisplay module from working properly (it flashes once on pressing the reset button, then turns off). I don't get the red flashing error LEDs. Can anyone help?
Using an mbed lpc11u24
#include "mbed.h" #include "SevenSegmentDisplay.h" #include "PinDetect.h" #include "PID.h" #define KcL 0.9315 #define KcR 0.6337 #define TiL 0 #define TiR 0 #define Td 0.0 #define RATE 0.01 /*Define pins for motors, brakes and sensor input*/ PID LeftControl(KcL, TiL, Td, RATE); PID RightControl(KcR, TiR, Td, RATE); SevenSegmentDisplay Display(INSTANT);