Message from discussion
Are servo control pulses the same as rotary encoder output?
Received: by 10.42.33.9 with SMTP id g9mr3336256icd.25.1347055854815;
Fri, 07 Sep 2012 15:10:54 -0700 (PDT)
X-BeenThere: hackerspace_brisbane@googlegroups.com
Received: by 10.231.2.13 with SMTP id 13ls2213838ibh.1.gmail; Fri, 07 Sep 2012
15:10:53 -0700 (PDT)
Received: by 10.42.19.199 with SMTP id d7mr3304218icb.11.1347055853796;
Fri, 07 Sep 2012 15:10:53 -0700 (PDT)
Received: by 10.42.19.199 with SMTP id d7mr3304216icb.11.1347055853773;
Fri, 07 Sep 2012 15:10:53 -0700 (PDT)
Return-Path: <denomina...@gmail.com>
Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182])
by gmr-mx.google.com with ESMTPS id gv6si239211igb.0.2012.09.07.15.10.53
(version=TLSv1/SSLv3 cipher=OTHER);
Fri, 07 Sep 2012 15:10:53 -0700 (PDT)
Received-SPF: pass (google.com: domain of denomina...@gmail.com designates 209.85.214.182 as permitted sender) client-ip=209.85.214.182;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of denomina...@gmail.com designates 209.85.214.182 as permitted sender) smtp.mail=denomina...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-ob0-f182.google.com with SMTP id un3so155768obb.13
for <hackerspace_brisbane@googlegroups.com>; Fri, 07 Sep 2012 15:10:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=7iv1alSwMiBJ+9q40yi1VIOuqONO31hGcO/3wTvCj9s=;
b=GbUZuOHnRsWYGAfYKUxD3MnaIo61951n4rN4GI705iW4NBBdgYrIk83RS4bN/0r7Vq
HnFAdFBS1FL9zY1fDvDOgFY/6L4nCYN5cKWkA64oAgp5RwYrmMYV2Ez8AHj91WxOEAGh
ug73q5+T/G586VvAE+O6ylTMF9l7OTAWzAZOaj20pXt4p6e64pUbixJ3QvPLd6QeYz5g
NM54LTE9vAZS74yWvbRG/Gz+5q1sYe0Cqi4iVtzOMXK7n4sVUGExD1eva2AXERWkR4Dm
lEiLM5LhDbFv68wCuEvYv9OKzu/DlDZ8/ltr0dWGelQ4pStcOlQ7SP7nWM78aSjzbA3l
PAlg==
MIME-Version: 1.0
Received: by 10.60.171.109 with SMTP id at13mr7707822oec.79.1347055853516;
Fri, 07 Sep 2012 15:10:53 -0700 (PDT)
Received: by 10.76.151.99 with HTTP; Fri, 7 Sep 2012 15:10:53 -0700 (PDT)
In-Reply-To: <CAPYd8Gt0QgV45HOX+DORr7DsL7A7fApumu+cX5Q8J_fwrQn...@mail.gmail.com>
References: <CANnr-csVKMsAPxQn4PLTSj_owHpqs6p0ARZodbHfFAkmdEc...@mail.gmail.com>
<CACL3eKB8syEAdHbaXKVbJyKSstGzufMv_5qL_uy+XS+XEu4...@mail.gmail.com>
<CANnr-cs0-ioCr2T5SGcAtRQibFz8OQ5opdqobCtz44Hjeb2...@mail.gmail.com>
<CAPYd8Gt0QgV45HOX+DORr7DsL7A7fApumu+cX5Q8J_fwrQn...@mail.gmail.com>
Date: Sat, 8 Sep 2012 08:10:53 +1000
Message-ID: <CA+w-GAb-7B-EVGFeUnLb4VSaLMdOVozLEn9nsG0cjaYNSDt...@mail.gmail.com>
Subject: Re: Are servo control pulses the same as rotary encoder output?
From: Jimmy Bowler <denomina...@gmail.com>
To: hackerspace_brisbane@googlegroups.com
Content-Type: multipart/alternative; boundary=bcaec54b53d4a4359704c923e14b
--bcaec54b53d4a4359704c923e14b
Content-Type: text/plain; charset=ISO-8859-1
Yeah a simple capacitor will smooth the output out and would work but would
be a pain to calculate correct size and it would drift depending on temp.
Also what is the range of your control voltages 0-9v is the likely one if
so you will need to use an op amp to get "full stick" operation. There are
some op amp library's for the arduino, Hayden and Brenden were playing with
an arduino and dac on tue night.
Jimmy
On Fri, Sep 7, 2012 at 3:27 PM, buzz <davidb...@gmail.com> wrote:
> Arduino's "analog outputs" are not actually analog outputs. they are PWM
> outputs. this is kinda like an analog output, if you put an
> appropriately sized capacitor on it to smoothe the output, but not
> entirely.
>
> http://arduino.cc/en/Reference/analogWrite
>
> Buzz.
>
>
> On 7 September 2012 15:23, Joel Byrnes <fatal.exception.occur...@gmail.com
> > wrote:
>
>> Thanks guys.
>>
>> The reason I asked was that I googled for how to output rotary encoding
>> from arduino, and found nothing at all which was surprising. Plenty on how
>> to read it, but not output it. So I decided it must be a lot simpler than I
>> thought it was. (apparently not, just no one wanted to do it)
>>
>> Not totally certain on the rotary encoder - we opened it up as someone
>> pushed too hard and broke some of the plastic which holds the wheel
>> centered, and someone said they looked like rotary encoders. By memory they
>> only had two leads though, so I guess they were just good quality pots.
>>
>> Therefore it would probably be the least invasive to just use analog
>> outputs.
>>
>> On Fri, Sep 7, 2012 at 1:01 PM, Triffid Hunter <triffid.hun...@gmail.com>wrote:
>>
>>> On Fri, Sep 7, 2012 at 11:48 AM, Joel Byrnes
>>> <fatal.exception.occur...@gmail.com> wrote:
>>> > Correct me if I'm wrong, but this is how I understand how the better
>>> > remote-control car interfaces work, for example steering:
>>> > you turn a knob, and a rotary encoder encodes the position as
>>> variable-width
>>> > pulses. These pulses and others are multiplexed over a frequency and
>>> > received at the car, where they are demultiplexed out to individual
>>> servo
>>> > connections and the servos turn to the appropriate position.
>>>
>>> Yep, that's how it goes, except the variable width pulses are
>>> generated in the transmitter circuitry (or possibly the receiver if
>>> it's a digital link), not by the encoder or potentiometer itself.
>>>
>>> > So is the servo output from an arduino (for example) the same as what a
>>> > rotary encoder outputs?
>>>
>>> No.
>>>
>>> Servos want a pulse between 1 and 2ms long, every 20ms. The width of
>>> the pulse determines position, ie 1.5ms = center, 1ms = full rotation
>>> one way, 2ms = full rotation the other way. The off time between
>>> pulses is not critical, but the servo won't respond properly if
>>> they're more than about 35-40ms apart. See
>>> http://www.seattlerobotics.org/encoder/200106/fig1.jpg
>>>
>>> Encoders put out a quadrature signal. This is two square waves 90
>>> degrees out of phase. When you turn the knob, the two signals roll
>>> through the pattern. At each edge, you can look at the polarity of the
>>> other signal to determine direction. See
>>>
>>> http://quantumdevices.files.wordpress.com/2010/02/optical-encoder-quadrature-1234.jpg
>>>
>>> > So if I wanted to control a servo on a remote control car from a
>>> computer,
>>> > over the existing remote, could I just open it up, remove the rotary
>>> encoder
>>> > and put in place the microcontroller output pin outputting the servo
>>> pulses?
>>> > Then it would send that signal and control the remote servo?
>>>
>>> The existing remote is far more likely to have standard potentiometers
>>> than a rotary encoder, in which case you could simply feed an analog
>>> signal. I dissected a hobbyking 6ch transmitter, it simply had
>>> potentiometers set up as dividers between 5v and 0v. The transmitter
>>> was basically a single chip, with no opportunity for following the
>>> signal as it's morphed into the final result.
>>>
>>> If you're certain that it has a rotary encoder, you can easily
>>> generate the required greycode with a simple state machine in your
>>> microcontroller.
>>>
>>> The best solution would be to tap into the radio and provide the
>>> pulses yourself.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "hackerspace_brisbane" group.
>>> To post to this group, send email to
>>> hackerspace_brisbane@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> hackerspace_brisbane+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/hackerspace_brisbane?hl=en.
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "hackerspace_brisbane" group.
>> To post to this group, send email to
>> hackerspace_brisbane@googlegroups.com.
>> To unsubscribe from this group, send email to
>> hackerspace_brisbane+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/hackerspace_brisbane?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "hackerspace_brisbane" group.
> To post to this group, send email to hackerspace_brisbane@googlegroups.com
> .
> To unsubscribe from this group, send email to
> hackerspace_brisbane+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hackerspace_brisbane?hl=en.
>
--bcaec54b53d4a4359704c923e14b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Yeah a simple capacitor will smooth the output out and would work but would=
be a pain to calculate correct size and it would drift depending on temp. =
Also what is the range of your control voltages 0-9v is the likely one if s=
o you will need to use an op amp to get "full stick" operation. T=
here are some op amp library's for the arduino, Hayden and Brenden were=
playing with an arduino and dac on tue night.<br>
<br>Jimmy<br><br><br><br><div class=3D"gmail_quote">On Fri, Sep 7, 2012 at =
3:27 PM, buzz <span dir=3D"ltr"><<a href=3D"mailto:davidb...@gmail.com" =
target=3D"_blank">davidb...@gmail.com</a>></span> wrote:<br><blockquote =
class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid=
;padding-left:1ex">
Arduino's "analog outputs" are not actually analog outputs.=
=A0 they are PWM outputs.=A0=A0=A0=A0=A0 this is kinda like an analog outpu=
t, if you put an appropriately sized capacitor on it to smoothe the output,=
but not entirely.=A0 <br>
<br><a href=3D"http://arduino.cc/en/Reference/analogWrite" target=3D"_blank=
">http://arduino.cc/en/Reference/analogWrite</a><span class=3D"HOEnZb"><fon=
t color=3D"#888888"><br><br>Buzz.</font></span><div class=3D"HOEnZb"><div c=
lass=3D"h5">
<br><br><div class=3D"gmail_quote">On 7 September 2012 15:23, Joel Byrnes <=
span dir=3D"ltr"><<a href=3D"mailto:fatal.exception.occur...@gmail.com" =
target=3D"_blank">fatal.exception.occur...@gmail.com</a>></span> wrote:<=
br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Thanks guys.=A0<div><br></div><div>The reaso=
n I asked was that I googled for how to output rotary encoding from arduino=
, and found nothing at all which was surprising. Plenty on how to read it, =
but not output it. So I decided it must be a lot simpler than I thought it =
was. (apparently not, just no one wanted to do it)</div>
<div><br></div><div>Not totally certain on the rotary encoder - we opened i=
t up as someone pushed too hard and broke some of the plastic which holds t=
he wheel centered, and someone said they looked like rotary encoders. By me=
mory they only had two leads though, so I guess they were just good quality=
pots.=A0</div>
<div><br></div><div>Therefore it would probably be the least invasive to ju=
st use analog outputs.=A0</div><div><div><div><br><div class=3D"gmail_quote=
">On Fri, Sep 7, 2012 at 1:01 PM, Triffid Hunter <span dir=3D"ltr"><<a h=
ref=3D"mailto:triffid.hun...@gmail.com" target=3D"_blank">triffid.hunter@gm=
ail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>On Fri, Sep 7, 2012 at 11:48 AM, Joel B=
yrnes<br>
<<a href=3D"mailto:fatal.exception.occur...@gmail.com" target=3D"_blank"=
>fatal.exception.occur...@gmail.com</a>> wrote:<br>
> Correct me if I'm wrong, but this is how I understand how the bett=
er<br>
> remote-control car interfaces work, for example steering:<br>
> you turn a knob, and a rotary encoder encodes the position as variable=
-width<br>
> pulses. These pulses and others are multiplexed over a frequency and<b=
r>
> received at the car, where they are demultiplexed out to individual se=
rvo<br>
> connections and the servos turn to the appropriate position.<br>
<br>
</div>Yep, that's how it goes, except the variable width pulses are<br>
generated in the transmitter circuitry (or possibly the receiver if<br>
it's a digital link), not by the encoder or potentiometer itself.<br>
<div><br>
> So is the servo output from an arduino (for example) the same as what =
a<br>
> rotary encoder outputs?<br>
<br>
</div>No.<br>
<br>
Servos want a pulse between 1 and 2ms long, every 20ms. The width of<br>
the pulse determines position, ie 1.5ms =3D center, 1ms =3D full rotation<b=
r>
one way, 2ms =3D full rotation the other way. The off time between<br>
pulses is not critical, but the servo won't respond properly if<br>
they're more than about 35-40ms apart. See<br>
<a href=3D"http://www.seattlerobotics.org/encoder/200106/fig1.jpg" target=
=3D"_blank">http://www.seattlerobotics.org/encoder/200106/fig1.jpg</a><br>
<br>
Encoders put out a quadrature signal. This is two square waves 90<br>
degrees out of phase. When you turn the knob, the two signals roll<br>
through the pattern. At each edge, you can look at the polarity of the<br>
other signal to determine direction. See<br>
<a href=3D"http://quantumdevices.files.wordpress.com/2010/02/optical-encode=
r-quadrature-1234.jpg" target=3D"_blank">http://quantumdevices.files.wordpr=
ess.com/2010/02/optical-encoder-quadrature-1234.jpg</a><br>
<div><br>
> So if I wanted to control a servo on a remote control car from a compu=
ter,<br>
> over the existing remote, could I just open it up, remove the rotary e=
ncoder<br>
> and put in place the microcontroller output pin outputting the servo p=
ulses?<br>
> Then it would send that signal and control the remote servo?<br>
<br>
</div>The existing remote is far more likely to have standard potentiometer=
s<br>
than a rotary encoder, in which case you could simply feed an analog<br>
signal. I dissected a hobbyking 6ch transmitter, it simply had<br>
potentiometers set up as dividers between 5v and 0v. The transmitter<br>
was basically a single chip, with no opportunity for following the<br>
signal as it's morphed into the final result.<br>
<br>
If you're certain that it has a rotary encoder, you can easily<br>
generate the required greycode with a simple state machine in your<br>
microcontroller.<br>
<br>
The best solution would be to tap into the radio and provide the<br>
pulses yourself.<br>
<div><div><br>
--<br>
You received this message because you are subscribed to the Google Groups &=
quot;hackerspace_brisbane" group.<br>
To post to this group, send email to <a href=3D"mailto:hackerspace_brisbane=
@googlegroups.com" target=3D"_blank">hackerspace_brisbane@googlegroups.com<=
/a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:hackerspace=
_brisbane%2Bunsubscribe@googlegroups.com" target=3D"_blank">hackerspace_bri=
sbane+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/hackerspace_brisbane?hl=3Den" target=3D"_blank">http://groups.google.c=
om/group/hackerspace_brisbane?hl=3Den</a>.<br>
<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;hackerspace_brisbane" group.<br>
To post to this group, send email to <a href=3D"mailto:hackerspace_brisbane=
@googlegroups.com" target=3D"_blank">hackerspace_brisbane@googlegroups.com<=
/a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:hackerspace=
_brisbane%2Bunsubscribe@googlegroups.com" target=3D"_blank">hackerspace_bri=
sbane+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/hackerspace_brisbane?hl=3Den" target=3D"_blank">http://groups.google.c=
om/group/hackerspace_brisbane?hl=3Den</a>.<br>
</div></div></blockquote></div><br>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;hackerspace_brisbane" group.<br>
To post to this group, send email to <a href=3D"mailto:hackerspace_brisbane=
@googlegroups.com" target=3D"_blank">hackerspace_brisbane@googlegroups.com<=
/a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:hackerspace=
_brisbane%2Bunsubscribe@googlegroups.com" target=3D"_blank">hackerspace_bri=
sbane+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/hackerspace_brisbane?hl=3Den" target=3D"_blank">http://groups.google.c=
om/group/hackerspace_brisbane?hl=3Den</a>.<br>
</div></div></blockquote></div><br>
--bcaec54b53d4a4359704c923e14b--