Stepper motor control board

Monday, November 17th, 2008

Program 6:-

Now I am adding one more functionality in the program. Now instead of continuously running motor, motor will run till desired no. of revolutions entered. Means motor will automatically stops when it completes desired revolutions. One can increase or decrease revolutions in step of one (1, 2, 3 …).  I have used 6 keys and 5 LEDs.

In the first program we have limit the number of applied pulses to 200. Now again we shall load the number every time that will change number of applied pulses. There is no maximum limit but sure there is minimum limit that is 1 revolution.

Org 00h
mov 30h, #3Ch           ; make a table of
mov 31h, #1Eh           ; four load values
mov 32h, #14h           ; for variable delay
mov 33h, #0Fh
mov r1, #30h              ; initial location in r1
mov 2fh,#32h             ; initial load value
mov 2eh,#01h            ; for no. of rev.
mov r0,#01h               ; initialize key count
mov p1,#0ffh              ; P1 as input port
lop:   mov a,p1
cjne a,#0ffh,jmp
ajmp lop                       ; loop until any key is pressed

jmp:     clr p0.0                     ; indicates keypress
loop:    rrc a
jnc num                        ; get key no.
inc r0
sjmp loop
num: acall dely                  ; key debounce delay
setb p0.0
cjne r0,#01h,nxt
acall clkwise
sjmp over
nxt:  cjne r0,#02h,nxt2
acall aclkwise
sjmp over
nxt2: cjne r0,#03h,nxt3
acall incrpm
sjmp over
nxt3: cjne r0,#04h,nxt4
acall decrpm
sjmp over
nxt4: cjne r0,#05h,nxt5
acall increv
sjmp over
nxt5:cjne r0,#06h,over
acall decrev

over:   mov p2,#00h
mov p1,#0ffh
mov r0,#01h
sjmp lop
clkwise:
mov r1,2Fh              ; load variable count
go: clr  p0.1
mov p2,#01h          ; single coil
acall delay              ; excitation
mov p2,#02h
acall delay              ; variable delay
setb p0.1
mov p2,#04h
acall delay
mov p2,#08h;
acall delay
djnz r1,go
ret
aclkwise:
mov r1,2Fh
go1:clr p0.2
mov p2,#01h
acall delay
mov p2,#08h
acall delay
setb p0.2
mov p2,#04h
acall delay
mov p2,#02h
acall delay
djnz r1,go1
ret
incrpm:
clr p0.3                     ; indication
cjne r1,#33h,incr     ; if max limit is
ajmp noin                  ; reached no increase
incr: inc r1                      ; increase otherwise
acall dely
setb p0.3
noin:  ret                         ; led stays on for max limit

decrpm:
clr p0.3                    ; indication
cjne r1,#30h,decr   ; if min limit is
ajmp noin                 ; reached no decrease
decr: dec r1                   ; decrease otherwise
acall dely
setb p0.3
noin: ret                         ; led stays on for min limit
increv:
clr p0.4                    ; indication
inc 2Eh                    ; increment multiplying factor
mov a,#32h
mov b,2Eh
mul ab                      ; multiply it by load value
mov 2Fh,a                ; stores the new load value
acall dely
setb p0.4
ret
decrev:
clr p0.4
mov r4,2Eh
cjne r4,#01h,decn     ; check for min
ajmp out2                   ; limit of multiplying
decn: dec 2Eh                 ; factor. If not reached
mov a,#32h              ; decrease it
mov b,2Eh
mul ab                       ; multiply it with load
mov 2Fh,a                 ; value and store the
acall dely                  ; new load value
setb p0.4
out2: ret

delay:
mov 10h,@r1              ; load the count
lop2: mov r6,#FAh           ; from table
lop1: nop
nop
djnz 10h,lop1
djnz r5,lop2
ret

dely:
mov r5,#0C8h             ; load count 200
lop2: mov r6,#0FAh          ; for 200ms delay
lop1: nop
nop
djnz r6,lop1
djnz r5,lop2
ret
end

