Controlling a Stepper Motor with STM32
Driving a 42-series stepper motor with an A4988 chip, tested on the STM32F1 platform, with up to 16× microstepping.
11 posts
Driving a 42-series stepper motor with an A4988 chip, tested on the STM32F1 platform, with up to 16× microstepping.
I was using an STM32F103C8T6 minimum system board. After debugging the STM32 program on Windows and successfully establishing serial communication, the serial connection stopped responding after I restarted the computer.
This tutorial explains how to download and install the Keil5 51 edition. Keil5 is a very user-friendly and powerful C language software development system. Keil5 provides a clear and intuitive interface, is very easy and convenient to use, and includes compiler, compiler, installer package, and debugging and tracing features.
This tutorial explains how to download and install the MDK edition of Keil5. Keil5 is a very user-friendly and powerful C software development system. Keil5 provides a clear, intuitive interface, is very easy and convenient to use, and includes a compiler, compiler, installation package, and debugging and tracing features.
The state machine is the most commonly used design model in engineering applications. With a state machine, we can easily implement decisions and branches in a program flowchart. A LabVIEW state machine consists of a While Loop, a Case Structure, and a shift register.
The components used include a simulated power supply, a transformer, a bridge rectifier, a non-polarized capacitor, an electrolytic capacitor, and a three-terminal voltage regulator IC. The wiring method is shown in the figure.
When designing MCU circuits, the number of MCU I/O pins is limited and sometimes cannot meet our design requirements. To control more devices, we need peripheral digital chips for pin expansion. A common choice is the 74HC138, also called a three-to-eight (38) decoder.
The CD4066 is a quad bilateral analog switch. Connect the four inputs of the CD4066 to the L298N outputs and the CD4066 outputs to the stepper motor's A+, A-, B+, and B- terminals. Tie all four control pins to one MCU pin so a single pin can switch all four switches on the CD4066 together, enabling stepper motor selection.
Solution: Choose Design—Configure Power Rails. Under Power Supplies, add the power supply that is not connected to a net to the list of connected nets.
A microcontroller cannot drive a stepper motor directly, so an L298N is needed as the driver. This article introduces some L298N parameters, along with the drive principles and methods for a two-phase four-wire stepper motor. A simulation experiment is also performed in Proteus based on the drive principles described.
This experiment uses an ESP8266 NodeMCU. The firmware flashed is the official NodeMCU firmware. Open the official ESP8266Flasher, select the NodeMCU firmware in the Config tab, and set the flash address to 0x00000.