How's this sound. Two 100 watt bulbs inside reflectors. One mounted close to the beginning of the maze and the other at the end of the maze. I think I could get a standard photocell to detect the difference between that light intensity and ambient room level. The rule for the PIC would be, "See the light, TOGGLE."
Here's the spec for the PHILMORE photocell 10807:
What do you think? I have the 10807's. I think I need to experiment. An old fashioned Triplett multimeter should to the trick."A typical use is for switching on lighting after dark. These are also used in alarm systems, exposure meters, flame detectors, opto-couplers etc. This cell has a dark resistance of 5,000 ohms and 300 ohms in bright light (100 cds. or more)."
If this technique were used in my car an emergency TOGGLE device would be a powerful flashlight.
On the old subject of oscillations. These were oscillations in the motion of the car. They were caused by my not correctly selecting the thresholds on the SRF05 proximity detectors. I felt I solved that.
The idea of a WHILE WEND loop is a good one. I sort of do that already. The PIC triggers the SRF05's many many times per second. My car continues to do one thing until the three echo pattern changes, then it does something else. If there is a bit of noise in one set of readings, it is smoothed over by the next set coming in a few milliseconds. I do not have an error signal.
When I first read Ioannis' PID suggestion I thought of a PID system based on position of the servo. My mistake. He is really suggesting that I devise an error signal to minimize. I gotta think more about that.
Ken
Bookmarks