Picaxe Servo Control
Описание
Servos controlled by a Picaxe 18X. Simulating how they might be used to automate a manufacturing process. The larger of the two servos is adapted so that it will run through 360 degrees continuously.
Picaxe Code -
init:
servo 1,150 'initialise servo postion
pause 2000 'wait for servos to get to position
main:
For b1 = 0 to 10 ' make 10 pieces
servo 0,150 'start the feed (using a modified 360 degree servo)
pause 2000 ' 2 Seconds of feed at approx 10cm per second
low 0 'end the feed
high 2' switch the heater on
pause 500 'wait half a second for wire to heat up
'move the cutter... slowly
For b0=150 to 80 STEP -1
servopos 1,b0 'move the cutter
pause 20 'wait a bit
next b0
low 2 ' switch the heater off
pause 500
servopos 1,150 ' move the heater smartly back to starting position
pause 500 'wait a half second
next b1
Picaxe Code -
init:
servo 1,150 'initialise servo postion
pause 2000 'wait for servos to get to position
main:
For b1 = 0 to 10 ' make 10 pieces
servo 0,150 'start the feed (using a modified 360 degree servo)
pause 2000 ' 2 Seconds of feed at approx 10cm per second
low 0 'end the feed
high 2' switch the heater on
pause 500 'wait half a second for wire to heat up
'move the cutter... slowly
For b0=150 to 80 STEP -1
servopos 1,b0 'move the cutter
pause 20 'wait a bit
next b0
low 2 ' switch the heater off
pause 500
servopos 1,150 ' move the heater smartly back to starting position
pause 500 'wait a half second
next b1
