User Tools

Site Tools


switches_as_digital_inputs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
switches_as_digital_inputs [2018/12/11 22:29] – created tellswitches_as_digital_inputs [2018/12/11 22:42] (current) tell
Line 11: Line 11:
  
 We could use two DIOs for two different limit switches: one for UP, one for DOWN, and if neither switch is closed, we interpret that to mean the mechanism is somewhere in between. We could use two DIOs for two different limit switches: one for UP, one for DOWN, and if neither switch is closed, we interpret that to mean the mechanism is somewhere in between.
 +
 +===== Autonomous Selection =====
  
 Suppose we want to select from four different autonomous routines.  we could use two switches, and tell the drive team to set them according to a table like this: Suppose we want to select from four different autonomous routines.  we could use two switches, and tell the drive team to set them according to a table like this:
Line 17: Line 19:
   * 1: Closed, Open   - drive forward   * 1: Closed, Open   - drive forward
   * 2: Open, Closed   - drive forward and place power cube   * 2: Open, Closed   - drive forward and place power cube
-  * 3: ClosedClosed - drive forward, turn left, drive, turn right, drive, and then place cube+  * 3: OpenOpen - drive forward, turn left, drive, turn right, drive, and then place cube
  
-[picture]?+Given three switches and 3 digital I/Os, we could chose from 8 alternatives.  The eastbots actually did this on our [[2018 Season]practice robot:
  
-But requiring the drivers to read the chart, even if it is written on the robot, is error prone. +{{ :auto-select-binary.jpg?300 |}}
-A better **user interface** would be a rotary switch.+
  
-[picture]+But requiring the drive team to read a chart and set several switches, even if the chart is written on the robot, could be confusing in the heat of the match and error prone. 
 + 
 +A better **user interface** would be a rotary switch, which we used on our 2018 competition robot. 
 + 
 +{{ :auto-select-switch.jpg?400 |}}
  
 A typical rotary switch contains one or more "levels" each with a moving contact that can connect to one fixed contact at a time.  We typically draw the schematic for such a switch like this: A typical rotary switch contains one or more "levels" each with a moving contact that can connect to one fixed contact at a time.  We typically draw the schematic for such a switch like this:
Line 33: Line 38:
  
 {{ :rotary-binary2.png?nolink |}} {{ :rotary-binary2.png?nolink |}}
 +
 +====== More switch ideas ======
 +
 +Suppose there were only three autonomous choices.  One three-position toggle switch could control two DIOs.
 +Such a switch is called a "single pole, double-throw, center off" switch.  The switch, and its schematic symbol look like:
 +
 +[picture]
 +
 +Notice how the body of the switch is labled "on-off-on."  This how to tell that it has a center-off position without even moving the lever.   We wired it up like this:
 +
 +[picture]
  
  
  
switches_as_digital_inputs.1544585359.txt.gz · Last modified: 2018/12/11 22:29 by tell