Hi all,
I've tried and tried and tried to get this to work. But it's time to ask.
Running the AXE171 project board with the SPE035 sound module. (Picaxe 14M2 processsor)
I need to operate 2 servos concurrently to open/close railway gates either side of the track.
The board provides for Pins B1 and B3 for servo operation.
One servo, on either pin works fine. Try to run both pins, alternating SERVOPOS commands between pins results in either servo to judder/jolt to another position then immediately returning to the correct position. The judder/jolt seems to be randon, and occurs every 5, 10, 20 seconds, or so.
If I use a high ranges of servopos (say 180 thru 220) the judder/jolt occurs more often. If I use a lower range of servopos (say 75 thru 120) the judder/jolt is far less frequent. Placing a "pause" ( 20 - 50 ms) inbeteen each servopos also reduces the frequecy of the judder/jolt as the pause period increases. But I'm unable to eliminate the judder/jolt when running both servo pins. Any higher on the "pause" here and the gates operate too slowly.
If I code for just using either pin (not both at the same time) there is no judder/jolt at all, ever, even with both servos plugged in.
The codes is in a loop.
While servopos_ctr < x
Servopos_ctr = servopos_ctr + 1
Servopos B.1, Servopos_ctr
Pause
Servopos B3, Servopos_ctr
Pause
endloop
Yes, I do a "servo pin, initial position" to set them up.
Yes, I know....... But I'm running both servos off the 3 pins on the AXE171 board for B1 & B3. ( pins for "pin", V+, V0)
The manual tells me the servopos and servo command will continually pulse the servo pins every 20ms with the the pulse length according to the position needed.
My question...... Will the Picaxe14M2 operate correctly and schedule and execute correctly and concurrently TWO, servo pin's pulses? Or is it limited to reliably operating and pulsing continually, just 1 servo pin at a time?
Should I turn one servo pin "OFF" before using the other? (and use servo, rather than servopos, of course)
i.e.
While servopos_ctr < x
Servopos_ctr = servopos_ctr + 1
Servo B.1, Servopos_ctr
Servo B1, OFF
Pause
Servo B3, Servopos_ctr
Servo B3, OFF
Pause
endloop
Any assistance much appreciated.
Thanks,
Alan.
TOOT!
I've tried and tried and tried to get this to work. But it's time to ask.
Running the AXE171 project board with the SPE035 sound module. (Picaxe 14M2 processsor)
I need to operate 2 servos concurrently to open/close railway gates either side of the track.
The board provides for Pins B1 and B3 for servo operation.
One servo, on either pin works fine. Try to run both pins, alternating SERVOPOS commands between pins results in either servo to judder/jolt to another position then immediately returning to the correct position. The judder/jolt seems to be randon, and occurs every 5, 10, 20 seconds, or so.
If I use a high ranges of servopos (say 180 thru 220) the judder/jolt occurs more often. If I use a lower range of servopos (say 75 thru 120) the judder/jolt is far less frequent. Placing a "pause" ( 20 - 50 ms) inbeteen each servopos also reduces the frequecy of the judder/jolt as the pause period increases. But I'm unable to eliminate the judder/jolt when running both servo pins. Any higher on the "pause" here and the gates operate too slowly.
If I code for just using either pin (not both at the same time) there is no judder/jolt at all, ever, even with both servos plugged in.
The codes is in a loop.
While servopos_ctr < x
Servopos_ctr = servopos_ctr + 1
Servopos B.1, Servopos_ctr
Pause
Servopos B3, Servopos_ctr
Pause
endloop
Yes, I do a "servo pin, initial position" to set them up.
Yes, I know....... But I'm running both servos off the 3 pins on the AXE171 board for B1 & B3. ( pins for "pin", V+, V0)
The manual tells me the servopos and servo command will continually pulse the servo pins every 20ms with the the pulse length according to the position needed.
My question...... Will the Picaxe14M2 operate correctly and schedule and execute correctly and concurrently TWO, servo pin's pulses? Or is it limited to reliably operating and pulsing continually, just 1 servo pin at a time?
Should I turn one servo pin "OFF" before using the other? (and use servo, rather than servopos, of course)
i.e.
While servopos_ctr < x
Servopos_ctr = servopos_ctr + 1
Servo B.1, Servopos_ctr
Servo B1, OFF
Pause
Servo B3, Servopos_ctr
Servo B3, OFF
Pause
endloop
Any assistance much appreciated.
Thanks,
Alan.
TOOT!