2nd draft
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed Servo
Fork of robot_mockup by
Diff: main.cpp
- Revision:
- 42:b9d26b1218b0
- Parent:
- 41:55face19e06b
- Child:
- 44:145827f5b091
--- a/main.cpp Fri Oct 23 09:14:22 2015 +0000 +++ b/main.cpp Fri Oct 23 09:33:28 2015 +0000 @@ -268,8 +268,8 @@ red=1; green=1; blue=1; //Make sure debug LEDs are off //Set PwmOut frequency to 10k Hz - //pwm_motor1.period(0.0001); - //pwm_motor2.period(0.0001); + pwm_motor1.period(0.001); + pwm_motor2.period(0.001); clearTerminal(); //Clear the putty window @@ -533,6 +533,7 @@ //Mechanical limit 43 degrees -> 43*(4200/360) = 350 theta2_cal = floor(theta2_lower * (4200/(2*PI))); Encoder2.setPulses(theta2_cal); //edited QEI library: added setPulses() + } //Send arm to mechanical limits, and set encoder to 0. Then send arm to starting position. @@ -574,6 +575,10 @@ //pc.printf("Elbow Limit hit - shutting down motor 2. Current pulsecount: %i \r\n",Encoder1.getPulses()); + //set reference position to mechanical limits + x = 0.2220; + y = 0.4088; + wait(1); pc.printf("\n\r ------------------------ \n\r"); pc.printf("Arm Calibration Complete\r\n");