On 22/12/2018 15:08, A. Dumas wrote:
> The Natural Philosopher wrote:
>> On 22/12/2018 14:12, Martin Gregorie wrote:
>>> On Sat, 22 Dec 2018 13:26:05 +0000, The Natural Philosopher wrote:
>>>> Well the average nodel servo gets a pulse every 50ms so its hardly gonna
>>>> kill a Pi.
>>>>
>>> True, but since Linux isn't an RTOS you can't rule out jitter. A loop
>>> like:
>>>
>>> while(running)
>>> sleep 49 mS
>>> set output pin high
>>> wait pulselength /* 1-2 mS */
>>> set output pin low
>>>
>>> can be pre-empted during the sleep, so the 50mS cycle time isn't
>>> guaranteed and it can also be pre-empted during the wait while the signal
>>> is high. While cycle length jitter probably isn't an issue, pre-emption
>>> while the pulse is being output certainly is because it is guaranteed to
>>> make the servo jitter.
>>>
>>
>> Indeed, but isnt there some interrupt driven PWM thing? I seem to
>> remember reading that there was...
>
> The problem isn't the total signal period, a lot of modern servos don't
> mind anything between, what, 5 and a couple of 100 ms. The only critical
> value is "T high" with a value around 1500 us. If you can time that pulse
> with guaranteed microsecond accuracy, then you're definitely good for
> degree accuracy (from an electronic perspective; also depends on your
> servo's mechanical accuracy).
>
Well exactly. But I thought that the Pi had some sort of 'set pwm value'
and 'trigger pwm pulse' and even 'let it free run at that pwm'
It seems that it has:
https://circuitdigest.com/microcontroller-projects/raspberry-pi-pwm-tutorial
And no code is required to maintain the thing in steady operation
AIUI that means driving two RC servos is trivial beyond belief
Se up the frequenciy to be say 30 Hz,set up the pulse widths and robert
is a relative,
The onlyt delay would be in MOVING the servos
Not top say that a stepper motor is probably a better option with proper
driver stuff
Steppers dont slew as fast as some servos though. Especially 'digital'
ones which just need the odd pulse of a certain width and they are off
to the new mark. IIRC no signal leaves them where they are.
--
Those who want slavery should have the grace to name it by its proper
name. They must face the full meaning of that which they are advocating
or condoning; the full, exact, specific meaning of collectivism, of its
logical implications, of the principles upon which it is based, and of
the ultimate consequences to which these principles will lead. They must
face it, then decide whether this is what they want or not.
Ayn Rand.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|