1660 views|7 replies

223

Posts

3

Resources
The OP
 

[STM32H5 NUCLEO H533RE Review] 05 Micro Stepper Motor I/O Driver [Copy link]

This post was last edited by Maker_kun on 2024-7-21 21:59

Driving effect:

Materials used in this review: STM32H5 development board, H-bridge L298N module, micro stepper motor

Stepper Motor Principle

There are many types of stepper motors, which can be divided into many types according to different classification standards. The following are several common classification methods and their corresponding stepper motor types:

  1. Classification by rotor structure :

    • Variable Reluctance (VR) stepper motor : Its rotor is made of soft magnetic material, has no winding, and both the stator and rotor adopt a tooth structure. It has the characteristics of low cost, small step angle but poor dynamic performance.
    • Permanent Magnet Stepper Motor (PM) : Its rotor is made of permanent magnet material, with large output torque, but the step angle is generally large.
    • Hybrid Stepping Motor (HS) : It combines the advantages of reactive and permanent magnet types. It is usually divided into two-phase, three-phase and five-phase, and has good overall performance.
  2. Classification by stator winding :

    • Single-phase stepper motor : usually has only one winding and is suitable for simple applications.
    • Two-phase stepper motor : There are two independent windings, the driving method is complex, and the design is more complicated without a microcontroller.
    • Three-phase stepper motor : has three independent windings, small step angle, often used in applications requiring high-precision control.
    • Four-phase stepper motor : has four independent windings, high cost and complex structure, mainly used for special purposes.
    • Five-phase stepper motor : has five independent windings, smaller step angle, higher accuracy, but also higher cost and complexity.
  3. Classification by working principle :

    • Electromagnetic stepper motor : uses electromagnetic force to directly drive the rotor to rotate.
    • Piezoelectric stepper motor : uses the piezoelectric effect to convert electrical signals into mechanical motion.
    • Rolling cut stepper motor : The stepping motion is achieved through rolling cutter cutting.
    • Mechanical harmonic stepper motor : uses the principle of mechanical harmonics for stepping control.
  4. Classification by output torque and power :

    • Control stepper motor : The output torque is small, usually in the N·cm level, suitable for the workbench of small precision machine tools, etc.
    • Power stepper motor : The output torque is large, usually in the N·m level, and can directly drive larger loads such as machine tool workbenches.
  5. Classification by excitation phase number :

    • Three-phase stepper motor : The number of main poles of the stator coil is a multiple of three, such as 3, 6, 9, 12, etc.
    • Four-phase stepper motor : The number of main poles of the stator coil is a multiple of four, such as 4, 8, 12, etc.
    • Five-phase stepper motor : The number of main poles of the stator coil is a multiple of five, such as 5, 10, 15, etc.

Exploded view of stepper motor:

Permanent magnet stepper motor:

Simple schematic diagram:

Actual structure diagram:

Disassembling the micro stepper motor:

The hardware circuit can be controlled by H-bridge circuit

The micro stepper motors used in this project are:

OPPO K3 lifting front camera lifting stepper motor module, internal resistance 14.5Ω, weight 3.6g, deceleration stroke about 10mm

Start building the software driver:

After consulting the schematic diagram, it is determined that PA8, PB10, PB4, and PB5 are driven by A1, A1, B1, and B2 respectively.

Software configuration STM32H5 related pins:

Build configuration:

Macro definition pin name and function:

Main program main drives micro stepper motor code: forward motion, reverse motion

 while (1)
  {
int t=1;
int i=0;

for(i=0;i<330;i++)//正向移动
 {
	  A1(1);A2(0);B1(0);B2(0); HAL_Delay(t);

	  A1(1);A2(0);B1(1);B2(0); HAL_Delay(t);

	  A1(0);A2(0);B1(1);B2(0); HAL_Delay(t);

	  A1(0);A2(1);B1(1);B2(0); HAL_Delay(t);


	  A1(0);A2(1);B1(0);B2(0); HAL_Delay(t);

	  A1(0);A2(1);B1(0);B2(1); HAL_Delay(t);

	  A1(0);A2(0);B1(0);B2(1); HAL_Delay(t);

	  A1(1);A2(0);B1(0);B2(1); HAL_Delay(t);

	  LED0_TOGGLE();
 }


for(i=0;i<330;i++)//逆向移动
 {
	  A1(1);A2(0);B1(0);B2(1); HAL_Delay(t);

	  A1(0);A2(0);B1(0);B2(1); HAL_Delay(t);

	  A1(0);A2(1);B1(0);B2(1); HAL_Delay(t);

	  A1(0);A2(1);B1(0);B2(0); HAL_Delay(t);


	  A1(0);A2(1);B1(1);B2(0); HAL_Delay(t);

	  A1(0);A2(0);B1(1);B2(0); HAL_Delay(t);

	  A1(1);A2(0);B1(1);B2(0); HAL_Delay(t);

	  A1(1);A2(0);B1(0);B2(0); HAL_Delay(t);

	  LED0_TOGGLE();
 }

Relevant attachments:

【STM32H5 NUCLEO H533RE测评】05微型步进电机IO驱动.docx (7.86 MB, downloads: 0)

References:

https://www.bilibili.com/video/BV1nA4m1A7Ke/?spm_id_from=333.337.search-card.all.click

https://mbd.baidu.com/newspage/data/videolanding?nid=sv_10160840858512304975&sourceFrom=share

https://www.bilibili.com/video/BV1Vr421W75a/?spm_id_from=333.999.0.0&vd_source=23409a47a6116408c30d6bca673c6a2b

This post is from stm32/stm8

Latest reply

The original motor design is so clever   Details Published on 2024-7-22 23:36
 

734

Posts

4

Resources
2
 

The content of the stepper motor provided by the host is illustrated with pictures and texts, which is very clear and easy to understand, and is very helpful for understanding the working principle of the stepper motor

This post is from stm32/stm8

Comments

The structure inside the small motor is indeed very complex and ingenious.  Details Published on 2024-7-22 08:07
 
 

6841

Posts

11

Resources
3
 

Can the OP use pwm to generate complementary drivers for fun in the next step?

This post is from stm32/stm8

Comments

This is indeed an important direction, and we are slowly exploring it.  Details Published on 2024-7-22 08:09
 
 

223

Posts

3

Resources
4
 
chejm posted on 2024-7-22 06:59 The content of the stepper motor provided by the OP is very clear and easy to understand, which is very helpful for understanding the working principle of the stepper motor

The structure inside the small motor is indeed very complex and ingenious.


This post is from stm32/stm8
 
 
 

223

Posts

3

Resources
5
 
lugl4313820 posted on 2024-7-22 07:50 Can you use pwm to generate complementary drivers for fun?

This is indeed an important direction, and we are slowly exploring it.


This post is from stm32/stm8
 
 
 

2870

Posts

4

Resources
6
 

Thanks for the review, it would be nice to explain the program in more depth.

This post is from stm32/stm8

Comments

Originally there were four beats, but the program I wrote inserted a subdivision, which is eight beats. The forward and reverse directions are actually the reverse of the driving order.  Details Published on 2024-7-22 08:34
 
 
 

223

Posts

3

Resources
7
 
bigbat posted on 2024-7-22 08:29 Thanks for the review, it would be nice to explain the program in more depth

Originally there were four beats, but the program I wrote inserted a subdivision, which is eight beats. The forward and reverse directions are actually the reverse of the driving order.


This post is from stm32/stm8
 
 
 

109

Posts

3

Resources
8
 

The original motor design is so clever

This post is from stm32/stm8
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list