Shop OBEX P1 Docs P2 Docs Learn Events
high speed counter — Parallax Forums

high speed counter

cwyuzikcwyuzik Posts: 12
edited 2014-02-03 23:42 in Propeller 1
Hi,
I wonder if someone here could suggest the best propeller based way to count the number of rotations of a pulley running at aprox 600 rpm. The application I'm needing this for is for a motor control for a peristaltic pump. To dispense fluids accurately we need to know exactly how many times the pump pulley has turned.

I've looked at the quadature decoder application here in the obex but it seems like overkill as we don't need to know position or direction of rotation, just the number of revolutions. An un-elegant mechanical limit switch hooked up to an input may work for a while but would soon wear out.

The pulley gear will be 3d printed so any configuration of holes or slots through it is possible.

Thanks
Clare

Comments

  • jmgjmg Posts: 15,173
    edited 2014-01-28 11:22
    cwyuzik wrote: »
    I wonder if someone here could suggest the best propeller based way to count the number of rotations of a pulley running at aprox 600 rpm.
    I've looked at the quadature decoder application here in the obex but it seems like overkill as we don't need to know position or direction of rotation, just the number of revolutions. An un-elegant mechanical limit switch hooked up to an input may work for a while but would soon wear out.

    The pulley gear will be 3d printed so any configuration of holes or slots through it is possible.

    Wow, the luxury of 3D printing :)

    The Prop counters have a Pin-Edge-inc mode, so you can get a clean edge, and use that.
    Do you need to know fractions of a revolution ?
    As you say, mechanical is the worse choice, but it is simple. (A SPCO microswitch can give a clean edge, with care.)
    Next simplest would be a magnet + reed, but that also has life limits.

    Then you can go HALL, or Opto, and with your own printing, a slotted interrupter would seem simple.
    A schmitt / opto-logic form of opto coupler will give clean edges if well shielded.

    Since you have 3D printing, and fractional revs could be useful, you could also look at Single Track Gray Codes.
    (http://en.wikipedia.org/wiki/Gray_code#Single-track_Gray_code)

    This is a variant on absolute encoding, where one a single track or slot in your case, is needed
    - and there are variants which tune for evenly spaced heads, or heads grouped to one half of a circle.

    Or with the luxury of 3D printing, you could maybe use dual special tracks, and cluster the sensors more, if that helps assembly.

    I see in my notes I found TCST5250, which is a nice deep-groove right angle opto-interrupter. (needs external schmitt)
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-01-28 11:37
    I'd still go with a quadrature encoder object, though I wouldn't use the standard in ObEx that is setup to allow every available pin. I wrote my own for a three-axis motor control project (camera platform). Using the encoder and a secondary cog, we are able to control speed very precisely, including ramping up and down on moves. This process may be useful in accurate dispensing.
  • r.daneelr.daneel Posts: 96
    edited 2014-01-28 22:16
    I recently helped a friend with a school project he was working on. He was simulating a reciprocating engine using 4 push/pull solenoids (can't remember which) connected to a crankshaft - the idea being that as each solenoid pushed (or pulled) it would push (or pull) the crank around by a 1/4 turn. I just glued a circular piece of bright white cardboard to the end of the crankshaft and coloured opposite quarters in black, then attached an IR LED and IR receiver (actually one of Parallax's QTI sensors) to watch the black/white edges go by. Each time I saw a colour change I'd fire the right solenoid. It worked a treat - we tested it up to about 8k rpm (didn't want to go too much further in case the solenoids started bouncing). You might want to do something a little more professional than a piece of hand-cut and coloured cardboard, but the general idea is sound.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-01-28 22:19
    I agree with JonnyMac: use a quadrature encoder. The reason is that it prevents multiple extraneous counts due to motion jitter or backlash near the transition edges.

    -Phil
  • jmgjmg Posts: 15,173
    edited 2014-01-28 23:52
    cwyuzik wrote: »
    The pulley gear will be 3d printed so any configuration of holes or slots through it is possible.

    To clarify this, if you use the Quad mode, in order to get the natural debounce/chatter suppression Phil mentions, you will need 2 sensors and some suitable slot pitch. Usually that would be mechanical strength determined, and likely rounded to 2^n, as you can easily scale down to whole number revolutions ( if whole revs is really what you need).

    Alternatively, if there is a scale factor of milliitres/rpm, you could chose any whole number of slots to better fit that value.
  • ErlendErlend Posts: 612
    edited 2014-01-28 23:54
    What is driving the pump? Is there a way you could tap into the driver motor and get a speed/frequency signal. Unless it is an asychronous motor that should be feasible. Even a DC motor would generate a useful ripple.

    Erlend
  • cwyuzikcwyuzik Posts: 12
    edited 2014-02-03 23:42
    Erlend wrote: »
    What is driving the pump? Is there a way you could tap into the driver motor and get a speed/frequency signal. Unless it is an asychronous motor that should be feasible. Even a DC motor would generate a useful ripple.

    Erlend

    Using a single phase 1/2hp motor salvaged from an older style automatic washer. The motor comes with a clutch which will soften the initial start up torque so measuring rotations at the motor isn't a viable option.

    So looks like the quadrature encoder may be the best solution after all.

    Thanks all for your help and suggestions.
    Clare
Sign In or Register to comment.