Please help, I am a relatively new mentor, minimum experience with LABView and sensors
My team is using a fisher Price motor, connected to 5/8 inch shaft to operate an extension arm.
Extension Arm is a tube inside tube type design, they indicated they can not put limit switches to
determine if at the required extension length. They put approx 1/8 inch reflective tape on shaft and
are using Banker? QS18V6LV light sensor.
They are using LAB view. The sensor is connected the digital side card. The motor and sensor digitial input is assigned / ref num in Begin. In Teleop, the digital input refnum is wired to the digital get VI. We are using a counter, every time Digital input goes low, set low Boolean flag, when goes hi, if Boolean low flag set, increment counter then set flag to high (only add when sensor went low then high). We manually turned motor sensor/counter code worked fine. When ran motor at full speed, counter did not work. When we slow the motor down, counter worked.
At this point, we commented out the counter code and only put a Boolean LED on teleop front panel to blink every time shaft tape pass sensor. Note: Mainly the only code left is the Robot Main Code, I wanted to minimize user code being caught in any loops as possible problem. When slow, Boolean LED blink fine, correlated with the sensor LED blinking. When increase motor speed, Boolean LED looks like it would skip some flashes, but LED on sensor looked OK, did not skip. It is acting like the motor speed is going too fast for LABView to detect the sensor properly. I am surprised how slow we had to go to get it to work.
I am at a loss of how to help this team if the code can not keep up with the speed of the motor/light sensor.
Any ideals what problem is? Did any one face this problem before?
If there are any other ideals of how to keep track of this type of extension arm (they are using three extension lengths, default fully retracted, extension length 1 (middle pegs) and extension length 2 (highest pegs)) I will also like to disable motor if students trying to retract while arm fully retracted and disable motors if student tries to extend when max extension required is met. I was hoping if the counter worked and correlated to extension are, I can do this in the code. FYI: They are going to use a POT for arm angle, did not get that far.
Thanx for support
Mark