Haha, quite a harvest!!!
A stepper motor is an actuator that converts electrical pulses into angular displacement. In simple terms: when the stepper driver receives a pulse signal, it drives the stepper motor to rotate a fixed angle (i.e., step angle) in the set direction. We can control the angular displacement by controlling the number of pulses to achieve accurate positioning; at the same time, we can control the speed and acceleration of the motor by controlling the pulse frequency to achieve speed regulation.
The 28BYJ48 stepper motor is a four-phase eight-beat motor with a voltage of DC5V~DC12V. When a series of continuous control pulses are applied to the stepper motor in a certain order, it can rotate continuously. Each pulse signal changes the power-on state of one or two phases of the stepper motor winding once, which corresponds to the rotor rotating a certain angle. When the change of the power-on state completes a cycle, the rotor rotates one tooth pitch. The four-phase stepper motor can operate in different power-on modes. Common power-on modes include single (single-phase winding power-on) four-beat (ABCDA...), double (two-phase winding power-on) four-beat (AB-BC-CD-DA-AB...), and four-phase eight-beat (A-AB-B-BC-C-CD-D-DA-A...). This example is implemented using the four-phase eight-beat drive mode.
The following is the C language control program I wrote to achieve the effect of the 28BYJ48 stepper motor rotating five circles forward and then five circles reverse:
//************************************************************************************
//*
//*
//*
//*
//************************************************************************************
//*
//*
//*
//********************************************************************************
#include
#include
//*************************Forward rotation phase sequence table*****************************
unsigned char code FFW[8]={0x08,0x0c,0x04,0x06,0x02,0x03,0x01,0x09};
//**********************Reverse rotation phase sequence table*****************************
unsigned char code REV[8]={0x09,0x01,0x03,0x02,0x06,0x04,0x0c,0x08};
//***********************Delay subroutine********************************
void delay(unsigned int t)
{
}
//*************************Stepper motor forward ********************************
void
//*********************Stepper motor reverse **********************************
void
{
//*************************Main program************************************
main()
Previous article:An interesting explanation of the concept of microcontroller stack
Next article:8 steps to learn microcontrollers
- Popular Resources
- Popular amplifiers
- Teach you to learn 51 single chip microcomputer-C language version (Second Edition) (Song Xuefeng)
- RBF neural network control design, analysis and Matlab simulation (Liu Jinkun)
- Chip Manufacturing: A Practical Tutorial on Semiconductor Process Technology (Sixth Edition)
- Teach you how to learn 51 single chip microcomputer step by step (Song Xuesong)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Registration for the 2021 STM32 Summit and Fan Carnival online live broadcast has begun!
- [Qinheng Trial] CH559EVT Trial 2: Development Environment
- Mid-Autumn Festival "State Banquet": Take a photo of the domestic components on the board and win a small gift
- Qiming Cloud Sharing: ESP32C3 Alibaba Cloud Connection Test Steps
- MSP430F5438 clock system
- Repair of FOTILE embedded electric steamer, the water level sensor failed and the circuit was broken because of a small resistor
- ASM330LHHX automotive-grade 6-axis inertial module related information and driver
- Application design using the FRAM-based MCU MSP430FR57xx series
- EEWORLD University Hall----Live Replay: AVNET uses MPLAB? Ecosystem and Curiosity Nano Development Board to create an innovative development workflow
- BleuNRG-1 one master and multiple slaves master module search interval setting