Shop OBEX P1 Docs P2 Docs Learn Events
TestFrequencyResponse.bs2 — Parallax Forums

TestFrequencyResponse.bs2

overlordxoverlordx Posts: 3
edited 2008-04-16 14:26 in BASIC Stamp
I am consistantly getting fewer "yes" readings from the left sensor (p11)·than the right sensor (p14).· I have run the porgram on 2 different SumoBots, moved the bots, changed the sensors and transmitters from one side to the other, and tried using different ir sensors and transmitters in the p4, p11, p15 and p14 locations.· Why are my bots getting consistently fewer detections on the left (p4/p11) side?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-16 03:38
    It's certainly impossible to tell from the information you've provided. You've tried some important changes to try to sort out the "problem". By switching SumoBots and swapping detectors and emitters, you've pretty well eliminated the hardware as the source of your asymmetry, so it must be your program (which you have not supplied) with a smaller possibility of some kind of IR reflectivity asymmetry in the environment around the SumoBot. A small misalignment of the IR emitter relative to the IR detector can cause an apparent loss of sensitivity (as described in the SumoBot manual).

    Post Edited (Mike Green) : 4/16/2008 3:48:04 AM GMT
  • overlordxoverlordx Posts: 3
    edited 2008-04-16 13:22
    I do not think my problem is related to the environment. I have tried changing ambient illumination levels, different surfaces at varying distances from the sensor/emitter arrays. I am not sure whether alignment is a problem. I tried slightly turning the SumoBot at different angles to the reflective surface. The left side was still consistently less sensitive.

    Here is my code. It is a variation of the code on pp. 93 - 94 in Applied Robotics with the SumoBot.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    'Constants
    IR_R_Beam PIN 15
    IR_R_Det PIN 14
    IR_L_Beam PIN 4
    IR_L_Det PIN 11
    IRFREQ CON 20000
    INCREMENT CON 500

    'Vaiarbles
    frequency VAR Word
    irLF VAR Bit
    irRF VAR Bit

    'Program code
    Main:
    DO
    DEBUG HOME
    DEBUG CLS
    DEBUG "Front IR Detectors", CR, CR
    DEBUG "Frequency Left Right", CR
    DEBUG "
    ----
    ", CR

    FOR frequency = IRFREQ TO (IRFREQ + (INCREMENT * 20)) STEP INCREMENT
    FREQOUT IR_L_Beam, 1, frequency
    irLF = ~IR_L_Det
    FREQOUT IR_R_Beam, 1, frequency
    irRF = ~IR_R_Det
    GOSUB Debug_Output
    NEXT

    PAUSE 2500

    LOOP
    END

    'Subroutines

    Debug_Output:
    DEBUG CR, DEC frequency, CRSRX, 13
    IF irLF = 1 THEN DEBUG "yes" ELSE DEBUG "no"
    DEBUG CRSRX, 20
    IF irRF = 1 THEN DEBUG "yes" ELSE DEBUG "no"
    RETURN
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-16 13:40
    You might try putting a short pause (PAUSE 5) just before the second FREQOUT. The Right detector may be triggered or partially triggered by the Left emitter and doesn't have a chance to recover before the Right emitter is turned on. That would affect the sensitivity to the Right emitter.
  • overlordxoverlordx Posts: 3
    edited 2008-04-16 14:26
    There was no change when I tried pauses of 5, 25, and 50. There was still no change when I repeated the tests using the pauses with and without the "led hoods".

    The right is consistently more sensitive. For example, the right will detect 23khz to 29khz and left will only begin at 25khz. These frequency differences exist at other ranges as well. For example, at 37khz both get a signal. However, the left drops off at 40.5khz and the right at 42.5khz. I do not know if this is significant, but there is a 2khz difference in sensitivity at both ranges.

    Figure 3-2, Applied Robotics with the SumoBot, does not show any resistors or other components on the IR Detector circuit, and I removed everything from the breadboard.

    I'm stumped!
Sign In or Register to comment.