Program not seeing sensor.

We have a hall effect sensor on a mechanism. The program doesn’t always see the sensor (so my programmers tell me) so the mechanism doesn’t stop. Knowing nothing about programming, I have been told the API isn’t fast enough and not seeing it. We program in JAVA. I know the sensor is working, I have filmed it.

Are they correct or blowing smoke? What do you think?

If they are polling the value (probable), it’s possible that they’re not polling fast enough to see the input change, particularly if the signal is only there for a short period of time if your mechanism is moving very quickly. In that case, polling isn’t a good solution because you’ll end up with issues such as you have now. :slight_smile:

However, the FPGA has an interrupt mechanism that you can use to be notified of state changes for signals. See the InterruptableSignalBase of DigitalInput for more details – in particular, the asynchronous version of requestInterrupts.

There is another option for detecting a momentary sensor switch that might be too fast for a polling solution. Instead of opening it as a switch, open it as a counter. That way the FPGA will notice the switch event for you even when you’re not looking, and you can watch for a change in the count at whatever rate makes sense.

*The 2016 FPGA samples I/O at 40MHz. That’s every 25ns. That should be fast enough for just about anything in FRC,

However, if you have the Hall sensor mounted near the circumference of a large diameter wheel, I suppose it’s possible that the pickup is whizzing by so fast that the electronics in the sensor don’t respond to it.

What model encoder are you using, how do you have it mounted, and what is it detecting?

It is detecting the passing of a magnet of our shooter. In slow mode (when it is needed) JVN calc estimates 28 in/s, probably actually less that 20. I videod the sensor in slow motion on my iPhone and you can see the sensor light going out.

Arghh. I typed “encoder” but meant “Hall sensor”. What model Hall sensor are you using? I’d like to pull the data sheet.

Could I persuade you to post a picture, showing the sensor and the magnet?

It is an AndyMark Hall effect sensor. The magnet is from West Coast Products.

I don’t have any picks and won’t be near the robot for a couple days.