Shop OBEX P1 Docs P2 Docs Learn Events
sensor chatter — Parallax Forums

sensor chatter

ArchiverArchiver Posts: 46,084
edited 2002-01-17 21:14 in General Discussion
Hello,

I'm using radio shack digital ir detectors to control a small robot.
I need to have it maneuver fairly tight clearances, and therefore
sense tight clearances.

Here is my problem:

I'm creating my IR pulses with a PAK8 co processor, it makes much
more precise pulses than the stamp can. When using a stamp to create
the transmitter frequency, the variating high's and low's of each
pulse apperently "confuse the detector", and therefore it decides to
hold it's output state longer, making for a more stable reading.

With the pack8's precision, I have chatter like crazy, this could
sende my robot into a dance. Since i only have an inch or two
clearance on either side of it, i'm asking for sugestions on how I
can eliminate chatter as simply and cheaply as possible.

thanks in advance

Chris

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-01-15 21:56
    > I'm creating my IR pulses with a PAK8 co processor, it makes much
    > more precise pulses than the stamp can. When using a stamp to create
    > the transmitter frequency, the variating high's and low's of each
    > pulse apperently "confuse the detector", and therefore it decides to
    > hold it's output state longer, making for a more stable reading.
    >
    > With the pack8's precision, I have chatter like crazy, this could
    > sende my robot into a dance. Since i only have an inch or two
    > clearance on either side of it, i'm asking for sugestions on how I
    > can eliminate chatter as simply and cheaply as possible.


    I'm not sure this is correct. The Stamp and the PAK both use ceramic
    resonators, so they should be about the same precision-wise. I would
    more suspect that the 50MHz clock on the PAK is interfering with the
    detector and making it chatter. Do you have a .1uF capacitor across the
    detector's power right at the detector? You might also try putting a cap
    on the detector's output to stop "fast" pulses that are common with
    these detectors.

    Are you on a solderless breadboard? Remember, these are big capacitors,
    so the noise from the 50MHz oscillator will spread easily and you have
    to have especially careful bypassing.

    Al Williams
    AWC
    * Easy RS-232 Prototyping
    http://www.al-williams.com/awce/rs1.htm
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-16 08:43
    The stamp creates a high pulse by sending alot of
    little, unevenly spaced pulses as I understand,
    whereas the pak doesn't?

    If I pulse my servos via pulseout i'd have to
    recalibrate all my servos as their center would be
    really far off, it really seems like the pak is more
    precise in that respect, resonator aside.

    I am still currently on a solderless breadboard at
    this stage, i'll be transferring to pcb very soon. I
    have a .1uf cap across power for the detector and
    tried switching it to go across output/ground yet that
    seemed to make little difference. The resonator is
    wired to it's own bus which the pak and stamp both
    share and that's filtered using a few caps, (what size
    caps are commonly used for filtering a five volt
    supply in this manner, i just stuck in what i could
    find....47uf i think).

    By playing with resistor values inline with both the
    transmitters and the output of the detector i was able
    to adjust ....somewhat close enough for the range i
    need, and chatter is no longer a problem if they are
    both pointing straight out to space. It will still
    begin to chatter from say six inches away, and i'll
    get a solide reading at about one inch from it. I'm
    thinking of implementing comparators, and if i do that
    i may as well modify my detectors to read analog wich
    also brings their range down to something i can really
    use. Any sugestions are most welcome.

    I'd like to thank you for all your help Al, pak8 is
    controlling all my IR and four servo's on a 5us
    prescale, works excellent.
    --- Al Williams <alw@a...> wrote:
    > > I'm creating my IR pulses with a PAK8 co
    > processor, it makes much
    > > more precise pulses than the stamp can. When using
    > a stamp to create
    > > the transmitter frequency, the variating high's
    > and low's of each
    > > pulse apperently "confuse the detector", and
    > therefore it decides to
    > > hold it's output state longer, making for a more
    > stable reading.
    > >
    > > With the pack8's precision, I have chatter like
    > crazy, this could
    > > sende my robot into a dance. Since i only have an
    > inch or two
    > > clearance on either side of it, i'm asking for
    > sugestions on how I
    > > can eliminate chatter as simply and cheaply as
    > possible.
    >
    >
    > I'm not sure this is correct. The Stamp and the PAK
    > both use ceramic
    > resonators, so they should be about the same
    > precision-wise. I would
    > more suspect that the 50MHz clock on the PAK is
    > interfering with the
    > detector and making it chatter. Do you have a .1uF
    > capacitor across the
    > detector's power right at the detector? You might
    > also try putting a cap
    > on the detector's output to stop "fast" pulses that
    > are common with
    > these detectors.
    >
    > Are you on a solderless breadboard? Remember, these
    > are big capacitors,
    > so the noise from the 50MHz oscillator will spread
    > easily and you have
    > to have especially careful bypassing.
    >
    > Al Williams
    > AWC
    > * Easy RS-232 Prototyping
    > http://www.al-williams.com/awce/rs1.htm
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    ______________________________________________________________________
    Web-hosting solutions for home and business! http://website.yahoo.ca
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-16 13:21
    >
    > The stamp creates a high pulse by sending alot of
    > little, unevenly spaced pulses as I understand,
    > whereas the pak doesn't?

    The PWM and FREQOUT commands works like this. But PULSOUT should just
    make a solid pulse (just one pulse though). What are you using on the
    Stamp?

    >
    > If I pulse my servos via pulseout i'd have to
    > recalibrate all my servos as their center would be
    > really far off, it really seems like the pak is more
    > precise in that respect, resonator aside.
    >
    > I am still currently on a solderless breadboard at
    > this stage, i'll be transferring to pcb very soon. I
    > have a .1uf cap across power for the detector and
    > tried switching it to go across output/ground yet that
    > seemed to make little difference. The resonator is
    > wired to it's own bus which the pak and stamp both
    > share and that's filtered using a few caps, (what size
    > caps are commonly used for filtering a five volt
    > supply in this manner, i just stuck in what i could
    > find....47uf i think).
    >
    > By playing with resistor values inline with both the
    > transmitters and the output of the detector i was able to
    > adjust ....somewhat close enough for the range i need, and
    > chatter is no longer a problem if they are both pointing
    > straight out to space. It will still begin to chatter from
    > say six inches away, and i'll get a solide reading at about
    > one inch from it. I'm thinking of implementing comparators,
    > and if i do that i may as well modify my detectors to read
    > analog wich also brings their range down to something i can
    > really use. Any sugestions are most welcome.
    >
    > I'd like to thank you for all your help Al, pak8 is controlling all my

    > IR and four servo's on a 5us prescale, works excellent.

    How many outputs are you using on the PAK? Using more than 4 @ 5uS will
    cause problems because there isn't enough time to always service 5 or
    more outputs that fast (10uS works fine). I'm assuming you are driving
    all your servos from one output?
    Al Williams
    AWC
    * Easy RS-232 Prototyping
    http://www.al-williams.com/awce/rs1.htm
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-16 22:28
    I just initially tested the servo calibration using
    pulsout in a loop, the servos should have come
    pre-calibrated, however using pulsout, they were
    uncontrolable, therefore I recalibrated one of them.
    After which i recieved my pak8, found the three servos
    which still couldn't be centered with the stamp (and
    still at their pre-calibration settings) were
    perfectly centered using the pak, and the one that was
    now centered on the stamp needed to be calibrated yet
    again for use on the pak. freqout had the same
    results. That's why i came to the conclusion the pak
    is far more accurate. I haven't tested it on a scope
    but if i did i'm certain there would be some
    difference, at least enough of one to throw off
    servos.
    It would be interesting to compare them anyway.

    Maybe you could give me some pointers. I have a hard
    time calculating math for certain things. EX: I want
    to design a schmitt trigger using a 311 comparitor,
    power supply is 5, detectors go from say 2 something
    to 3 something, I need a voltage divider for the
    positive feedback, and I "think" another to set the
    voltage i want it to switch at. So i'll have one
    divider going into another. So after a bit more
    research i'll know all the values I'll need in the end
    but is there a simple way to figure out the resistor
    values for the dividers that will give me the ratios
    i'm after? or must it be a trial and error, plug a
    value in and crunch the numbers type of deal. yes i'm
    serious.

    --- Al Williams <alw@a...> wrote:
    >
    > >
    > > The stamp creates a high pulse by sending alot of
    > > little, unevenly spaced pulses as I understand,
    > > whereas the pak doesn't?
    >
    > The PWM and FREQOUT commands works like this. But
    > PULSOUT should just
    > make a solid pulse (just one pulse though). What are
    > you using on the
    > Stamp?
    >
    > >
    > > If I pulse my servos via pulseout i'd have to
    > > recalibrate all my servos as their center would be
    > > really far off, it really seems like the pak is
    > more
    > > precise in that respect, resonator aside.
    > >
    > > I am still currently on a solderless breadboard at
    > > this stage, i'll be transferring to pcb very soon.
    > I
    > > have a .1uf cap across power for the detector and
    > > tried switching it to go across output/ground yet
    > that
    > > seemed to make little difference. The resonator is
    > > wired to it's own bus which the pak and stamp both
    > > share and that's filtered using a few caps, (what
    > size
    > > caps are commonly used for filtering a five volt
    > > supply in this manner, i just stuck in what i
    > could
    > > find....47uf i think).
    > >
    > > By playing with resistor values inline with both
    > the
    > > transmitters and the output of the detector i was
    > able to
    > > adjust ....somewhat close enough for the range i
    > need, and
    > > chatter is no longer a problem if they are both
    > pointing
    > > straight out to space. It will still begin to
    > chatter from
    > > say six inches away, and i'll get a solide reading
    > at about
    > > one inch from it. I'm thinking of implementing
    > comparators,
    > > and if i do that i may as well modify my detectors
    > to read
    > > analog wich also brings their range down to
    > something i can
    > > really use. Any sugestions are most welcome.
    > >
    > > I'd like to thank you for all your help Al, pak8
    > is controlling all my
    >
    > > IR and four servo's on a 5us prescale, works
    > excellent.
    >
    > How many outputs are you using on the PAK? Using
    > more than 4 @ 5uS will
    > cause problems because there isn't enough time to
    > always service 5 or
    > more outputs that fast (10uS works fine). I'm
    > assuming you are driving
    > all your servos from one output?
    > Al Williams
    > AWC
    > * Easy RS-232 Prototyping
    > http://www.al-williams.com/awce/rs1.htm
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    ______________________________________________________________________
    Web-hosting solutions for home and business! http://website.yahoo.ca
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-16 22:57
    If I understand your question, you want to set up a comparator to trip
    at a certain voltage. This usually requires a voltage divider to set a
    trip point and then you feed the other voltage into the other comparator
    input. I'm not sure what you mean about two dividers. One thing to
    remember is that the divider only works when you have a very high input
    impedance. I'll show you why in a minute. However, you might also enjoy
    reading http://www.al-williams.com/wd5gnr/basiccir.htm.

    If you want to design instead of guessing at a voltage divider, you
    decide how much current you want the divider to draw. Say you have a 12V
    supply and you want a 1/3 divider. You'd like to draw, say 1mA through
    the divider. So the total resistance must be:

    .001 = 12/R or R=12K

    Now you want 4V out so the ratio is 1/3. So if the "bottom" resistor is
    R2 and the "top" resistor is R1 you want R2/(R1+R2)=1/3 or 3=(R1+R2)/R2
    or 3R2-R2 = R1 which of course is 2R2=R1. Right?

    So now you have two equations: 2R2=R1 and R1+R2=12K. You can probably
    make a good guess now, but if you like you can solve this
    mathematically. Subtracting R1=2R2 from the other equation gives you:
    R2=12K-2R2 or 3R2=12K or R2=12K/3 so R2=4K. Going back to R1+R2=12K and
    substituting 4K you can find out that R1 then is 8K.

    So 8K and 4K are the magic numbers. Just to be sure: 12 * 4K/(8K+4K) =
    4V. So that works.

    If you build this and look at it with a modern VOM (probably 10Mohm
    input) everything is fine. A comparator would be pretty good too since
    they have high input impedence. But humor me and pretend we are hooking
    up an A/D converter with a 10K input impedance. Oh oh. Now R2 is not 4K.
    It is 4K in parallel with 10K (about 2.9K). That throws the divider off
    by a massive amount (2.9K/(8K+2.9K)=.27 not .33). When your 4K is in
    parallel with 1 or 10M the error is small (4K in parallel with 1M is
    3.984K -- about .4% off.

    That's the problem with "ganging" dividers as you proposed. Picture a
    divider with resistors R1A and R2A that divides 1:3 (so we can keep our
    4K and 8K). Now, we want to split that voltage in half for some reason.
    Say we pick two 10K resistors to do that (R1B and R2B). This throws our
    first divider "off" because now instead of 4K, we have 4K in parallel
    with 20K (3.33K). So the first divider really "computes" 3.33/(8+3.33) =
    which is about .3, not .33. Then the 50/50 divider will cut that in
    half.

    So often, instead of designing a divider for current, the real question
    will be: what total resistance do I want. For example, if the second
    divider was very large in total resistance, this problem would be
    minimal (and, in fact, since 20K>>4K it isn't that bad).

    By the way, this gives you a intuitive feeling for why the maximum power
    transfer theorem works (read the Web page on Thevenin equivalents). But
    I've gone on too long as it is, so I'll leave that as an exercise to the
    reader.

    Al Williams
    AWC
    * Floating point A/D
    http://www.al-williams.com/awce/pak9.htm



    >
    Original Message
    > From: c bielek [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=iYeC0GbSCqJ8lHLrItzwoSvXn7gBJWiNEP_vnNwMWjOGZptWDxQWYuwzBHM3Q7pVM6hDf137]cbielek@y...[/url
    > Sent: Wednesday, January 16, 2002 4:29 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] sensor chatter
    >
    >
    > I just initially tested the servo calibration using
    > pulsout in a loop, the servos should have come pre-calibrated, however

    > using pulsout, they were uncontrolable, therefore I recalibrated one
    > of them. After which i recieved my pak8, found the three servos
    > which still couldn't be centered with the stamp (and
    > still at their pre-calibration settings) were
    > perfectly centered using the pak, and the one that was
    > now centered on the stamp needed to be calibrated yet
    > again for use on the pak. freqout had the same
    > results. That's why i came to the conclusion the pak
    > is far more accurate. I haven't tested it on a scope
    > but if i did i'm certain there would be some
    > difference, at least enough of one to throw off
    > servos.
    > It would be interesting to compare them anyway.
    >
    > Maybe you could give me some pointers. I have a hard
    > time calculating math for certain things. EX: I want
    > to design a schmitt trigger using a 311 comparitor,
    > power supply is 5, detectors go from say 2 something
    > to 3 something, I need a voltage divider for the
    > positive feedback, and I "think" another to set the
    > voltage i want it to switch at. So i'll have one
    > divider going into another. So after a bit more
    > research i'll know all the values I'll need in the end
    > but is there a simple way to figure out the resistor
    > values for the dividers that will give me the ratios
    > i'm after? or must it be a trial and error, plug a
    > value in and crunch the numbers type of deal. yes i'm serious.
    >
    > --- Al Williams <alw@a...> wrote:
    > >
    > > >
    > > > The stamp creates a high pulse by sending alot of
    > > > little, unevenly spaced pulses as I understand,
    > > > whereas the pak doesn't?
    > >
    > > The PWM and FREQOUT commands works like this. But
    > > PULSOUT should just
    > > make a solid pulse (just one pulse though). What are
    > > you using on the
    > > Stamp?
    > >
    > > >
    > > > If I pulse my servos via pulseout i'd have to
    > > > recalibrate all my servos as their center would be
    > > > really far off, it really seems like the pak is
    > > more
    > > > precise in that respect, resonator aside.
    > > >
    > > > I am still currently on a solderless breadboard at
    > > > this stage, i'll be transferring to pcb very soon.
    > > I
    > > > have a .1uf cap across power for the detector and
    > > > tried switching it to go across output/ground yet
    > > that
    > > > seemed to make little difference. The resonator is
    > > > wired to it's own bus which the pak and stamp both
    > > > share and that's filtered using a few caps, (what
    > > size
    > > > caps are commonly used for filtering a five volt
    > > > supply in this manner, i just stuck in what i
    > > could
    > > > find....47uf i think).
    > > >
    > > > By playing with resistor values inline with both
    > > the
    > > > transmitters and the output of the detector i was
    > > able to
    > > > adjust ....somewhat close enough for the range i
    > > need, and
    > > > chatter is no longer a problem if they are both
    > > pointing
    > > > straight out to space. It will still begin to
    > > chatter from
    > > > say six inches away, and i'll get a solide reading
    > > at about
    > > > one inch from it. I'm thinking of implementing
    > > comparators,
    > > > and if i do that i may as well modify my detectors
    > > to read
    > > > analog wich also brings their range down to
    > > something i can
    > > > really use. Any sugestions are most welcome.
    > > >
    > > > I'd like to thank you for all your help Al, pak8
    > > is controlling all my
    > >
    > > > IR and four servo's on a 5us prescale, works
    > > excellent.
    > >
    > > How many outputs are you using on the PAK? Using
    > > more than 4 @ 5uS will
    > > cause problems because there isn't enough time to
    > > always service 5 or
    > > more outputs that fast (10uS works fine). I'm
    > > assuming you are driving
    > > all your servos from one output?
    > > Al Williams
    > > AWC
    > > * Easy RS-232 Prototyping http://www.al-williams.com/awce/rs1.htm
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed.
    > > Text in the Subject and Body of the message will be
    > > ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > ______________________________________________________________
    > ________
    > Web-hosting solutions for home and business! http://website.yahoo.ca
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-17 21:14
    The Pak8 by your tests prove they have predictable and repeatable output
    results when controlling a servo. Thanks for your results.
    Steve
    Original Message
    From: "c bielek" <cbielek@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, January 16, 2002 2:28 PM
    Subject: RE: [noparse][[/noparse]basicstamps] sensor chatter


    > I just initially tested the servo calibration using
    > pulsout in a loop, the servos should have come
    > pre-calibrated, however using pulsout, they were
    > uncontrolable, therefore I recalibrated one of them.
    > After which i recieved my pak8, found the three servos
    > which still couldn't be centered with the stamp (and
    > still at their pre-calibration settings) were
    > perfectly centered using the pak, and the one that was
    > now centered on the stamp needed to be calibrated yet
    > again for use on the pak. freqout had the same
    > results. That's why i came to the conclusion the pak
    > is far more accurate. I haven't tested it on a scope
    > but if i did i'm certain there would be some
    > difference, at least enough of one to throw off
    > servos.
    > It would be interesting to compare them anyway.
    >
    > Maybe you could give me some pointers. I have a hard
    > time calculating math for certain things. EX: I want
    > to design a schmitt trigger using a 311 comparitor,
    > power supply is 5, detectors go from say 2 something
    > to 3 something, I need a voltage divider for the
    > positive feedback, and I "think" another to set the
    > voltage i want it to switch at. So i'll have one
    > divider going into another. So after a bit more
    > research i'll know all the values I'll need in the end
    > but is there a simple way to figure out the resistor
    > values for the dividers that will give me the ratios
    > i'm after? or must it be a trial and error, plug a
    > value in and crunch the numbers type of deal. yes i'm
    > serious.
    >
    > --- Al Williams <alw@a...> wrote:
    > >
    > > >
    > > > The stamp creates a high pulse by sending alot of
    > > > little, unevenly spaced pulses as I understand,
    > > > whereas the pak doesn't?
    > >
    > > The PWM and FREQOUT commands works like this. But
    > > PULSOUT should just
    > > make a solid pulse (just one pulse though). What are
    > > you using on the
    > > Stamp?
    > >
    > > >
    > > > If I pulse my servos via pulseout i'd have to
    > > > recalibrate all my servos as their center would be
    > > > really far off, it really seems like the pak is
    > > more
    > > > precise in that respect, resonator aside.
    > > >
    > > > I am still currently on a solderless breadboard at
    > > > this stage, i'll be transferring to pcb very soon.
    > > I
    > > > have a .1uf cap across power for the detector and
    > > > tried switching it to go across output/ground yet
    > > that
    > > > seemed to make little difference. The resonator is
    > > > wired to it's own bus which the pak and stamp both
    > > > share and that's filtered using a few caps, (what
    > > size
    > > > caps are commonly used for filtering a five volt
    > > > supply in this manner, i just stuck in what i
    > > could
    > > > find....47uf i think).
    > > >
    > > > By playing with resistor values inline with both
    > > the
    > > > transmitters and the output of the detector i was
    > > able to
    > > > adjust ....somewhat close enough for the range i
    > > need, and
    > > > chatter is no longer a problem if they are both
    > > pointing
    > > > straight out to space. It will still begin to
    > > chatter from
    > > > say six inches away, and i'll get a solide reading
    > > at about
    > > > one inch from it. I'm thinking of implementing
    > > comparators,
    > > > and if i do that i may as well modify my detectors
    > > to read
    > > > analog wich also brings their range down to
    > > something i can
    > > > really use. Any sugestions are most welcome.
    > > >
    > > > I'd like to thank you for all your help Al, pak8
    > > is controlling all my
    > >
    > > > IR and four servo's on a 5us prescale, works
    > > excellent.
    > >
    > > How many outputs are you using on the PAK? Using
    > > more than 4 @ 5uS will
    > > cause problems because there isn't enough time to
    > > always service 5 or
    > > more outputs that fast (10uS works fine). I'm
    > > assuming you are driving
    > > all your servos from one output?
    > > Al Williams
    > > AWC
    > > * Easy RS-232 Prototyping
    > > http://www.al-williams.com/awce/rs1.htm
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed.
    > > Text in the Subject and Body of the message will be
    > > ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > ______________________________________________________________________
    > Web-hosting solutions for home and business! http://website.yahoo.ca
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
Sign In or Register to comment.