Unipolar stepper motor operation library
Dependents: LAB04_Oppgave1 test_stepper Stepper_Motor_Demo StepperMotorUni_Hello ... more
Unipolar stepper motor library
This library generates pulses on 4 digital output pins of the mbed. The pulses are generated by mbed's ticker function.
The mbed pins cannot drive the stepper motor directly. So it requires driver stage for the motor. The circuit may be like following diagram.
The driver stage should be chosen by requirement for the stepper motor.

The mbed generates pulses on 4 output pins for external driver stage.
This library can generate 3 types of pulses.
1 phase drive (wave drive)

2 phase drive

1-2 phase (half step) drive

Components pages
Components pages are available for bipolar and unipolar motor libraries
Revision 6:007d0570ba4f, committed 2017-09-13
- Comitter:
- okano
- Date:
- Wed Sep 13 03:55:30 2017 +0000
- Parent:
- 5:93f9ce526f38
- Child:
- 7:7e6fb609780a
- Commit message:
- fix for keeping stop position
Changed in this revision
| StepperMotorUni.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/StepperMotorUni.cpp Mon Apr 27 01:16:51 2015 +0000
+++ b/StepperMotorUni.cpp Wed Sep 13 03:55:30 2017 +0000
@@ -288,7 +288,9 @@
distance = (distance < 0)? -distance : distance;
if ( !distance ) {
- motor_out = power_ctrl ? 0 : 1;
+ if ( power_ctrl )
+ motor_out = 0;
+
moved_steps = 0;
return;
}