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: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 38:3ff3cdb8740d
- Parent:
- 37:6602655a80f4
diff -r 6602655a80f4 -r 3ff3cdb8740d main.cpp --- a/main.cpp Thu Oct 10 15:33:24 2019 +0000 +++ b/main.cpp Thu Oct 10 15:42:26 2019 +0000 @@ -158,7 +158,37 @@ void Run_CalibrationPhysical(void) { pc.printf("Starting Calibration Physical ... \r\n"); - wait(1); + //Motor 1 + if (::motorData.motor1.input.PWM == 0) //To prevent setting every Ticker + { + ::motorData.motor1.input.PWM = .1; //set low PWM on motor + } + if (::motorData.motor1.output.velocity <= .1) + { + ::motorData.motor1.input.calibrationCounts = ::motorData.motor1.output.counts; //set the counts of calibration as input for motor + ::motorData.motor1.input.PWM = 0; //set PWM back to zero + } + //Motor 2 + if (::motorData.motor2.input.PWM == 0) + { + ::motorData.motor2.input.PWM = .1; + } + if (::motorData.motor2.output.velocity <= .1) + { + ::motorData.motor2.input.calibrationCounts = ::motorData.motor2.output.counts; + ::motorData.motor2.input.PWM = 0; + } + //Motor 3 + if (::motorData.motor3.input.PWM == 0) + { + ::motorData.motor3.input.PWM = .1; + } + if (::motorData.motor3.output.velocity <= .1) + { + ::motorData.motor3.input.calibrationCounts = ::motorData.motor3.output.counts; + ::motorData.motor3.input.PWM = 0; + } + CurrentState = CalibrationIdle; }