Home > Control Circuits >Motor Control > Principle analysis and demonstration program of deceleration stepper motor 28BYJ-48

Principle analysis and demonstration program of deceleration stepper motor 28BYJ-48

Source: InternetPublisher:spectrum Keywords: Stepper Motor Updated: 2024/10/14

The schematic diagram of the reduction stepper motor 28BYJ-48 is shown below:

Schematic diagram of reduction stepper motor 28BYJ-48

The middle part is the rotor, which is composed of a permanent magnet, and the side is the stator winding. When one winding of the stator is energized, an electromagnetic field in one direction will be generated. If the direction of this magnetic field is not in the same straight line as the direction of the rotor magnetic field, then the magnetic fields of the stator and rotor will generate a torque to twist the stator.

By changing the magnetic field of the windings in sequence, the stepper motor can be made to rotate forward or reverse (for example, the power-on sequence is A->B->C->D for forward rotation, and vice versa). By changing the time interval of magnetic field switching, the speed of the stepper motor can be controlled. This is the driving principle of the stepper motor.

Since the driving current of the stepper motor is relatively large, the microcontroller cannot drive it directly. It is generally driven by the ULN2003 Darlington array. Of course, it can also be driven by a pull-down resistor or a transistor, but the effect is not so good and the torque generated is relatively small.

The stepper motor demonstration program is as follows:

  #include <reg52.h>
  
  sbit key=P2^0; //Button controls the direction of the stepper motor
  
  unsigned char speed=5; //Stepper motor speed
  
  //Eight-beat drive, the order is A AB B BC C CD D DA
  
  unsigned char code cLOCkWise[]={0x01,0x03,0x02,0x06,0x04,0x0c,0x08,0x0d};
  
  void delay(unsigned char z)
  
  {
  
  unsigned char x,y;
  
  for(x=0;x<z;x++)
  
  for(y=0;y<110;y++);
  
  }
  
  void main()
  
  {
  
  unsigned char i;
  
  while(1)
  
  {
  
  for(i=0;i<8;i++)
  
  {
  
  if(key) //Button not pressed, forward rotation
  
  {
  
  P0=clockWise[i];
  
  delay(speed);
  
  }
  
  else //Button pressed, reverse rotation
  
  {
  
  P0=clockWise[8-i];
  
  delay(speed);
  
  }

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号