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
--- a/Components/Common/motor.h	Tue Apr 05 15:18:56 2016 +0000
+++ b/Components/Common/motor.h	Thu Apr 07 16:11:47 2016 +0000
@@ -2,8 +2,8 @@
   ******************************************************************************
   * @file    motor.h
   * @author  IPC Rennes
-  * @version V1.5.0
-  * @date    January 25, 2016
+  * @version V1.6.0
+  * @date    April 7th, 2016
   * @brief   This file contains all the functions prototypes for motor drivers.   
   ******************************************************************************
   * @attention
@@ -269,7 +269,7 @@
   /// Function pointer to GetDeviceState
   motorState_t(*GetDeviceState)(void *handle); 
   /// Function pointer to GetFwVersion
-  uint8_t (*GetFwVersion)(void *handle); 
+  uint32_t (*GetFwVersion)(void *handle); 
   /// Function pointer to GetMark
   int32_t (*GetMark)(void *handle); 
   /// Function pointer to GetMaxSpeed
@@ -329,7 +329,7 @@
   /// Function pointer to Reset
   void (*Reset)(void *handle); 
   /// Function pointer to SelectStepMode
-  void (*SelectStepMode)(void *handle, motorStepMode_t);
+  bool (*SelectStepMode)(void *handle, motorStepMode_t);
   /// Function pointer to SetDirection
   void (*SetDirection)(void *handle, motorDir_t direction);
   /// Function pointer to CmdGoToDir