Vous êtes sur la page 1sur 27

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

Home
Kits are available for this project from Talking Electronics for $25.00 plus postage. See more projects using PIC micros: Elektor,EPE,Silicon Chip "Pick-A-PIC."

This project controls a stepper motor in full and half-step increments.

1 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

2 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

Stepper Motor Controller built on Experimenter PC board

THE STEPPER MOTOR


There are a number of stepper motors on the market and it takes a little bit of understanding to know how they work. The main difference is the number of coils and the way they are connected but there are also points to know to get the maximum torque .

3 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

A STEPPER MOTOR
A stepper motor consists of a number of stationary coils and these are turned on and pull a rotary magnet towards the coil. This action turns a shaft. But you must turn the coils on and off at the right moment to create rotary movement. This requires an external circuit consisting of pulses and these pulses must contain voltage and current to deliver energy to the stepper motor. To understand how a stepper motor works, you just need to know the fact that a coil will attract a magnet when a current flows and it will repel the magnet when the current flows in the opposite direction. In the following animation you can see an armature (rotor) being pulled around by turning on one or more coils.

Note that 8 steps can be created with 4 coils by turning them on individually or in pairs:

Here is another diagram to show how the rotor is moved by half-step intervals:

4 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

UNIPOLAR ANIMATION
The following animation shows a 6 wire stepper motor. It can be converted to a 5-wire stepper motor by connecting the two centre taps together to the positive supply. The two ends of each winding are alternately grounded to reverse the direction of the field provided by that winding. The cross section shown is a 30 degree per step motor. Motor winding number 1 is distributed between the top and bottom stator pole, while motor winding number 2 is distributed between the left and right motor poles. The rotor is a permanent magnet with 6 poles, 3 south and 3 north, arranged around its circumference. As shown in the figure, the current flowing from the center tap of winding 1 to terminal "a" causes the top stator pole to be a north pole while the bottom stator pole is a south pole. This attracts the rotor into the position shown. If the power to winding 1 is removed and winding 2 is energised, the rotor will turn 30 degrees, or one step. By turning on two windings during part of the cycle, a half-step can be introduced. This is shown in the animation. It takes three complete cycles of the control system to turn this 6-pole rotor one revolution.

5 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

HALF STEPPING
With half stepping, the drive alternates between two phases ON and a single phase ON. This increases the angular resolution, but the motor also has less torque (approx 70%) at the half step position (where only a single phase is on). This can be increased by increasing the current in the active winding. Half-stepping increases the accuracy of the output. This is what we have done in this project. To keep the theory simple, we are not going into the waveforms needed to produce rotation, however we need to explain how the coils are connected as some motors have 5, 6 or 8 leads (wires). 4-wire stepper motors:

This type of motor has only one winding per stator pole. This is called a Unifilar winding (uni meaning one). As we mentioned above, the winding must see reverse voltage to produce rotation and this type of motor is not covered in this project. 6-wire stepper motors:

6 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

6-wire stepper motors have two identical sets of windings on each stator pole. This is called bifilar winding and this type of winding configuration simplifies operation in that delivering current from one coil then another, wound in the opposite direction, will reverse the rotation of the motor shaft. Whereas, in a unifilar application, to change direction requires reversing the current in the same winding, as mentioned above. 5-wire stepper motors:

5-wire stepper motors simply have the centre-tap of each winding connected inside the motor or on a terminal-block. 8-wire stepper motors:

7 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

8-wire stepper motors simply have the wires from the two coils brought out separately. This arrangement offers the flexibility of either a series or parallel connection. But this will bring it to a 4-wire device and require voltage reversal to produce rotation. You can also search the web for details on connecting the windings for high torque but this is beyond the scope of this article. The type of stepper motor we will be covering are 5, 6 or 8-lead Unipolar stepper motors.

UNIPOLAR AND BIPOLAR STEPPER MOTORS


A Unipolar Stepper Motor has two windings per phase, one for each direction of magnetic field. You can remember the word "Uni" means only one direction of current is needed for this type of motor. This is the type we use in this project. A Bipolar Stepper Motor has a single winding per phase. The current in a winding needs to be reversed (thus the prefix "Bi" ) in order to reverse a magnetic pole, so the driving circuit must be more complicated, typically with an H-bridge arrangement. The following diagrams show how to connect these stepper motors:

8 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

BIFILAR STEPPER MOTORS


Bifilar windings on a stepper motor are applied to the same rotor and stator geometry as a bipolar motor, but instead of winding each coil in the stator with a single wire, two wires are wound in parallel with each other. As a result, the motor has 8 wires, not four. In practice, motors with bifilar windings are always powered as either unipolar or bipolar motors.

