Tricky Dicky
Senior Member
I have written a program to use a modified AXE024 board to drive a servo to open a gate on a model railway layout. The program is using code snippets from the AXE024 data sheet to control the speed of movement and the positioning of the servo. At the end of each movement I am experiencing a slight random twitch or two in the servo, the twitch seems to be something to do with the programming or the PICAXE 08M2 firmware. I have tried all the usual remedies regards power supplies and I am using batteries during this testing stage. If I remove the servo from the circuit and replace it with an LED, I can see the LED flicker at exactly the same point which seems just moments after the servopos command has completed the move. One positive is that after the twitches the servo holds it position without any further twitching.
Looking at the possibility of eliminating these random twitches in software, there is a Servopos (pin) Off command in the manual which is not explained and I was wondering if adding that command immediately after the movement loop in each sub-routine of the attached program would help? The manual states that switching the pin being used by the servo command low, switches off the servo command would this help especially if the servo command was removed from the initialisation routine in the attached program and added to the start of each sub-routine?
Richard
Looking at the possibility of eliminating these random twitches in software, there is a Servopos (pin) Off command in the manual which is not explained and I was wondering if adding that command immediately after the movement loop in each sub-routine of the attached program would help? The manual states that switching the pin being used by the servo command low, switches off the servo command would this help especially if the servo command was removed from the initialisation routine in the attached program and added to the start of each sub-routine?
Richard
Attachments
-
1.6 KB Views: 47