www.xonelectronics.it
Per far girare un motore stepper occorrono potenza e forme d'onda precise... EZ-Red ha tutto quello che serve, perché non provare?
Così, per gioco, ho fatto alcuni collegamenti e ho scritto un breve ciclo PLC.
Attenzione però: si tratta un esperimento che non ha ALCUNA APPLICAZIONE PRATICA: i motori passo passo devono essere pilotati a corrente costante, ed EZ-Red non ha la circuiteria adatta.
Guarda il video dell'esperimento
Collegamenti
Un motore passo passo richiede normalmente che ogni bobina venga alimentata in modo normale e in modo "inverso". Dato che EZ-Red ha polarità fissa sulle uscite, ho scelto un motore unipolare che, per ogni avvolgimento, presenta 3 morsetti: usando quello centrale come comune, è possibile ottenere quanto richiesto (perdendo potenza, ma era solo un esperimento). Lo schema di collegamento è quindi il seguente:
La tensione di alimentazione e le resistenze vanno scelte in base al motore utilizzato; si può partire con 16 volt e 200 ohm / 2 watt, che sono valori conservativi.
Ciclo PLC
Il ciclo PLC è costruito intorno all'idea che la sequenza di tensioni da fornire al motore è del tipo:- Bobina 1 diretta
- Bobina 2 diretta
- Bobina 1 inversa
- Bobina 2 inversa
task2: ybyte=0b0001 wait stpdelay ; stpdelay è la variabile che contiene ; il ritardo in ms ybyte=0b0100 wait stpdelay ybyte=0b0010 wait stpdelay ybyte=0b1000 wait stpdelay
define stpdelay dt1
define posmot dt5
stpdelay=5
task1:
if posmot>260 then posmot=1
if posmot>ain1 then
if posmot-ain1 > 10 then stpdelay = 5 else stpdelay=20
suspend 2
wakeup 3
end
if posmot<ain1 then
if ain1-posmot > 10 then stpdelay = 5 else stpdelay=20
suspend 3
wakeup 2
end
if posmot=ain1 then
suspend 2
suspend 3
ybyte=0
end
task2:
; outs: RRLL
ybyte=0b0001
posmot=posmot+1
wait stpdelay
ybyte=0b0100
posmot=posmot+1
wait stpdelay
ybyte=0b0010
posmot=posmot+1
wait stpdelay
ybyte=0b1000
posmot=posmot+1
wait stpdelay
task3:
; outs: RRLL
ybyte=0b0001
posmot=posmot-1
wait stpdelay
ybyte=0b1000
posmot=posmot-1
wait stpdelay
ybyte=0b0010
posmot=posmot-1
wait stpdelay
ybyte=0b0100
posmot=posmot-1
wait stpdelay