Note the alignment of the poles on the rotor


To use a bifilar motor as a unipolar motor, the two wires of each winding are connected in series and the point of connection is used as a center-tap. To use a bifilar motor as a bipolar motor, the two wires of each winding are connected either in parallel or in series. With parallel connection, this allows low voltage high-current operation. With series connection, if the center tap is ignored, this allows operation at a higher voltage and lower current than would be used with the windings in parallel. Essentially all 6-wire motors sold for bipolar use are actually wound using bifilar windings. Any unipolar motor may be used as a bipolar motor at twice the rated voltage and half the rated current on the nameplate.

IDENTIFYING STEPPER MOTOR WIRES


Most stepper motors have 6 wires, however there are some with 4, 5, or 8 wires. Each of the four coils is made up of one length of wire with two ends. One end is called live and the other end is called common. In a five-wire stepper motor all four commons are joined together, in a six-wire stepper motor two pairs of common wires are joined together, and in an eight-wire stepper motor none of the four common wires are joined together. The following diagrams show how the coils are connected:

9 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

If you do not have a schematic diagram for your stepper motor - for example if it was salvaged from an old printer - it is very easy to work out the wiring. Use a multimeter to measure the resistance of each coil. All four coils will have identical resistance. If they did not, the motor would not function properly. The resistance may be 100 ohms. If a pair of wires measures 200 ohms, you are measuring between two live ends. In other words, you are measuring the resistance of TWO COILS. If you have a 5 wire stepper motor, it will be very easy to find the common wire as every other wires will have a resistance of 100 ohms. For the 6 wire stepper motor, you will have 3 wires with resistance values and another 3 wires with resistance values. The two wires with 200 ohms resistance between them, are "live," so the other wire is "common." Once you have identified the "common" wire(s), you need to find the correct "phases." This is another way of saying the correct way to connect the motor so that it rotates clockwise of anticlockwise. You cannot simply connect the "live" wires to the project in any order. They must be connected so that the pulses will create a rotating magnetic field. There is no way to determine the correct way to connect a stepper motor other than viewing the output on a 4-input CRO. So, we have to do it by trial-and-error. Connect the stepper motor in any arrangement to the project but make sure the common goes to the positive rail, as we have already identified this wire. Turn on the project and see if the stepper motor rotates. If not, do not touch the first wire. Simply swap the last two wires. If this does not work, swap the 2nd and fourth wires. Then the second and third wires. The motor will not be damaged during this process as it does not take any more current when oscillating back and forth or when rotating. keep swapping the last three wires until the motor rotates.

10 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

PWM
To make a stepper motor rotate at the fastest RPM, we deliver a pulse of very short duration, to each of the poles and the order of delivering these pulses must be correct. If we try to increase the RPM, we need to make the pulse shorter in duration and a point will come when the stepper motor HALTS or STOPS or FREEZES. We now know the maximum RPM. To decrease the RPM, we increase the length of each pulse and this produces less pulses per second. The RPM decreases. In all of this action, the stepper motor is taking almost the same current as the voltage is being supplied almost constantly, the only difference is the pulses are longer or shorter. But suppose you want to supply less current or supply the stepper motor with a higher voltage. This can be done by delivering a short pulse then turning off the supply for a short period of time between pulses. This will not alter the RPM under the following conditions: Suppose the minimum pulse-width is 5mS. Suppose the pulse-width is presently 25mS. If the pulse-width is reduced to 5mS and an off-period of 20mS, the stepper motor will retain the same RPM but consume less current. The torque will also be reduced and this will have be checked - to see if the motor stalls under load. This action is called "reducing-the-pulse-width" and is commonly called PULSE WIDTH MODULATION. This is called "driving the motor with PWM." You can also use PWM to drive a 12v stepper motor from 24v or 36v. By using the example above, the stepper motor is only getting a pulse of energy for 20% of the time, so that delivering a voltage such as 24v or 36v, will result in an average current that is less than driving it without PWM on 12v. These are the main reasons for using PWM. It is not used to control the RPM.

STEPPER MOTOR VOLTAGE


You can find stepper motors in all types of consumer electronics, including printers, video players, plotters and the head positioning motors from old diskette drives. Most of these stepper motors are 12v. However few of them are identified with the operating voltage and the simplest way to test them is to connect to 12v and read the current. Current consumption from 50mA to 300mA is quite common and since they are generally

11 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

used for very short periods of time, they will not get hot or even warm. If you want to use them on a higher voltage, such as 24v or 36v, you will need to drive them with very short pulses and provide an off-period in the waveform so that the overall current is not above about 300mA. This involves a pulse-width technique called PWM, mentioned above. This can be incorporated into the project by modifying the program.

