Two-phase 4-wire stepper motor driver

Publisher:星光闪耀Latest update time:2012-08-04 Source: 61ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Some time ago, when I was out shopping, I passed by a scrap collection station and saw an aunt dismantling parts from a machine. I didn't know what machine it was, but I suddenly saw her dismantling a round thing. I walked closer and saw that it was a motor with four wires. I thought it must be a stepper motor. Although it was old, the quality looked good, so I liked it very much. I asked the aunt how much it cost and wanted to buy it. The aunt said ten yuan, not a cent less. I had no choice but to pay ten yuan to buy this "iron block"! Due to time constraints, I have never had the opportunity to tinker with it. Today I have some time, so I took it out to study it.

Click to browse the next page


Click to browse the next page

Click to browse the next page

After measurement, this is a two-phase four-wire stepper motor with a step angle of 1.8 degrees. There are two working modes. One is the 4-beat mode and the other is the 8-beat mode. The timing of the 4-beat mode is as follows:

a~ and b~ represent reverse currents.

ab - a~b - a~b~ - ab~ is one direction.
ab - ab~ - a~b~ - a~b is the opposite direction.

The timing of the 8-beat method is as follows:

A B C D E F G H (timing)

A 1 1 0 0 0 0 0 1
A- 0 0 0 1 1 1 0 0
B 0 1 1 1 0 0 0 0
B- 0 0 0 0 0 1 1 1

I use the 8-beat method here. Procedure:


/***
**********************************************************************
**Program function:
**Chip model: STC11F16XE
**Crystal frequency: 22.1184M
**Date of writing: October 2010
**Writer: wang QQ: 349259818 Email: hongfadg@163.com
**Remarks:
*******************************************************************/
//The following are the required header files
//#include //#include

//#include
//#include
#include
//Define keywords for easy use
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
/*
sbit p10=P1^0;//The first group of motors
sbit p11=P1^1;
sbit p12=P1^2;//The first group of motor
sbits p13=P1^3;//The second group of motor
sbits p14=P1^4;
sbit p15=P1^5;//The second group of motors
*/
uchar step[]={0x25,0x2d,0x2c,0x2e,0x26,0x36,0x34,0x35};//Timing parameter table
/* Delay function
*******************************************************************
**Function prototype: void delay(void)
**Function function: delay function
**Input parameters: None
**Output parameters: None
**Remarks:
*******************************************************************/
void delay(void)

{
unsigned char a,b,c;
for(c=18;c>0;c--)
for(b=19;b>0;b--)
for(a=23;a>0;a-- );
}

/* Main function
****************************************************************
**Function prototype: main()
**Function function:
**Input parameters: None
**Output parameters: None
**Remarks: Complete the main functions of the program
*******************************************************************/
main()
{
unsigned char c;
while(1) //Main loop
{
for(c=0;c<8;c++)
{

P1=step[c]; //Motor drive
delay(); //Delay
}

}

}

[page]

Circuit Diagram:

Click to browse the next page

Stepper motor driver board

Click to browse the next page

Control Panel

Click to browse the next page

Assemble the whole

Click to browse the next page


Reference address:Two-phase 4-wire stepper motor driver

Previous article:U-BOOT transplant experience
Next article:12864 LCD display without font library

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

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号