[PD] arduino-help.me.please.pd [gadlletas]
martinrp at alcor.concordia.ca
Mon May 29 17:35:16 CEST 2006
Christian Klippel wrote:
> servo's are _slightly_ different in that they dont take the classical pwm that
> you can regulate from 0..100%.
> instead, a servo needs a repetetive pulse between 1 and 2 miliseconds.
> that pulse train can have a frequency from 30 to 400 hz, for example, but the
> pulse width stays in the same range. a pulse of 1.5 ms positions the servo
> into the center, 1 and 2 ms are for the full movement to the left or right
> in the controller you need a loop (or, preferably, an interrupt) that just
> waits some 20 ms, then sets the pulse on, waits 1 to 2 ms, and turns off
> again, then repeat ....
...or a 50Hz pwm with a positive pulse width varying between 5 and 10
percent. Doing this from a soundcard output is bad because 50Hz is close
to the low-frequency cutoff of the card, so the parts of the pulse that
should be at either 0V or 5V will actually drift towards each other. You
would need to add a comparator to get a digital level signal.
The arduino digitalWrite command in conjunction with delayMicroseconds
(for the positive pulse)and delay (for the negative pulse) should be OK
More information about the Pd-list