STMicroelectronics AN2044 Stepper Motor Motion Control Application Note

This document describes the common requirement of executing a relative move in operating a stepper motor system. The move is usually specified as a fixed number of basic motor steps in the clockwise or counter-clockwise direction. It is common practice to execute this move along a trapezoidal shaped velocity vs. time profile. This profile is determined by the number of steps to be moved and the required accel, decel, and peak speed. Very often system designers require that a move be made in the shortest time possible and in these cases the accel, decel and peak speed are set to the maximum that the system can achieve. Given the move distance, accel, decel, and peak speed requirement, a profile can be determined. Since the control structure of the practispin software is designed such that the velocity and accel/decel rate can be changed at will, the task of pre-calculating the velocity profile boils down to determining the position values where operation switches from accel to constant speed and then from constant speed to decel. Since this is a relative move, we can assume that motion starts at position = 0, time = 0, and velocity = 0.


STMicroelectronics AN2044 Stepper Motor Motion Control Application Note - cover page
Brand
STMicroelectronics
Document type
Application Note
Language
English
Pages
9
File format
PDF
File size
52 KB
Published
06 August, 2012
Updated
28 September, 2023
MD5 checksum
057AD4011B22865D1B934E585FE14E2C

About this manual

The document details the requirements for executing relative moves in a stepper motor system using a trapezoidal or triangular velocity vs. time profile. It provides specific mathematical formulas to calculate position values where the system switches between acceleration, constant speed, and deceleration phases based on total move distance and rate constraints.

Furthermore, it describes the Practispin control scheme which relies on a 20 kHz interrupt service routine (ISR) running every 50 microseconds. The note outlines motion simulation formulas used within this ISR to update velocity and position variables in real-time using multiple precision integers with a fixed binary point representation.

What's inside

  • Trapezoidal Position Formulas
  • Triangular Position Formulas
  • Practispin Stepper Motor Control Scheme
  • Motion Simulation Formulas
  • State Variable Representation
  • Half Step Commutating Sequence

Frequently asked questions

What is the fixed time interval for the control interrupt?

The system uses a 20 kHz interrupt that invokes an Interrupt Service Routine on a fixed time interval of 50 microseconds.

What is the maximum motor speed in steps per second?

The maximum value for velocity (SPD) is equal to 20,000 steps per second.

How many rotations can the motor position variable represent?

The maximum position value represents 327.68 rotations for a motor with 200 steps per rotation.

Download PDF (52 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →