Go to Post Mistakes happen. It's how we react to them and what we learn from them that shows what type of people we are. - Daniel_LaFleur [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-02-2016, 18:19
IndySam's Avatar
IndySam IndySam is offline
Registered User
FRC #0829 (Digital Goats)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Indy
Posts: 3,362
IndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond repute
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?
__________________
"Champions are champions not because they do anything extraordinary but because they do the ordinary things better than anyone else." —Chuck Knoll


2015 Indianapolis District Winner
2014 Boilermaker Regional Industrial Design Award
2013 Smoky Mountain Regional Industrial Design Award
2012 Boilermaker Engineering Excellence Award
2010 Boilermaker Rockwell Innovation in Control Award.
2009 Buckeye J&J Gracious Professionalism Award
2009 Boilermaker J&J Gracious Professionalism Award
2008 Boilermaker J&J Gracious Professionalism Award
2007 St Louis Regional Winners
  #2   Spotlight this post!  
Unread 29-02-2016, 18:51
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,102
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Program not seeing sensor.

Quote:
Originally Posted by IndySam View Post
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.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #3   Spotlight this post!  
Unread 29-02-2016, 20:12
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
  #4   Spotlight this post!  
Unread 29-02-2016, 20:25
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
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?


  #5   Spotlight this post!  
Unread 29-02-2016, 21:53
IndySam's Avatar
IndySam IndySam is offline
Registered User
FRC #0829 (Digital Goats)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Indy
Posts: 3,362
IndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond repute
Re: Program not seeing sensor.

Quote:
Originally Posted by Ether View Post

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.
__________________
"Champions are champions not because they do anything extraordinary but because they do the ordinary things better than anyone else." —Chuck Knoll


2015 Indianapolis District Winner
2014 Boilermaker Regional Industrial Design Award
2013 Smoky Mountain Regional Industrial Design Award
2012 Boilermaker Engineering Excellence Award
2010 Boilermaker Rockwell Innovation in Control Award.
2009 Buckeye J&J Gracious Professionalism Award
2009 Boilermaker J&J Gracious Professionalism Award
2008 Boilermaker J&J Gracious Professionalism Award
2007 St Louis Regional Winners

Last edited by IndySam : 29-02-2016 at 21:56.
  #6   Spotlight this post!  
Unread 29-02-2016, 22:12
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Program not seeing sensor.

Quote:
Originally Posted by Ether View Post
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 View Post
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?


  #7   Spotlight this post!  
Unread 29-02-2016, 22:21
IndySam's Avatar
IndySam IndySam is offline
Registered User
FRC #0829 (Digital Goats)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Indy
Posts: 3,362
IndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond reputeIndySam has a reputation beyond repute
Re: Program not seeing sensor.

Quote:
Originally Posted by Ether View Post
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.
__________________
"Champions are champions not because they do anything extraordinary but because they do the ordinary things better than anyone else." —Chuck Knoll


2015 Indianapolis District Winner
2014 Boilermaker Regional Industrial Design Award
2013 Smoky Mountain Regional Industrial Design Award
2012 Boilermaker Engineering Excellence Award
2010 Boilermaker Rockwell Innovation in Control Award.
2009 Buckeye J&J Gracious Professionalism Award
2009 Boilermaker J&J Gracious Professionalism Award
2008 Boilermaker J&J Gracious Professionalism Award
2007 St Louis Regional Winners
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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