Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Program not seeing sensor. (http://www.chiefdelphi.com/forums/showthread.php?t=144970)

IndySam 29-02-2016 18:19

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?

virtuald 29-02-2016 18:51

Re: Program not seeing sensor.
 
Quote:

Originally Posted by IndySam (Post 1549202)
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. :)

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.

Alan Anderson 29-02-2016 20:12

Re: Program not seeing sensor.
 
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.

Ether 29-02-2016 20:25

Re: Program not seeing sensor.
 

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?



IndySam 29-02-2016 21:53

Re: Program not seeing sensor.
 
Quote:

Originally Posted by Ether (Post 1549268)

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.

Ether 29-02-2016 22:12

Re: Program not seeing sensor.
 
Quote:

Originally Posted by Ether (Post 1549268)
What model encoder Hall sensor are you using, how do you have it mounted, and what is it detecting?

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

Quote:

Originally Posted by IndySam (Post 1549295)
It is detecting the passing of a magnet of our shooter...

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



IndySam 29-02-2016 22:21

Re: Program not seeing sensor.
 
Quote:

Originally Posted by Ether (Post 1549302)
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.


All times are GMT -5. The time now is 00:41.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi