Search the Community
Showing results for tags 'pulse'.
-
Hi, I tried my hand for the first time on a servo and my experience may be helpful to other people. Servos are controlled by the length of a pulse. This pulse is repeated ca. every 20mS. The pulse length can vary coarsly between 1 and 2 mS. The pulse length determines the rotation angle. If the servo starts up, it goes to a middle position, corresponding to a ca. 1.5 mS pulse. For shorter pulses the servo turns in one direction, for longer pulses to the other. The range is limited, mostly to +/- 90 degree, the accurate values depend on the servo, as does the min/max widths. Mine had a ran
-
A decoder from a motor has 2 square wave outputs that deliver 256 pulses/revolution (duty cycle 1:1). The two outputs are 90 degree out of phase for direction information. I want to count pulse, in one direction up, in the other down. Towards this aim I attach to the first decoder output following routine: void countStep(){ if(digitalRead(_CIN2)){_pos++;} else {_pos--;} } "_CIN2" is the second decoder output and "pos" the counter variable. This works well until up to approx. 16kHz. But for higher frequencies it counts in the wrong direction. I first guessed, that the phase r
- 3 replies
-
- interrupts
- pulse
-
(and 2 more)
Tagged with: