Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: TPixy-Interface
Fork of PlayBack by
Revision 25:f2a1bd6591fb, committed 2018-04-03
- Comitter:
- asobhy
- Date:
- Tue Apr 03 16:39:12 2018 +0000
- Parent:
- 24:e88753f090b8
- Child:
- 26:e93890381e66
- Commit message:
- object follower working but with negative signs for dps
Changed in this revision
| PiControlThread.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PiControlThread.cpp Tue Apr 03 16:00:10 2018 +0000
+++ b/PiControlThread.cpp Tue Apr 03 16:39:12 2018 +0000
@@ -40,10 +40,10 @@
void PeriodicInterruptISR(void);
// steering gain
-float Ks = 0.15;
+float Ks = 0.1;
// distance gain
-float Kd = 10;
+float Kd = 5;
// overall robot required speed
int Setpoint;
@@ -139,8 +139,8 @@
}
// Decoupled drive
- setpointR = Setpoint + (Ks*SteeringError);
- setpointL = Setpoint - (Ks*SteeringError);
+ setpointL = Setpoint + (Ks*SteeringError);
+ setpointR = Setpoint - (Ks*SteeringError);
cameraData_mutex.unlock();
// Make sure our limit is not exceeded
@@ -149,8 +149,8 @@
/*********************Differential End*********************************/
- U_right = PiControllerR(setpointR,sensors.dp_right);
- U_left = PiControllerL(setpointL,sensors.dp_left);
+ U_right = PiControllerR(setpointR,-sensors.dp_right);
+ U_left = PiControllerL(setpointL,-sensors.dp_left);
// Set speed and direction for right motor
if (U_right >= 0)
