Showing posts with label MCS-51. Show all posts
Showing posts with label MCS-51. Show all posts

Thursday, 19 January 2012

Stepper Controller

Stepper is an electromechanical device that works on electrical pulses that periodically flows into the motor, then each pulse is converted into motion, that's why it is called a stepper. Stepper motors are discussed is a unipolar stepper motor which has 4 phases and the length step of 1.8 ° per step (phase). The smaller the step length per step of a stepper motor, it is the better.

Stepper motors have many advantages than DC motors. Some of these are: easier to manage and can result in a slow rotation. Therefore, in certain applications more and more people choose to use stepper motors than DC motors.

In order to move the stepper motor can rotate then the pulse is given as shown below

look a video demonstration

To generate a periodic pulse above, there are several ways:
  1. Using IC 555 as a pulse generator, and amplifier circuits (solid state switches) because the stepper motor requires a sufficiently large electric currents between 1 to 2 Amp.
  2. Using a IC microcontroller that has been programmed to generate pulses at its ports.
Here will be discussed using IC microcontroller AT89S51.

Port 0 uC is connected to the data of stepper motor as shown in the figure below. Between uC and stepper motors are IC ULN2803, this IC will provide the voltage supply data from the uC to a stepper motor because without this IC, output voltage of the uC will not be able to drive a stepper motor stepper motor, although it has given voltage 12V.

Programs generate pulses to drive a stepper motor:

start:
mov a, #1                            ; fill the accumulator with the value 00000001
mov r1,#4

main:
mov P0,a                             ; fill P0 with values ​​in the accumulator
rl a                                       ; rotate left  the accumulator value by one bit.
Call delay                             ; call delay, because rotate process need times
djnz r1,main                          ; decrease the value in register 1, if not zero then jump to the main
sjmp start                              ; if the register 1 is zero then a jump to start, re-fill the values of the accumulator and register 1

delay:
mov r2,#255
dly :
mov r3,#20h
djnz r3,$
djnz r2,dly
ret
end

Code rl  a on the above program is a primary function to generate a periodic pulse that will make the stepper motor rotates.

Port 0     P0.0     P0.1    P0.2       P0.3
Rl a          1           0         0           0
Rl a          0           1         0           0
Rl a          0           0         1           0
Rl a          0           0         0           1

look a video demonstration

Friday, 6 January 2012

DC Motor Controller

In the previous discussion about dc motor driver with L298 explained that, dc motor can be set by the L298 motor driver. To adjust the movement of the motor automatically needed circuit that combines the IC Microcontroller and L298.

Many types of IC microcontrollers that can be used to perform this work. Here are discussed using AT89S51 as the  IC control. This IC can store data for 4Kbyte. Data entered into the microcontroller is made ​​with a program which is then converted to a file. Hex, this file will be flashed into the  IC control.

The following is a simple motor control circuit.


To flash the program from the PC (Personal Computer) to the IC control needed downloader that is connected to the MISO, MOSI, SCK, RESET, VCC and GND of the IC control.

This is a list of programs to control the dc motor automatically using assembly programming :

Start:

motor_right:                      ; dc motor rotates to the right
mov p1,#00000001b          ; p1.0 = 1  and p1.1 = 0
call delay                          ; call times
mov p1,#0ffh                    ; stop
call delay                          ; call times
motor_left:                        ; dc motor rotates to the left                                                 
mov p1,#00000010b          ; p1.0 = 0 and p1.1 = 1
call delay
mov p1,#0ffh                     ; stop
call delay
sjmp start                           ; jump to start

delay :                                ;times
mov r1, #255

dly:
mov r2,#100
djnz r2, $
djnz r1,dly
ret
end

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Review