Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   DIP switches for autonomous modes (http://www.chiefdelphi.com/forums/showthread.php?t=84570)

windell747 23-03-2010 09:03

DIP switches for autonomous modes
 
Hi, Were wanting to use DIP switches to select between different autonomous behavior prior to our matches without needing to reprogram. We would connect them to the GPIO pins.

Since the signal pins are pulled to 5V with a 10k resistor, we are thinking of simply pulling the pin to GND to select the autonomous behavior.

I didn't see any rules against this. Do you guys agree?

Thanks,
windell

apalrd 23-03-2010 09:17

Re: DIP switches for autonomous modes
 
Pulling a pin to ground is the common way of connecting to the digital inputs.

The Lucas 23-03-2010 09:18

Re: DIP switches for autonomous modes
 
A switch connecting a signal pin to ground when pressed is the intended method of operation for Digital Inputs, so you are correct. Have you considered using Digital Inputs on the driver station (many teams prefer this approach) instead of the robot? You can use the virtual digital inputs on the I/O panel or your DIP switch on the PSoC.

windell747 23-03-2010 09:28

Re: DIP switches for autonomous modes
 
Thanks Lucas and apalrd! Unfortunately, I'm not the programmer of the team so I don't know about the PSoC or the driver station DIO. I know we're using the classmate, but other than that I'm clueless. Our programmer seems spacey sometimes and doesn't think of these things. So we'll probably put the switches on the bot. I'll pass on the info!

Thanks again,
windell

Joe Johnson 23-03-2010 09:31

Re: DIP switches for autonomous modes
 
Quote:

Originally Posted by The Lucas (Post 941649)
A switch connecting a signal pin to ground when pressed is the intended method of operation for Digital Inputs, so you are correct. Have you considered using Digital Inputs on the driver station (many teams prefer this approach) instead of the robot? You can use the virtual digital inputs on the I/O panel or your DIP switch on the PSoC.

While there are good reasons for putting the selection on the Operator Interface (you can change it without having to be next to your robot) for me there is nothing as certain as flipping a switch on your robot to be sure that your robot will know what to do.

So... ...if #2849 ever gets its autonomous program(s) running, we'll be flipping switches on the robot to select (or disable) them.

For what it's worth.

Joe J.

The Lucas 23-03-2010 09:47

Re: DIP switches for autonomous modes
 
Quote:

Originally Posted by Joe Johnson (Post 941658)
While there are good reasons for putting the selection on the Operator Interface (you can change it without having to be next to your robot) for me there is nothing as certain as flipping a switch on your robot to be sure that your robot will know what to do.

So... ...if #2849 ever gets its autonomous program(s) running, we'll be flipping switches on the robot to select (or disable) them.

For what it's worth.

Joe J.

I understand those reasons. We use rotary switches (2 X six pos) on the PSoC and print out the auto routine on the Driver Station LCD so we can confirm that the cRIO sees those switches. In case the PSoC (as it did when the Classmate battery goes low, we will not let that happen again) fails the drivers are trained to use the virtual analog in as a backup. It is important to be sure you run the correct auto.

billbo911 23-03-2010 09:47

Re: DIP switches for autonomous modes
 
Another possibility is using a potentiometer and one analog input on the robot.
Theoretically you could have close to 5000 different autonomous options as I believe the analog inputs are 12 bit. (2^12=4096). Practically speaking, you would easily be able to have a couple per zone.
We have a pot on our robot this year that has 10 detented positions, but we are only using 4 modes. This allows us greater room for error in positioning the pot.

Al Skierkiewicz 23-03-2010 09:57

Re: DIP switches for autonomous modes
 
For many years we have used a modified Radio Shack rotary switch. This is stock 6 position double pole switch. With a small modification it can be turned into a 12 position single pole switch. Wired with 9.1k resistors in a series string, this switch can function on an analog input either at the robot or on the driver's console. It effectively steps from 0 volts to five volts.
The modification involves removing the phenolic switch deck, and cutting the inside of one of the follower contacts on one side of the switch. Then remove one of the mechanical stops on the metal detent plate and reassemble the switch. Then wire the two center contacts together and tie to the analog input. Wire the 9.1k resistors from contact to contact around the outside terminals of the switch. Tie one end of the string to 5 volts and the other to negative power supply. The load on the 5 volts supply is in the order of 100 k ohms so there is little current.

http://www.radioshack.com/product/in...AID=107598141#

apalrd 23-03-2010 09:59

Re: DIP switches for autonomous modes
 
Quote:

Originally Posted by billbo911 (Post 941672)
Another possibility is using a potentiometer and one analog input on the robot.
Theoretically you could have close to 5000 different autonomous options as I believe the analog inputs are 12 bit. (2^12=4096). Practically speaking, you would easily be able to have a couple per zone.
We have a pot on our robot this year that has 10 detented positions, but we are only using 4 modes. This allows us greater room for error in positioning the pot.

Another option is a multiplexed switch. You solder a resistor from each position to the position next to it, with GND on one end and +5 (or +3.3) on the other. The selector goes to SIG. If all of the resistors are the same value, each position is an even increment from the next and the switch clicks from position to position, more accurately than the potentiometer method.

Joe Johnson 23-03-2010 10:20

Re: DIP switches for autonomous modes
 
I am going for 3 switches providing 8 choices for autonomous programs (000, 001, 010, 011, 100, 101, 110, 111) It requires a secret decoder ring but it is simple enough to manage and as a practical matter we will probably only use 3 of them.

Works for me.

Joe J.

samir13k 23-03-2010 11:13

Re: DIP switches for autonomous modes
 
1501 uses a thumbwheel on our robot. It uses 4 Digital I/0 slots in the Digital Sidecar. it can also be used on the Cyprus Board i believe, but we decided to not use any custom circuits on our Drivers Station. It offers 0-9, and A-F i believe. Overall there is about 15-16 options, and we have never had a problem with it. I can try to get you the supplier if you PM me. We have never had a problem with it. I believe you wire it into a case selector in labview to change between the different modes. If you dont have that many modes, than you can have your code default to a certain auto mode, or default back to no code if the thumbwheel is set incorrectly. (Which we have never had happen, but we code it in as a safety anyways. Also helps prevents watchdog errors)

mikets 23-03-2010 13:18

Re: DIP switches for autonomous modes
 
1 Attachment(s)
We built our own DIP switches last year and are able to reuse it this year. We mounted it on the robot and connect it to some of the digital input pins (however many pins we want up to 8). The board was designed to interface with both the digital inputs on the robot (internally pulled up) and the digital inputs on the DS last year (no internal pull-ups). We didn't have time to play with the PSoC this year but I would imagine it should not be hard to interface it to the PSoC as well.

McVey 23-03-2010 21:02

Re: DIP switches for autonomous modes
 
For control over autonomous as our team takes the field, we have one SPST switch (enable / disable) and one SPDT switch (offense, defense, midfield). Digital inputs with switches work fine when wired to the digital board to the cRIO, the only issue is that each individual switch requires its own PWM and slot on the digital board. All in all, our setup only requires three inputs, but still, we could be using those for other things and I fear that your DIP Switch may take up too much space on your digital board.

Of course, you've probably already accounted for that! I've had great success with physical switches though and swear by them - have at it.

apalrd 23-03-2010 21:37

Re: DIP switches for autonomous modes
 
Quote:

Originally Posted by McVey (Post 942110)
All in all, our setup only requires three inputs, but still, we could be using those for other things and I fear that your DIP Switch may take up too much space on your digital board.

Are you seriously close to running out of your 28 DIO's? I have 2 encoders in the drivetrain (4 inputs), pressure switch, claw sensor, ball-in sensor, and that's it. 7 inputs, not including analog. Not close to 28. Same with the Cypress board. 16 inputs. We have three buttons plus a 4-pos switch, and we still haven't filled half of the IO. Plus, you can always use analog triggers as DIO, adding another 16 di's to the 28 dio's (total: 44 dio). If you seem to be using lots of DO's, you can use Relay channels as 2 DO's each, another 32 DO's todal.

Jeremy Germita 24-03-2010 02:09

Re: DIP switches for autonomous modes
 
Team 399 has a little panel on the driver station. There are 4 SPDT Toggle Switches and a Rotary Switch.
There are 15 options with the Toggles times 4 with the rotary switch.
Like Al and apalrd, we wired the rotary the same way giving us the option to use just 1 analog input instead of 4 digitals.
We have also printed the options on the DS LCD.

So we can have a maximum of 60 autonomous modes.


All times are GMT -5. The time now is 12:20.

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