Right, some progress! I have written a couple of short test programs and these show up the problem quite clearly. The first simply cycles the servo between two positions with a dwell after each to allow time for the jitter to manifest itself if present. In fact, there is no jitter, the servo is solid.
Code:
#picaxe 08M2
high C.2
pause 1000
b12 = 150
servo C.1,b12
pause 20
main:
b12 = 150
servopos C.1,b12
pause 10000
b12 = 200
servopos C.1,b12
pause 10000
goto main
The second version is similar to the first, but after each dwell it waits on the press of a button (the application is a free flight model timer so there is quite a lot of button pressing in the full application). During the long pause the servo is solid, as with the first program. However, when it reaches the wait loop the jitter starts. After the button press and subsequent move, the servo is again solid during the other dwell and the cycle repeats. So the wait loop seems to be causing the jitter, which occurs according to some sort of pattern every 2 or 3 seconds.
Code:
#picaxe 08M2
high C.2
pause 1000
b12 = 150
servo C.1,b12
pause 20
main:
b12 = 150
servopos C.1,b12
pause 10000
but1:
if pinC.3 = 0 then goto but1
b12 = 200
servopos C.1,b12
pause 10000
but2:
if pinC.3 = 0 then goto but2
pause 1000
goto main
Is it necessary to break this loop into parts, and if so, what is the best way to do it? If not, any ideas?
Roy
BTW the high C.2 is normally used to switch the servo power on but I have bypassed the FET to eliminate that as a potential cause in the above tests.