Program 7:-
This program adds two more things to above program. It changes the mode of operation of stepper motor also it adds jog control. It changes three different modes on pressing one key. All eight keys and eight LEDs are now used.

When J7 key is pressed first time the mode will change from single coil to double coil. When pressed second time mode will change from double coil to half step. And on pressing third time again the same mode will repeat. When J8 key is pressed the motor will rotate in previously selected direction. Means if motor was running in clockwise direction then the jog will be in same direction.

Program 8:-

In above program motor doesn’t rotate continuously. In this program motor rotates continuously and one can change the RPM and operating mode while running. 6 keys and 8 LEDs are used.

by
Ashutosh M Bhatt
www.multyremotes.com

Pages: 1 2 3 4 5

Avatar Image

Author Name :
Ranjith

Total : 31 Comments


31 Responses to “Stepper motor control board”

  1. Naqash says:

    da program gives syntax error when it is build in keil software.
    its give error for cjne a,#0ffh,jmp. n
    jmp clr p0.0……..

  2. ranjith says:

    Hi, here jmp is used as a label. Please change jmp to some other name. for example
    cjne a,#0ffh,keypress
    keypress: clr p0.0

  3. naqash says:

    it also gives error here
    lop2:mov r6,#FAh ; give 1 ms delay :the error is undefined symbol(pass 2).
    lop2: mov r6,#0FAh ; for 200ms delay : attempt to define already defined label.
    lop1: nop attempt to define already defined label.

  4. Naqash says:

    hi plz tell me abt these error in program
    n i m using of Seiko epson EM-198.
    will it operate with 7805.

  5. Ranjith says:

    Hi replace “dely” function as given below.
    ———————-
    dely:
    mov r5,#0C8h ; load count 200
    lop22: mov r6,#0FAh ; for 200ms delay
    lop11:nop
    nop
    djnz r6,lop11
    djnz r5,lop22
    ret
    ———————–

  6. Wharliaverisa says:

    Nothing seems to be easier than seeing someone whom you can help but not helping.
    I suggest we start giving it a try. Give love to the ones that need it.
    God will appreciate it.

  7. gretamandisson says:

    I’m new here on the forum, found it by searching google. I look forward to chatting about various topics with all of you.

  8. chandran says:

    It is interesting. Can you mail me the full details of the circuits

  9. For Sale says:

    Good stuff. I like this blog. I will subscribe to it.

  10. vinod says:

    very good circuit … can you mail the full details and explainations of the circuit.

  11. omar says:

    can u tell me how to control pitman motor using at89s51 through h bridge give ,jut move the motor in forward and reverse direction ,and also give me a small cobe to drive the motor through h bridge using at89s51

  12. muthu says:

    sperb thank u

  13. Chucculty says:

    А телефон свой не оставите? Хотелось бы кое-что обсудить по теме.

  14. naina says:

    hey the project is nice but is there any problem in the programs is they give error

  15. purna says:

    hi, please give the full information about the stepper motor

  16. Ashok Shah says:

    Nice project for learners. Is it available in kit form at a reasonable price?
    Are the problems solved or still existing?

  17. Taio Cruz says:

    Cheers, superb post.

  18. Tushar says:

    Hi . . .can you mail me the full detail of the circuit diagram and the
    program.

  19. sonali says:

    AS THIS IS IN ASSEMBLY AND NOT IN ‘C’ DONT USE KEIL USE “ASEM” OR “RAISONANCE” INSTEAD.

  20. Hi there, just wandered by. I have a Cincinnati 4g site. Amazing the amount of information on the web. Wasn’t what I was looking for, but great site. Take care.

  21. minhaj says:

    dear sir i want a program for only one directional revolution that means clockwise revolution..for fixed RPM

  22. [...] stepper motor conttrol by using atmel89c51 Here are some example projects using the AT89C51: Stepper motor control board STEPPER MOTOR CONTROL USING 89C51 MICROCONTROLLER Microcontroller Based Clockwise/Anticlockwise [...]

  23. praveensp says:

    thanks for this information its very useful for my project

  24. divya says:

    please send me more details about it…
    it is very nice..

  25. pintu says:

    p.asm(5): error A9: SYNTAX ERROR
    p.asm(7): error A5: ILLEGAL USE OF A RESERVED WORD
    p.asm(7): error A9: SYNTAX ERROR
    p.asm(7): error A9: SYNTAX ERROR
    p.asm(8): error A8: ATTEMPT TO DEFINE AN ALREADY DEFINED LABEL
    p.asm(22): error A45: UNDEFINED SYMBOL (PASS-2)
    p.asm(24): error A8: ATTEMPT TO DEFINE AN ALREADY DEFINED LABEL
    p.asm(37): error A45: UNDEFINED SYMBOL (PASS-2)
    p.asm(57): error A45: UNDEFINED SYMBOL (PASS-2)
    p.asm(58): error A8: ATTEMPT TO DEFINE AN ALREADY DEFINED LABEL
    p.asm(65): error A8: ATTEMPT TO DEFINE AN ALREADY DEFINED LABEL
    p.asm(66): error A8: ATTEMPT TO DEFINE AN ALREADY DEFINED LABEL
    Target not created

    this types of errors in program no 3 what can i do?

  26. [...] Mulberry There will be sufficient signals which Tiongkok may really do the main connected with market cheap mulberry bags monetary increase for a while to reach you mulberry output line shop. A multitude of Britain reduced establishments might utilize that, especially while using the industrial, power in addition for you to online mtsghrza industries. Mulberry Alexa Handbag (pictured) includes gotten good care of his or her holdings throughout on the net retail merchant ASOS, which just after reliable forex trade went up by 85%. These days there may be over More than 200 lecturer stores merely america and concepts that you can obtainable a full fantastic offer extra suppliers globally inside of the future, an italian man, specialit which had considered around mulberry alexa large during 2000 created everywhere improve with burberrys light in the book bag marketplace! These are in most cases fuzy as well as sewed by hand, Mulberry 18643 mulberry bags madison accrued leather lindsey satchel wine red colored for ladies with offering inside our own store retail store online. Popular designs this previous a life time are generally just what exactly Mulberry 17003 madison laser lessen op craft leather whirlpool sophia satchel produce that will guys together with females. Presently there have ended Above two hundred lecturer merchants just the united states and concepts that will available a total wonderful give more retailers around the globe ultimately, the italian specialist whom needed over Mulberry Alexa Handbag within 2004 fabricated ample improve around burberrys soft through pack cheap mulberry bags promote! They can be readily subjective additionally padded in your hands, Mulberry 18643 madison obtained leather based lindsey satchel wines beverages reddish for females upon selling for our store retail outlet world-wide-web. ae1334d01be6a6a21 Mulberry Bags Sale, Mulberry Bags Online, Mulberry Bags UK Discount Mulberry brand bags mulberry bags outlet Mulberry [...]

  27. Andrew cholak says:

    hey Ranjith,
    I was looking at some of the work you have done, i am quiet amazed by your skill level. I would want to implement some of your work, if you would allow me to ofcourse. Would it be possible if i get you to email me to discuss this further? my email should appear to you. Please Email me as soon you get this .
    thanks
    Andrew Cholak

  28. vinoth.p says:

    hello sir pls send the keil c program for this control circuit

    thank u

  29. sagarr says:

    nmsty…i wan control 3 stepper moters using just 3 switches for anticlkwise, clkwise,stop action of motor using only 1 89c51…..send me required prog. and flowchart on my email id…

  30. Thanks for the new stuff you have disclosed in your text. One thing I’d like to discuss is that FSBO interactions are built eventually. By presenting yourself to the owners the first few days their FSBO is usually announced, prior to the masses start calling on Friday, you develop a good network. By mailing them resources, educational components, free accounts, and forms, you become an ally. By subtracting a personal affinity for them and also their scenario, you make a solid link that, on most occasions, pays off as soon as the owners decide to go with a real estate agent they know plus trust – preferably you actually. Drop by my webpage whenever you wish. thx.!

Leave a Reply

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup