Shop OBEX P1 Docs P2 Docs Learn Events
Tachometer using boe bot encoder — Parallax Forums

Tachometer using boe bot encoder

mmor101mmor101 Posts: 8
edited 2006-03-25 00:22 in BASIC Stamp
I'm trying to use a boe bot encoder sensor for a tachometer. It will be for a small r/c nitro engine. I'm going to have some reflective tape on the flywheel of the engine for the encoder to read. These engines can spin up to 30,000rpms. I'm having trouble coming up with a program for this, I need some help. I will just be using the debug window, no lcd.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2006-03-23 18:40
    Which stamp are you talking about? 30,000 rpm would be too fast for some of them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • mmor101mmor101 Posts: 8
    edited 2006-03-23 18:44
    BS2
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-23 19:00
    You would use the COUNT instruction, look in the Basic Stamp Manual for a description of it's use. At 30,000 rpms, that would indicate 1 cycle in 33.3 µS, the minimum pulse width for a BS2 is 4.16µS. At 33.3µS that coresponds to 12.48 % of the flywheel the reflective strip must cover, or 45 degrees. So this means a 1/8th pie of the wheel should have relective tape on it in order for the stamp to be able to measure the reflected pulse. The period you specify should be long enough to count a few rotations at the flywheels slowest rotation, while keeping the count small enough to fit into 16 bits (65536) at it's fastest speed. I would think a period of 100 (1/10th a second) should be a fairly good number to choose. You would take the number returned by COUNT, multiply it by 10 and display it using debug.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 3/23/2006 9:04:30 PM GMT
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-03-24 19:12
    Paul, you make it all sound just so... so... simple...
    Yeah, in reality it is simple, but you cover the math like everyone should know it, and I'm sorry to say, I don't.
    Could you please explain ho you got to 1/8 of the flywheel needed to be covered with the tape.
    I understand the division and how you got to 33.3 us..
    I understand the min pulse width is 4.16 us (from the manual)...
    Where I lose it is how you take 33.3 uS and convert it to 12.48% of the flywheel.

    I'm not knock, just tryin how you got to that figure, sometimes the math just eludes me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-03-25 00:22
    No problem, I do tend to make leaps when providing answers. Since the minimum pulse width is 4.16 uS and a rotation of the flywheel happens once every 33.3uS, the reflective tape must cover a pie shape on the flywheel that corresponds to 4.16uS during that 33.3uS, which turns out to be a 12.49% duty cycle (4.16uS/33.3uS). Multiplying the duty cycle by the degrees in a circle we get almost 45 degrees (.1249 x 360), or a 1/8 pie slice of the flywheel. If I were to try this myself, I would cover 1/4 of the flywheel with reflective tape (90 degrees) just to make absolutely sure that the pulse width will be measurable by the stamp's COUNT function (ie a fudge factor to gaurentee a readable result).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
Sign In or Register to comment.