Go to Post Gotta love those free-range robots! Yum! - petek [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 06-02-2013, 19:41
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Creating a class for a new piece of hardware

How difficult would it be (and indeed would it be possible) to be able to handle this proximity sensor?

http://www.automationdirect.com/adc/...s%29/AE6-AP-4F

Our robot was designed by non-programmers... using hardware for which no prior FRC software exists, which I'm not even sure can be handled electrically by the hardware we have available to us. I'm balking at the idea of having to write a class to handle this plus everything else in 2 weeks by myself (I'm the only programmer), but like I said I'm not even sure it can be done.

Here's the relevant details:

Inductive proximity sensor, 8mm diameter, short body, extended range, 10-30 VDC, 3-wire, PNP, unshielded, 4mm nominal sensing distance, normally open output, 3kHz switching frequency

If it's not workable, which I assume it won't be with only 2 weeks left, I need to know so we can adjust our absurdly and needlessly complex design asap.


Which brings me to a second question: if it isn't possible, can we use ultrasonic sensors instead? It has to be able to sense the head of a screw to within a couple of millimeters of accuracy.

http://www.andymark.com/product-p/am-2434.htm

Vertical accuracy I'm not worried about because that sensor should have 1mm resolution, however, I'm not sure whether the cone of detection would be small and precise enough to only detect the screw within an acceptable range. Distance between the sensor and the screw will only be about 2-4 millimeters. Can ultrasonic sensors even operate effectively within that range?

Thanks,

Daniel A
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional
  #2   Spotlight this post!  
Unread 06-02-2013, 20:09
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Creating a class for a new piece of hardware

Neither sensor needs its own class.

The first can use a digital input, the ultrasonic (which won't do what you want) uses an analog input.

Think of the inductive sensor as a switch - it is either on or off. Just using a transistor, not an actual switch.

How about sensing your screw head with an actual lever-type limit switch instead? Or a magnetic reed switch?
__________________

I am N2IRZ - What's your callsign?
  #3   Spotlight this post!  
Unread 06-02-2013, 20:14
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Re: Creating a class for a new piece of hardware

The belt is going in both directions, so a limit switch would get caught.

Where on the Sidecar would that be attached?
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional
  #4   Spotlight this post!  
Unread 06-02-2013, 22:08
toastnbacon toastnbacon is offline
Registered User
AKA: James
FRC #3169 (Saintborgs)
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Edmond
Posts: 97
toastnbacon is a jewel in the roughtoastnbacon is a jewel in the roughtoastnbacon is a jewel in the roughtoastnbacon is a jewel in the rough
Re: Creating a class for a new piece of hardware

What are you trying to do? You would be amazed at all the problems that can be fixed in programming.
__________________
"This must be what going insane feels like."-Simon Tam, Firefly
  #5   Spotlight this post!  
Unread 06-02-2013, 23:02
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 577
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Creating a class for a new piece of hardware

Limit switches go to the digital inputs on the DSC. We'll probably have 10 on our robot this year.
  #6   Spotlight this post!  
Unread 07-02-2013, 22:35
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Creating a class for a new piece of hardware

Quote:
Originally Posted by F22Rapture View Post
The belt is going in both directions, so a limit switch would get caught.
Even one like this?
__________________

I am N2IRZ - What's your callsign?
  #7   Spotlight this post!  
Unread 08-02-2013, 01:43
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Re: Creating a class for a new piece of hardware

Quote:
Originally Posted by DonRotolo View Post
Even one like this?
Perhaps not, but I don't think spending $190 on a limit switch is a good use of our somewhat limited resources.

Quote:
I will add that you have to be careful using these sensors. We used them as limit switches on our arm. Towards the end of the match on more than one occasion while many of our motors were on, our voltage dropped below 10 volts. As a result the sensors were no longer powered and our arm was able to over extend.
That shouldn't be a problem in our use case. The lift mechanism for the frisbees itself has a KoP photoswitch (from 2011) on the top and bottom to prevent it from allowing a frisbee to go too far in either direction. This sensor is only for determining the position of the lift by picking up on screws on it they passes by.

Quote:
As Alan mentioned if it was NPN you could just use a DIO and they do have an NPN version AE6-AN-4F (replace the AP with AN in the part number) Thus when the switch is closed it will be sinking the DIO to ground, when the switch is open there is a built-in pull up resisitor in the sidecar which pulls the DIO high by default.
So if I'm understanding you correctly, that sensor should work without any modification (ie. resistors and/or code workarounds) whatsoever?

Thanks, I'm emailing this to our mentor.
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional

Last edited by F22Rapture : 08-02-2013 at 01:45.
  #8   Spotlight this post!  
Unread 08-02-2013, 15:14
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Creating a class for a new piece of hardware

Quote:
Originally Posted by F22Rapture View Post
I don't think spending $190 on a limit switch is a good use of our somewhat limited resources.
"like" that, not that exactly. Surely you can find a $2 limit switch and make it work like that? Oh, NVM, you're a programmer...

My point was that there may be hardware out there of which you are unaware, that will solve your problem for a lot less complexity and money than that prox sensor.
__________________

I am N2IRZ - What's your callsign?
  #9   Spotlight this post!  
Unread 06-02-2013, 22:57
inkspell4's Avatar
inkspell4 inkspell4 is offline
Registered User
FRC #3650 (Robo Raptors)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Maryland
Posts: 326
inkspell4 will become famous soon enough
You could also use a light sensor. Such as:https://www.sparkfun.com/products/9088
__________________
Chesapeake Regional : 2013, 2012, 2011
Rookie Year: 2011
2013 RoboRaptors Team 3650 Programming Team Captain
Team Website : http://www.roboraptorsfrcteam3650.com/index.html
_____________________________________________

Last edited by inkspell4 : 06-02-2013 at 23:02.
  #10   Spotlight this post!  
Unread 06-02-2013, 23:35
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: Creating a class for a new piece of hardware

Quote:
Originally Posted by F22Rapture View Post
Inductive proximity sensor, 8mm diameter, short body, extended range, 10-30 VDC, 3-wire, PNP, unshielded, 4mm nominal sensing distance, normally open output, 3kHz switching frequency
The PNP part makes it harder to connect to a FRC robot. If it were NPN instead, it could be wired directly to a Digital Input. As it is, you'll need to add some simple circuitry to reduce the output voltage to something that a Digital Input pin will handle, and to pull the signal low when the sensor is not active. It's just a couple of resistors; I think a 5k from the DIO signal pin to ground and a 7.5k from the DIO signal to the sensor output should work.
  #11   Spotlight this post!  
Unread 07-02-2013, 16:20
GrimmReaper's Avatar
GrimmReaper GrimmReaper is offline
Registered User
FRC #2046 (Bear Metal)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Maple Valley, WA
Posts: 24
GrimmReaper is on a distinguished road
Re: Creating a class for a new piece of hardware

As Alan mentioned if it was NPN you could just use a DIO and they do have an NPN version AE6-AN-4F (replace the AP with AN in the part number) Thus when the switch is closed it will be sinking the DIO to ground, when the switch is open there is a built-in pull up resisitor in the sidecar which pulls the DIO high by default.

So high the switch is Open, Low the switch is closed. Just use the DigitalInput class and you should be golden...

let us know if that works for you.
  #12   Spotlight this post!  
Unread 07-02-2013, 22:57
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 189
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
Re: Creating a class for a new piece of hardware

Quote:
Originally Posted by F22Rapture View Post
Inductive proximity sensor, 8mm diameter, short body, extended range, 10-30 VDC, 3-wire, PNP, unshielded, 4mm nominal sensing distance, normally open output, 3kHz switching frequency
The past two years we have used sensors very similar to these. Not realizing it at the time we ordered PNP. I don't remember the value off the top of my head but we just needed one pull-up resistor for each sensor and they worked great.

I will add that you have to be careful using these sensors. We used them as limit switches on our arm. Towards the end of the match on more than one occasion while many of our motors were on, our voltage dropped below 10 volts. As a result the sensors were no longer powered and our arm was able to over extend.

The first couple of times this happened we the programmers got blamed very quickly. It wasn't until later we were able to deduce what happened.
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

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 02:09.

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