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: BCEmotor Battery_Linear_Actuator_ Controller_ IMU_code_ LTC1298_7_14 MODSERIAL PosVelFilter_7_14 System_ mbed
Fork of 7_14_17_FSG_working by
Diff: main.cpp
- Revision:
- 7:10d7fbac30ea
- Parent:
- 6:ce2cf7f4d7d5
diff -r ce2cf7f4d7d5 -r 10d7fbac30ea main.cpp
--- a/main.cpp Fri Jul 21 13:32:10 2017 +0000
+++ b/main.cpp Fri Jul 21 15:25:11 2017 +0000
@@ -123,13 +123,13 @@
float positionCmd_temp;
//set the intial gains for the position controller
- posCon().setPgain(P);
+ /*posCon().setPgain(P);
posCon().setIgain(I);
posCon().setDgain(D);
posCon().writeSetPoint(positionCmd);
hBridge().reset();
hBridge().run(motor_cmd);
-
+ */
/* *************************** LED *************************** */
led1 = 1; //initial values
led2 = 1;
@@ -408,7 +408,7 @@
}
}
else if (Key == 'l' or Key == 'L')
- PC.printf("DEBUG: String position? %f velocity? %f (BCE active: %d)\n", pvf().getPosition(), pvf().getVelocity(),posCon().getOutput()); //DEBUG TROY
+ PC.printf("DEBUG: String position? %f velocity? %f (BCE active: %f)\n", pvf().getPosition(), pvf().getVelocity(),posCon().getOutput()); //DEBUG TROY
//Linear Actuator Controls
else if(Key == 'c' or Key == 'C')
@@ -640,6 +640,7 @@
pc().printf("Bad pot issue\n");
//hBridge().stop();
count = 0;
+
}
}
@@ -647,6 +648,11 @@
{
pc().printf("Hit the limit switch??\n");
hBridge().stop();
+ wait(1);
+ hBridge().reset();
+ positionCmd= 375;
+ posCon().writeSetPoint(positionCmd);
+ hBridge().run(posCon().getOutput());
}
//string snaps
