Expansion SW library to control high power stepper motor(s) using IHM03A1 expansion board(s) with Powerstep01 driver.

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   IHM03A1_ExampleFor1Motor HelloWorld_IHM03A1 IHM03A1_ExampleFor3Motors KYPHOS_Stepper_Motor_Control

Fork of X_NUCLEO_IHM03A1 by ST Expansion SW Team

Motor Control Library

Library to handle the X-NUCLEO-IHM03A1 Motor Control Expansion Board based on the Powerstep01 component.

It features the:

  • read and write of Powerstep01 registers
  • Nucleo and expansion board configuration (GPIOs, PWMs, IRQs, etc.)
  • Powerstep01 application commands handling
  • FLAG and BUSY interrupt handling (alarm reporting)
  • Daisy chain handling

The API allows to easily:

  • perform various positioning, moves and stops
  • get/set or monitor the motor positions
  • set home position and mark another position
  • get/set minimum and maximum speed
  • get current speed
  • get/set acceleration and deceleration
  • get/set the step mode (up to 1/128)
  • get/set the control method
  • get/set parameters for voltage mode driving
  • get/set parameters for current mode driving
  • get/set parameters for gate driving
  • configure various protections such as overcurrent detection
  • enable/disable alarms
  • handle step-clock
  • get system status

Daisy-Chain Configuration

The IHM03A1 board can be stacked up to three times so that the Powerstep01 components will be connected in daisy-chain configuration. For this purpose, some resistors must be correctly connected on the boards as depicted here below:

/media/uploads/nucleosam/driving1steppermotor.png /media/uploads/nucleosam/driving2steppermotors.png /media/uploads/nucleosam/driving3steppermotors.png

Platform compatibility

Compatible platforms have been tested with the default configuration provided by the HelloWorld_IHM03A1 example.

Revision:
1:8ce2a5d6fbf8
Parent:
0:00a3c3f5a8f0
Child:
4:f48e8d87553e
--- a/Components/powerstep01/powerstep01.h	Tue Apr 05 15:18:56 2016 +0000
+++ b/Components/powerstep01/powerstep01.h	Thu Apr 07 16:11:47 2016 +0000
@@ -62,8 +62,16 @@
 /** @defgroup Powerstep01_Exported_Defines Powerstep01_Exported_Defines
  * @{
  */
+/// Current FW major version
+#define POWERSTEP01_FW_MAJOR_VERSION (uint8_t)(1)
+/// Current FW minor version
+#define POWERSTEP01_FW_MINOR_VERSION (uint8_t)(2)
+/// Current FW patch version
+#define POWERSTEP01_FW_PATCH_VERSION (uint8_t)(0)
 /// Current FW version
-#define POWERSTEP01_FW_VERSION (2)
+#define POWERSTEP01_FW_VERSION (uint32_t)((POWERSTEP01_FW_MAJOR_VERSION<<16)|\
+                                          (POWERSTEP01_FW_MINOR_VERSION<<8)|\
+                                          (POWERSTEP01_FW_PATCH_VERSION))
 
 /// Powerstep01 max number of bytes of command & arguments to set a parameter
 #define POWERSTEP01_CMD_ARG_MAX_NB_BYTES              (4)
@@ -116,7 +124,7 @@
 #define POWERSTEP01_MIN_POSITION (int32_t)(0xFFE00000)
     
 /// powerSTEP01 error base number
-#define POWERSTEP01_ERROR_BASE              (0x7000)
+#define POWERSTEP01_ERROR_BASE              (0xB000)
 
 /// powerSTEP01 acceleration and deceleration max value
 #define POWERSTEP01_ACC_DEC_MAX_VALUE       (float)(59590)