Simple test application for the STMicroelectronics X-NUCLEO-IHM01A1 Stepper Motor Control Expansion Board, built against mbed OS.
Dependencies: X_NUCLEO_IHM01A1
Fork of HelloWorld_IHM01A1 by
This application provides a simple example of usage of the X-NUCLEO-IHM01A1 Stepper Motor Control Expansion Board. It shows how to use one stepper motor connected to the board, moving the rotor to a specific position, with a given speed value, direction of rotation, etc.
Revision 29:a80a213c3c94, committed 2016-09-08
- Comitter:
- Davidroid
- Date:
- Thu Sep 08 12:39:58 2016 +0000
- Parent:
- 28:e15fc9311ca3
- Child:
- 30:afc9781f989f
- Commit message:
- Comment about pps added.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HelloWorld_IHM01A1.lib Thu Sep 08 12:39:58 2016 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/ST/code/HelloWorld_IHM01A1/#e15fc9311ca3
--- a/X_NUCLEO_IHM01A1.lib Wed Aug 03 10:11:21 2016 +0000 +++ b/X_NUCLEO_IHM01A1.lib Thu Sep 08 12:39:58 2016 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/teams/ST/code/X_NUCLEO_IHM01A1/#fd83fecf1ef5 +http://developer.mbed.org/teams/ST/code/X_NUCLEO_IHM01A1/#990963ed581b
--- a/main.cpp Wed Aug 03 10:11:21 2016 +0000
+++ b/main.cpp Thu Sep 08 12:39:58 2016 +0000
@@ -60,7 +60,9 @@
#define DELAY_3 6000
#define DELAY_4 8000
-/* Speed in step/s. */
+/* Speed in pps (Pulses Per Second).
+ In Full Step mode: 1 pps = 1 step/s).
+ In 1/N Step Mode: N pps = 1 step/s). */
#define SPEED_1 2400
#define SPEED_2 1200
@@ -70,10 +72,10 @@
/* Initialization parameters. */
L6474_Init_t init =
{
- 160, /* Acceleration rate in step/s2. Range: (0..+inf). */
- 160, /* Deceleration rate in step/s2. Range: (0..+inf). */
- 1600, /* Maximum speed in step/s. Range: (30..10000]. */
- 800, /* Minimum speed in step/s. Range: [30..10000). */
+ 160, /* Acceleration rate in pps^2. Range: (0..+inf). */
+ 160, /* Deceleration rate in pps^2. Range: (0..+inf). */
+ 1600, /* Maximum speed in pps. Range: (30..10000]. */
+ 800, /* Minimum speed in pps. Range: [30..10000). */
250, /* Torque regulation current in mA. Range: 31.25mA to 4000mA. */
L6474_OCD_TH_750mA, /* Overcurrent threshold (OCD_TH register). */
L6474_CONFIG_OC_SD_ENABLE, /* Overcurrent shutwdown (OC_SD field of CONFIG register). */
