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: biquadFilter MODSERIAL QEI Servo mbed
Fork of Robot_Battle_met_ARVID by
Revision 17:45b31bf0c11e, committed 2018-11-02
- Comitter:
- gastongab
- Date:
- Fri Nov 02 13:46:29 2018 +0000
- Parent:
- 16:438b330f5312
- Child:
- 18:23e7507b88aa
- Commit message:
- zekers te weten te vinden ok, deze is voor de robot battle;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Nov 01 22:00:34 2018 +0000
+++ b/main.cpp Fri Nov 02 13:46:29 2018 +0000
@@ -130,7 +130,7 @@
int EMGymin ;
// Dit moet experimenteel geperfectioneerd worden
-float tijdstap = 0.001; //nu wss heel langzaam, kan miss omhoog KEER V GEEFT VERANDERING IN POSITIE
+float tijdstap = 0.005; //nu wss heel langzaam, kan miss omhoog KEER V GEEFT VERANDERING IN POSITIE
float v = 0.1; // snelheid kan wss ook hoger
float px = 0.2; //starting x // BOUNDARIES
@@ -142,10 +142,10 @@
float da3 = 3.372859;
// limits (since no forward kinematics)
-float upperxlim = 0.275; //36, 0.04, 0.315, -0.085niet helemaal naar requierments ff kijken of ie groter kan
-float lowerxlim = 0.10;
+float upperxlim = 0.25; //36, 0.04, 0.315, -0.085niet helemaal naar requierments ff kijken of ie groter kan
+float lowerxlim = 0.15;
float upperylim = 0.225;
-float lowerylim = 0.03; //0.03 is goed
+float lowerylim = 0.05; //0.03 is goed
// VARIABLES PID CONTROLLER
double PI = M_PI;// CHANGE THIS INTO M_PI
@@ -619,7 +619,13 @@
led2 = 1;
led3 = 1;
wait (1);
-
+ if(t>0 && t<=4) {
+ px = 0.2;
+ py = 0.155;
+ } else {
+ t.stop();
+ }
+ ///////////////////////////
stateChanged = false;
}
@@ -672,14 +678,14 @@
led1 = 1;
led2 = 0;
led3 = 0;
- wait(0.5);
+ wait(1);
movement_ticker_activator();
led1 = 0;
led2 = 0;
led3 = 0;
- wait(0.5);
+ wait(1);
stateChanged = false;
@@ -807,7 +813,7 @@
led3 = 1;
pwmpin1.period_us(60); // setup motor
- ref_rot.attach(Motor_mover, 0.01f);// HAS TO GO TO STATE MACHINE
+ ref_rot.attach(Motor_mover, 0.005f);// HAS TO GO TO STATE MACHINE
//movement_ticker_activator();
//emg_sample_ticker();
while (true) {
