ManualControl
Dependencies: TPixy-Interface
Fork of MbedOS_Robot by
Diff: PiControlThread.cpp
- Revision:
- 27:510b4af89a6b
- Parent:
- 25:f2a1bd6591fb
--- a/PiControlThread.cpp Tue Apr 03 16:52:38 2018 +0000 +++ b/PiControlThread.cpp Tue Apr 03 17:11:59 2018 +0000 @@ -40,10 +40,10 @@ void PeriodicInterruptISR(void); // steering gain -float Ks = 0.1; +float Ks = 0.12; // distance gain -float Kd = 5; +float Kd = 3; // overall robot required speed int Setpoint; @@ -148,7 +148,12 @@ setpointL = SaturateValue(setpointL, 112); /*********************Differential End*********************************/ - + + /* the signs for dP are switched here in code instead of switching the + * channels wires connected to the FPGA due to reversing the orientation + * of the Robot + */ + U_right = PiControllerR(setpointR,-sensors.dp_right); U_left = PiControllerL(setpointL,-sensors.dp_left);