The same for 08M2 :Grazie per lo schema PIEM ma a casa ho solo 08m2 ti chiedo troppo se cambi programma quindi provo subito
'===================================================
'Commande moteur PAP bipolaire
'08M2 Driver L293D
' connections moteur : sur A et B du L293D
'sequence demi pas: C0,C0C2,C2,C2C1,C1,C1C4,C4,C4C0...
'sequence pas entiers 1 enroulement: C0,C2,C1,C4,...
'sequence pas entiers 2 enroulements: C0C2,C2C1,C1C4,C4C0...
'===================================================
#picaxe 08M2
setfreq M32
'===================================================
symbol MOT = outpinsC 'MOT correspond au portC du 08M2
symbol period = W1 'temps entre pas en 1/100 de ms
symbol nbpas = W2 'Nombre de pas
dirsC= %10111 'affectation C.0, C.1, C.2 et C.4 en sortie vers le L293
'mémorisation de la sequence de commande pour le moteur en demi pas
eeprom 0,(%10010,%10000,%10001, %00001,%00101,%00100,%00110,%00010)
'prg principal ==============================
princ:
do
'mise hors tension du moteur pendant 3 sec.
Mot =%00000
pause 3000
'actionne x demi-pas dans un sens avec une vitesse donnée
period = 50 : nbpas = 200
for w10 = 1 to nbpas
inc b0
gosub PAS
next
'actionne x demi-pas dans l'autre sens avec une autre vitesse
period = 20 : nbpas = 200
for w10 = 1 to nbpas
dec b0
gosub PAS
next
pause 500
'actionne x pas dans un sens avec une vitesse donnée
'va lire une séquence (paire) sur deux (mode 2 enroulements alimentés)
period = 50 :nbpas = 200: b0 = 0
for w10 = 1 to nbpas
b0 = b0+2
gosub PAS
next
'actionne x pas dans l'autre sens avec une autre vitesse
'va lire une séquence (impaire) sur deux (mode 1 enroulement alimenté)
period = 28 :nbpas = 200: b0 = 1
for w10 = 1 to nbpas
b0 = b0-2
gosub PAS
next
loop
PAS: ' ******************
b0 = b0 & %00000111 'la valeur de b0 est limitée à 3 bits, soit 0 à 7
read b0, Mot ' va lire la séquence 0 à 7 dans l'eeprom.
'et envoi de cette séquence au moteur
pause period 'pause en ms
return
let dirsb =% 10111
main:
for b1 = 1 to 50
let pinsb =% 00101
breaks 10
let pinsb =% 10001
breaks 10
let pinsb =% 00101
breaks 10
let pinsb =% 00110
breaks 10
next b1
let pinsb =% 00000
wait 5
goto main:
let pinsb =%00101 ==
let pinsb =%10001
let pinsb =%00101 ==
let pinsb =%00110
;Total High= 1-313
let pinsb =%00001 or let pinsb =%10001
let pinsb =%10011 or let pinsb =%00101
let pinsb =%10110 or let pinsb =%00110
let pinsb =%00100 or let pinsb =%10010
;Total High= 2-222
let dirsC = %010111 ;COMMANDS IMPORTANT TO ADD.
**************** THIS PROGRAM DOES NOT YET DRIVE THE STEPPER MOTOR.
**************** BUT THIS SIMILAR PROGRAM DOES WHEN USING THE 08m DEVICE.
;main: ; Moved
; 543210 these are the pins on the 08M2 chip. C.0 is fixed as always
; an output we can't change it. C.3 is an input can't change that
; either. C.5 is used when downloading although we can use it in our
; program we have to type the word 'disconnect' as mentioned on a
; previous thread.
; C.0 is also used when downloaded
; 543210 "I TYPE THESE PINS NUMBERS TO HELP ME REMEBER THEM": A+ : i : A- : B+ : B-
let pins = %10010 ; Coils A = +, B = + ; Why ?
pause 50
main:
let pins = %10001 ; Coils A = +, B = -
pause 50
let pins = %00101 ; Coils A = - , B = -
pause 50
let pins = %00110 ; Coils A = -, B = +
pause 50
let pins = %10010 ; Coils A = +, B = +
pause 100 ; Why longer ? (I'd expect slightly shorter)
goto main
Please can you give us a link to the " pg16l0064 " (post #33) stepper motor. The one that I found HERE does NOT have 30 ohm coils, but is still specified at 12 volts.Hello everyone, very kind members, I spent the whole Sunday trying and trying again, I went through all your advice and tests, I got to the point that I agree with "Piem", I have an idea that for some reason the 293 it is not compatible with my stepper, or due to voltage drops as Allycat says or due to my inability ....
at the same time i dont want to break down, but i would like to try with a driver other than the l293, what do you think? do you have one to recommend?
Thanks always for the help
Yes, it seems that the coils are NOT "30 ohms", they're probably about 7 ohms. Therefore at 9 - 12 volts there may be large current "spikes", so you may need to pay particular attention to the power supply and decoupling (or "reservoir") capacitors, etc.. Also, the L293D is only rated up to 600 mA which is probably not enough for that motor.Hello to all:
rated current measured at 5v = 0.45A
Nominal current measured at 12.3 V = 0.78A While I measure the phase resistance, in fact, I can't because it starts from 37ohm to arrive after 1 minute to stabilize around 30ohm ... maybe the coils interfere in my tester?
Morning Guys.Page Not Found - Aliexpress.com
a.aliexpress.com
Hi wriglei, yes it is just that type there, now I try to put you the link, at this point you recommend a driver that can drive it without problems ....
; THIS CODE DRIVES A 28BYJ-48 5 VOLT STEPPER. 30th dec2020
; THE +5 VOLT TRACK HAS BEEN CUT OPEN CIRCUIT MAKING IT A BI-POLAR TYPE
; USES THE PICAXE DEVELOPMENT BOARD AXE023 08M2 MOTOR DRIVER BOARD (08M2 + L293D)
; BLUE WIRED TO pin C.0 via L293D
; YELLOW WIRED TO pin C.1 via L293D
; ORANGE WIRED TO pin C.2 via L293D
; PINK WIRED TO pin C.4 via L293D
; THE ABOVE WIRING ROTATES THE SHAFT CLOCKWISE LOOKING DOWN AT IT.
; SWAPPING WIRES PINK TO C.2 & ORANGE TO C.4 ROTATES THE SHAFT COUNTER CLOCKWISE.
; 175mA @ + 5V and 250mA @ +7 volts.
; 130 * 4 lines of code rotates the shaft approx 360 degrees in 11 seconds PAUSE 10.
; with no pause value the stepper just makes faint buzzing sound.
; with pause 5 @ 5 volts the torque is weak. current = 162mA.
; with pause 5 @ 7 volts the torque is stronger. Current = 235mA. 0-360 degrees 3 seconds.
; disconnect This command is not needed with this AXE023 because of the RUN / PROG link.
let dirs =% 10111
main :; Half Step Coil Mode
; 130 rotates shaft 360 degrees
For b1 = 1 to 130
; 43210 08M2 output pins. Ignore C.3.
let pins =% 00101
breaks 10
let pins =% 00001
breaks 10
let pins =% 10001
breaks 10
let pins =% 10000
breaks 10
let pins =% 10010
breaks 10
let pins =% 00010
breaks 10
let pins =% 00110
breaks 10
let pins =% 00100
breaks 10
next b1
For b1 = 1 to 130
; 43210
let pins =% 00110
breaks 10
let pins =% 00010
breaks 10
let pins =% 10010
breaks 10
let pins =% 10000
breaks 10
let pins =% 10001
breaks 10
let pins =% 00001
breaks 10
let pins =% 00101
breaks 10
let pins =% 00100
breaks 10
next b1
let pins =% 00000; stops the motor drawing current
; THIS CODE DRIVES A 28BYJ-48 5 VOLT STEPPER.
; THE +5 VOLT TRACK HAS BEEN CUT OPEN CIRCUIT MAKING IT A BI-POLAR TYPE
; USING THE PICAXE AX023 08M2 MOTOR DRIVER BOARD (08M2 + L293D)
; BLUE WIRED TO C.0
; YELLOW WIRED TO C.1
; ORANGE WIRED TO C.2
; PINK WIRED TO C.4
; THE ABOVE WIRING ROTATES THE SHAFT CLOCKWISE LOOKING DOWN AT IT.
; SWAPPING WIRES PINK TO C.2 & ORANGE TO C.4 ROTATES THE SHAFT COUNTER CLOCKWISE.
; 175mA @ + 5V and 250mA @ +7 volts.
; 130 * 4 lines of code rotates the shaft approx 360 degrees in 11 seconds.
; with no pause value the stepper just make a faint buzzing sound.
; with pause 5 @ 5 volts the torque is weak. current = 162mA.
; with pause 5 @ 7 volts the torque is stronger. Current = 235mA. 0-360 degrees 3 seconds.
let dirs =% 10111
main:
For b1 = 1 to 130
; 43210
let pins =% 00101
breaks 5
let pins =% 10001
breaks 5
let pins =% 10010
breaks 5
let pins =% 00110
breaks 5
next b1
For b1 = 1 to 130
; 43210
let pins =% 10010
breaks 5
let pins =% 10001
breaks 5
let pins =% 00101
breaks 5
let pins =% 00110
breaks 5
next b1
let pins =% 00000
#picaxe 18M2 ; To warn that this code will only work (unchanged) on some specific PICAXEs
symbol pulse = 15
symbol overlap = 15
For b1 = 1 to 128
pinsb = %00010000 : pause pulse ; adjust to give the required crane rotation speed.
pinsb = %00110000 : pause overlap
pinsb = %00100000 : pause pulse
pinsb = %01100000 : pause overlap
pinsb = %01000000 : pause pulse
pinsb = %11000000 : pause overlap
pinsb = %10000000 : pause pulse
pinsb = %10010000 : pause overlap
next b1
Hello Mike/Wrigley,Hi Alan
Thanks for your quick reply. I'm using normal English language as far as I know on pe6. Yes I noticed that after I pasted my code into (code)(code) the pause changed into break, text was shifted etc. I had to google how to do that (code/ code) etc not having done it before, maybe I made a mistake there.
I typed a comment "oops, pause changed to break" at the end of my text yesterday for you to see but those words have disappeared.
Mike