INSTRUCTIONS FOR USE


Turn the project ON and push the left button very quickly. The stepper motor will increment a half-step. Keep the button pressed and the stepper motor will rotate clockwise. Push the right button very quickly. The stepper motor will increment a half-step. Keep the button pressed and the stepper motor will rotate anti-clockwise. Push the top button. The project now goes to full-step mode. Push the left button and the stepper motor rotates clockwise in full-step mode. Turn the pot to increase or decrease RPM. Turn the project off. Push the top button. The project now goes to full-step mode. Push the right button and the stepper motor rotates anti-clockwise in full-step mode. Turn the pot to increase or decrease RPM. CONSTRUCTION You can build the circuit on any type of Proto board. We have chosen our surface-mount board as it makes a neat project and you can see all the wiring at the same time. The PROGRAM If you want to modify the program you will need a programmer, a board to hold the 8 pin chip during programming and an adapter to connect between the programmer and PC board. These are covered in our article "Pick-A-PIC." Here are the files you will need for "burning" your chip and/or modifying the program: Step.asm Step.txt Step.hex The following program is for viewing. It may contain spaces or hidden characters that will not

12 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

compile correctly to produce a .hex file. Use the .hex file above to burn your chip or the .asm file to modify the program. ;******************************* ;Stepper.asm ;drives a Stepper motor forward and reverse ;13-11-2010 ;*******************************

list p=12F629 radix dec include "p12f629.inc" errorlevel -302 ; Don't complain about BANK 1 registers __CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT ;Internal osc. ;_MCLRE_OFF - master clear must be off for gp3 as input pin

;****************************** ; variables - names and files ;***************************** temp1 temp2 equ 20h ; equ 21h ;

Sw_Flag equ 25h ;switch flag for "inching" loops equ 26h ;loops for full stepping count equ 27h ;loops of discharge time for 100n PotValue equ 28h ;value of pot look equ 29h ;look for pot value every 100 loops

;*************************** ;Equates ;*************************** status equ 0x03 rp1 equ 0x06 rp0 equ 0x05 GPIO equ 0x05

status

equ

03h

13 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

option_reg

equ 81h

; bits on GPIO pin7 pin6 pin5 pin4 pin3 pin2 equ equ equ equ equ equ 0 1 2 3 4 5 ;GP0 ;GP1 ;GP2 ;GP3 ;GP4 ;GP5 100k speed output1 to output2 to Input from output3 to output4 to pot stepper stepper buttons stepper stepper

motor motor motor motor

;bits rp0 equ 5 ;bit 5 of the status register

;********************** ;Beginning of program ;********************** org 0x00 nop nop nop nop nop SetUp bsf status, rp0 movlw b'11001000' movwf TRISIO bcf status, rp0 movlw 07h movwf CMCON clrf GPIO clrf Sw_Flag incf Sw_Flag,1 goto Main

;Bank 1 ;Set TRIS

GP1,2,4,5 out GP3 input

;bank 0 ;turn off Comparator ports ;must be placed in bank 0 ;Clear GPIO of junk ;put a bit onto Sw_Flag

;**************** ;delays * ;**************** _uS movlw movwf decfsz 08Ch temp1 temp1,f

14 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

goto retlw

$-1 00

;delay for pulsing servo anticlockwise acw movlw movwf decfsz goto retlw 60h temp1 temp1,f $-1 00

_1mS

nop decfsz goto retlw movlw movwf nop decfsz goto decfsz goto retlw

temp1,f _1mS 00 .5 temp2 temp1,f $-2 temp2,f $-4 00

_5mS

_10mS

movlw movwf nop decfsz goto decfsz goto retlw movlw movwf nop decfsz goto decfsz

0Ah temp2 temp1,f $-2 temp2,f $-4 00 .15 temp2 temp1,f $-2 temp2,f

_15mS

15 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

goto retlw

$-4 00

_18mS

movlw movwf nop decfsz goto decfsz goto retlw movlw movwf nop decfsz goto decfsz goto retlw

.18 temp2 temp1,f $-2 temp2,f $-4 00 .50 temp2 temp1,f $-2 temp2,f $-4 00

_50mS

_100mS

movlw movwf nop decfsz goto decfsz goto retlw

.100 temp2 temp1,f $-2 temp2,f $-4 00

_200mS

movlw movwf nop decfsz goto decfsz goto retlw

.200 temp2 temp1,f $-2 temp2,f $-4 00

16 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

;delay to create value for pot for speed PotDel movlw movwf decfsz goto retlw 040h temp1 temp1,f $-1 00 ;40h produces 12 loops

;*************************** ; Sub Routines ;***************************

;position of pot creates a value in PotValue Pot bsf bcf bcf bcf call bsf bsf bcf clrf call incf btfss goto retlw status,rp0 trisio,0 ;Make GP0 output status,rp0 gpio,0 ;make GP0 LOW _1mS ;create delay to discharge 100n status,rp0 trisio,0 ;Make GP0 input status,rp0 PotValue PotDel PotValue,f gpio,0 ;is input HIGH? $-3 00 ;returns with a value in PotValue

;****************** ;* Main * ;****************** Main clrf bcf call bsf nop btfss goto gpio gpio,5 _1mS gpio,5 gpio,3 $+2

;gpio,5 high for a short time

17 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

goto clrf bsf btfss goto goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto goto _1HSF_ _2HSF_ _3HSF_ _4HSF_ _5HSF_ _6HSF_ _7HSF_ _8HSF_ movlw goto movlw goto movlw goto movlw goto movlw goto movlw goto movlw goto movlw movwf call clrf call call clrf incf bsf

$+6 gpio

;go to half step Forward

gpio,1 gpio,3 Reverse ;go to half step Reverse _FS ;go to Full Step - for forward or reverse Sw_Flag,0 _1HSF_ Sw_Flag,1 _2HSF_ Sw_Flag,2 _3HSF_ Sw_Flag,3 _4HSF_ Sw_Flag,4 _5HSF_ Sw_Flag,5 _6HSF_ Sw_Flag,6 _7HSF_ _8HSF_ b'00100000' _C b'00110000' _C b'00010000' _C b'00010100' _C b'00000100' _C b'00000110' _C b'00000010' _C b'00100010' gpio _200mS gpio _200mS _200mS Sw_Flag Sw_Flag,1 gpio,5 ;1 ;2 ;3 ;4 ;5 ;6 ;7 ;8

18 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

nop btfsc goto bcf goto

gpio,3 HS_Fwd gpio,5 Main

;see if sw is still pressed for full speed

_C

movwf call clrf call call bcf rlf bsf nop btfsc goto bcf goto

gpio _200mS gpio _200mS _200mS status,0 Sw_Flag,1 gpio,5 gpio,3 HS_Fwd gpio,5 Main

;clear the carry

;see if sw is still pressed for full speed

;reverse - half step

Reverse clrf bcf call bsf nop btfss goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto gpio gpio,4 _1mS gpio,4 gpio,3 Main Sw_Flag,0 _1HSR_ Sw_Flag,1 _2HSR_ Sw_Flag,2 _3HSR_ Sw_Flag,3 _4HSR_ Sw_Flag,4 _5HSR_ ;gpio,4 high for a short time

19 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

btfsc goto btfsc goto goto _1HSR_ movlw movwf call clrf call call Movlw movwf bsf nop btfsc goto bcf goto movlw goto movlw goto movlw goto movlw goto movlw goto movlw goto movlw goto

Sw_Flag,5 _6HSR_ Sw_Flag,6 _7HSR_ _8HSR_ b'00100000' gpio _200mS gpio _200mS _200mS 80h Sw_Flag gpio,4 gpio,3 HS_Rev Main b'00110000' _D b'00010000' _D b'00010100' _D b'00000100' _D b'00000110' _D b'00000010' _D b'00100010' _D ;2 ;3 ;4 ;5 ;6 ;7 ;8 ;1

;see if sw is still pressed for full speed gpio,4

_2HSR_ _3HSR_ _4HSR_ _5HSR_ _6HSR_ _7HSR_ _8HSR_

_D

movwf call clrf call call bcf rrf bsf nop

gpio _200mS gpio _200mS _200mS status,0 Sw_Flag,1 gpio,4

;clear the carry

20 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

btfsc goto bcf goto

gpio,3 HS_Rev gpio,4 Main

;see if sw is still pressed for full speed

;half step forward

HS_Fwd clrf bcf call bsf nop btfss goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto goto _1HSF _2HSF _3HSF _4HSF _5HSF _6HSF movlw goto movlw goto movlw goto movlw goto movlw goto movlw gpio gpio,5 _1mS ;gpio,5 high for a short time gpio,5 gpio,3 Main Sw_Flag,0 _1HSF Sw_Flag,1 _2HSF Sw_Flag,2 _3HSF Sw_Flag,3 _4HSF Sw_Flag,4 _5HSF Sw_Flag,5 _6HSF Sw_Flag,6 _7HSF _8HSF b'00100000' _CC b'00110000' _CC b'00010000' _CC b'00010100' _CC b'00000100' _CC b'00000110' ;1 ;2 ;3 ;4 ;5 ;6

21 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

_7HSF _8HSF

goto movlw goto movlw movwf call clrf clrf incf goto

_CC b'00000010' _CC b'00100010' gpio _5mS gpio Sw_Flag Sw_Flag,1 HS_Fwd

;7 ;8

_CC

movwf call clrf bcf rlf goto

gpio _5mS gpio status,0 Sw_Flag,1 HS_Fwd

;clear the carry

;half step reverse HS_Rev clrf bcf call bsf nop btfss goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto btfsc goto goto gpio gpio,4 _1mS gpio,4 gpio,3 Main Sw_Flag,0 _1HSR Sw_Flag,1 _2HSR Sw_Flag,2 _3HSR Sw_Flag,3 _4HSR Sw_Flag,4 _5HSR Sw_Flag,5 _6HSR Sw_Flag,6 _7HSR _8HSR ;gpio,4 high for a short time

22 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

_1HSR

_2HSR _3HSR _4HSR _5HSR _6HSR _7HSR _8HSR

movlw movwf call clrf Movlw movwf goto movlw goto movlw goto movlw goto movlw goto movlw goto movlw goto movlw

b'00100000' gpio _10mS gpio 80h Sw_Flag HS_Rev b'00110000' _G b'00010000' _G b'00010100' _G b'00000100' _G b'00000110' _G b'00000010' _G b'00100010' goto _G

;1

;2 ;3 ;4 ;5 ;6 ;7 ;8

_G

movwf call clrf bcf rrf goto

gpio _10mS gpio status,0 Sw_Flag,1 HS_Rev

;clear the carry

;decide on full step forward or reverse

_FS

clrf bsf btfss goto goto bsf btfss goto goto clrf

gpio gpio,5 gpio,3 $+2 FS_Fwd gpio,4 gpio,3 $+2 FS_Rev gpio

23 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

call goto

_1mS $-10

;Full Step Forward FS_Fwd call movlw movwf movlw movwf movf movwf call decfsz goto movlw movwf movf movwf call decfsz goto movlw movwf movf movwf call decfsz goto movlw movwf movf movwf call decfsz goto decfsz goto goto pot ;returns with value in PotValue .50 look ;look at pot every 50 loops b'00000010' ;full step forward gpio PotValue,w loops _1mS loops,1 $-2 b'00000100' gpio PotValue,w loops _1mS loops,1 $-2 b'00010000' gpio PotValue,w loops _1mS loops,1 $-2 b'00100000' gpio PotValue,w loops _1mS loops,1 $-2 look,1 FS_Fwd+3 ;don't look at pot FS_Fwd ;look at pot

;Full Step Reverse FS_Rev call pot ;returns with value in PotValue

24 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

movlw movwf movlw movwf movf movwf call decfsz goto movlw movwf movf movwf call decfsz goto movlw movwf movf movwf call decfsz goto movlw movwf movf movwf call decfsz goto decfsz goto goto END

.50 look ;look at pot every 50 loops b'00100000' ;full step reverse gpio PotValue,w loops _1mS loops,1 $-2 b'00010000' gpio PotValue,w loops _1mS loops,1 $-2 b'00000100' gpio PotValue,w loops _1mS loops,1 $-2 b'00000010' gpio PotValue,w loops _1mS loops,1 $-2 look,1 FS_Rev+3 ;don't look at pot FS_Rev ;look at pot

GOING FURTHER You can add additional features to this project by writing your own program or modifying the program above.

25 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

Stepper Motor Controller


Parts List

Cost: au$25.00 plus postage


Kits are available

1 4 1 3 1 1

39R SM resistor> 100R SM resistor 220R SM resistor 2k2 SM resistor 47k SM resistor 100k pot

2 - 100n SM capacitors 1 - 100u electrolytic 4 1 4 1 SM yellow LEDs SM diode BD679 transistors 78L05 SM voltage regulator

1 - SPDT mini slide switch 3 - mini tactile buttons 1 - 8 pin IC socket 1 - 5 pin header 40cm fine enamelled wire 20cm fine tinned copper wire

26 di 27

13/09/2012 8.13

Stepper Motor Controller

http://www.talkingelectronics.com/projects/Stepper Motor Controller/StepperMotor.html

20cm - very fine solder 1 - PIC12F629 chip (with Step routine) 1 - 4-cell battery holder 1 - battery snap

1 - Prototype PC board
16/11/2010

Official Digi-Key Site


Search Our Huge Selection of Electronics Components Here! www.digikey.it

27 di 27

13/09/2012 8.13

Vous aimerez peut-être aussi