Shop OBEX P1 Docs P2 Docs Learn Events
BS1 Application advice - Page 2 — Parallax Forums

BS1 Application advice

2»

Comments

  • ssandessande Posts: 23
    edited 2012-02-21 06:08
    Quick update. I have the opto coupler wired up and created a quick program that reads the sensor as the rotor spins. I am accumulating the high and low time for each full revolution and calcualting the % of the time it is low (sensing a tooth on the rotor) for each full rotation. After a few hundred revolutions I will analyze the data to see what kind of variation I see. This will allow me to create a formula to calculate the RPM based on only the low time the sensor reads as each tooth passes. Since the sample time is very short, the RPM values may vary considerably. The RPM is really just informational during the debug process. The final program will compare the ratio of the actual "tooth" times recorded for the highest accuracy. Still kind of neat though to see how the sensor rotor design, pickup area of the sensor, and optocoupler all affect the final times recorded.

    Scott
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2012-02-21 08:59
    Example: Let's say that a transistor (not the 2N2222 in this example) has:
    Vbefwd = 1.2V
    Ibsat = 800mA

    Paul

    Paul,

    Coming into this a bit late, but did you mean ICSAT = 800mA here? IBSAT will be much less than that. It looks like you have the math later correct, but I wanted to make sure that anyone following up doesn't get confused.
  • ssandessande Posts: 23
    edited 2012-03-07 11:49
    A quick question regaring the Pulsin command. I am trying to read a sensor rotor (both high and low state) and do not know how the BS1 would react to the following code when reading the rotor:

    PULSIN 6, 1, TIME ' Sensor1 high input time.
    PULSIN 6, 0, TIME2 ' Sensor1 low input time.

    Would it read two adjacent locations (shown in red), or likely skip a reading (shown in blue)? Sorry, the picture probably describes this better than what I typed.

    New Picture.jpg
    538 x 487 - 19K
Sign In or Register to comment.