Logic: Table of Contents: Introduction To The Logic Subsystem 7.2 Concepts To Understand 7.10 Subsystem Interactions 7.12
Logic: Table of Contents: Introduction To The Logic Subsystem 7.2 Concepts To Understand 7.10 Subsystem Interactions 7.12
Logic
Table of Contents:
Microcontroller Module
05/08
Logic Subsystem
Jumpers
Jumpers are small plastic pieces with a metal connector inside them. When inserted
into a port, a jumper completes an electrical connection between two of the metal
contacts inside, like closing a switch in a circuit. In fact, software running on the
Microcontroller cannot distinguish between a permanently pressed switch and an in-
serted jumper, nor can it distinguish between a released switch and a removed jumper.
The VEX jumper clips are 3 holes wide because they join the two outer contacts in
the port and skip the middle one (they don’t join all three, that would cause a short
circuit).
Jumpers are most commonly used to set an option on the Robot Controller by provid-
ing a Ground or Low signal on the port selected. Placing a jumper on a given Analog/
Digital port will typically activate a certain behavior in the robot’s programming (see
Port Mappings later in this section).
Once you have found the port, all you need to do is insert the jumper so that the metal
pins go into the three holes, and the jumper itself sits securely in position over the
port. It does not matter which way you install the jumper.
05/08
MOTORS
These ports are for motors or servos only. By default, your robot’s left
drive motor goes on Port 3, and your right drive motor goes on Port 2.
However, there are a number of alternate control configurations available:
see “Basic Controller Operation” in the Control Subsystem chapter for basic
configurations, and “Advanced Operator Control Configurations” at the end of
this chapter for more advanced options (including the 4WD mode mentioned
in the chart below).
Shown here are the motor port allocations for the two “Basic” control
layouts. For more details consult the “Control” Appendices at the end of this
manual.
* The inventor may use these motor ports to control inventor designed accessories.
** Only with Jumper 15 set on the Microcontroller.
*** Only with Jumper 16 set on the Microcontroller.
INTERRUPTS:
Interrupts are digital inputs designed for high
priority signals that need immediate attention
from the Microcontroller. These are used with
some of the advanced sensors of the VEX
Robotics Design System, such as the Ultrasonic
Range Finder or Quadrature Shaft Encoder.
05/08
Jumper Ports
Port Function For More Information
Jumper Port 16 “12 Mode” 4-Wheel Drive Advanced Operator Control
Enable/Disable Configurations section in
this chapter
Jumper Port 15 “23 Mode” 4-Wheel Drive Advanced Operator Control
Enable/Disable Configurations section in
this chapter
Jumper Port 14 “Software 12 mix Mode” Advanced Operator Control
Enable/Disable Configurations section in
this chapter
Jumper Port 13 Autonomous Mode Autonomous Mode section in
Enable/Disable this chapter
Sensor Ports
Port Function For More Information
Sensor Port 12 Autonomous Mode Collision Autonomous Mode section
Sensor Port 11 Detection Sensor Ports in this chapter
Sensor Port 10 Collision Emergency Stop Sensor Subsystem Chapter
Sensor Port 9 Ports
Sensor Port 8
Sensor Port 7
Sensor Port 6
Sensor Port 5
Limit Switch Ports Sensor Subsystem Chapter
Sensor Port 4
Sensor Port 3
Sensor Port 2
Sensor Port 1
TX/RX Ports
At the end of the Digital/Analog Port Bank are two ports marked TX and RX.
These ports allow the user to communicate directly with the user processor inside
the Microcontroller via a TTL serial port. This is a feature for advanced users only
and is not needed for normal operation.
05/08
(+ - ) Battery Port
This is a standard connector for 7.2V power sources, such as the Battery Holder
or the VEX 7.2V Robot Battery. It is “keyed” with an asymmetric plug shape to
prevent accidental insertion in the wrong direction. The Microcontroller draws
power for both its own operation and for all other attached devices through this
port.
05/08
Tie your wires. The VEX Robotics Design System comes with lots of wire ties,
so there is no excuse for not tying your wires down to keep them safe! Tie wires
to parts of your robot that are far away from moving parts if possible, and try to
keep them out of the way of areas where you will need to do maintenance work.
Be extremely careful when removing wire ties. It is easy to nick or cut wires
running through the ties while trying to cut the tie.
Don’t pull wires. When removing a (serial or RX) wire that is already plugged
in, never pull on the wire itself. Always grip the connector head depressing the
tab and pull. Never apply force to the wire, or it may become detached from the
head.
Incorrect Correct
Don’t force connectors. All the connector ports in the VEX Robotics Design
System are “keyed”, meaning that the plastic connectors are constructed so
that they only fit in one direction. Do not force connectors in backwards! Not
only will this physically damage the port and head, but you also risk electrical
damage to the Microcontroller and the component you were trying to plug in.
05/08
Right Front
Left Front
Autonomous mode allows the robot to operate one very simple pre-pro-
grammed behavior without any human input. When enabled, the robot will
wander around, using a pair of bumper or limit switch sensors to detect
obstacles.
• You must enable Autonomous Mode in order to use the autonomous
behavior. Place a Jumper Clip on Digital Input 13 to enable Autonomous
Mode operation.
• Plug the Bumper Switch or Limit Switch Sensors into ports 11 and 12 to
use this behavior. The “left-front” sensor should go into port 11, and the
“right-front” sensor should go into port 12.
• The robot will begin running autonomously 2-3 seconds after being turned
on. The delay is intended to give the person who turns it on some time to
get out of its way.
• The robot will drive forward without human control when in Autonomous
Mode. When the bumper switch on input port 11 is pushed in, the robot
will interpret this as an indication that it has run into an immovable
obstacle on the left side, and will turn to the right until the switch is no
longer pushed in. The bumper switch on input port 12 does the same thing,
but monitors the right side and makes the robot turn left when it is pushed.
• Human control is disabled! Be sure to watch the robot to ensure that it does
not venture into any dangerous areas. In particular, the robot has no way
of detecting “negative obstacles”, like ditches or cliffs. Pick up the robot
and stop it if it is in danger of damaging itself!
05/08
The rear-left motor should go on Motor Port 8, and the rear-right motor
should go on Motor Port 7. If the Transmitter is in “23 mode”, you should
then attach a jumper to Digital/Analog input port 15. If the Transmitter is in
“12 mode”, put the jumper on port 16 instead. If you wish to use both 4WD
and “Software 12 mix” mode (see below), you do not need either jumper 15
or 16, because the “Software 12 mix” automatically enables 4WD.
This version of the “12 mode” is slightly different from the Transmitter’s
“12 mode”, however, because it will allow you to go at full speed straight
forward, whereas the Transmitter’s “12 mode” will only go 60% of full speed
forward. The result is that the “Software 12 mix” mode goes faster, but feels
like it slows down during turns; Transmitter “12 mix” mode will go slower,
but feels more responsive in turns.
Concepts to Understand
Role of Electronic Control
A robot is a very complex system of parts that must work together in order
to achieve a desired goal. Electronic control provided by a programmable
controller like the VEX Microcontroller allows the robot to coordinate the
operation of the different components and achieve its goals.
7 • 10 Inventor’s Guide
Logic
Inventor’s Guide 7 • 11
Logic
Subsystem Interactions
How does the Logic Subsystem
interact with…
…the Structure Subsystem? …the Control Subsystem?
• The Structure Subsystem holds the Microcontroller • The Microcontroller module controls the flow of
in place. Since the Microcontroller is a very delicate commands from the human operator to the robot.
and important part of the robot, the Structure The Microcontroller ultimately decides whether
Subsystem will also need to provide physical to pass joystick commands on to the motors, to
protection for the Microcontroller by keeping it in a modify them, or to override them, based on its
secure spot. programmed behavior and other information
• The Structure Subsystem does not plug into the available to it (from sensors, for instance).
Microcontroller in any way; however, the Structure • The RF Receiver Module is connected to the VEX
Subsystem does need to provide accommodation
Microcontroller through the yellow control cable
and protection for the wires that run between the
that runs from the back of the Receiver into the
Microcontroller and other pieces.
rear of the Microcontroller. Up to two Receivers
can be supported simultaneously.
…the Motion Subsystem? • If desired, the Transmitter can be hooked directly
• The Logic Subsystem provides power and issues into the VEX Microcontroller using a tether cable,
output commands to the Motion Subsystem bypassing the RF Receiver Module (see the Control
components. Though these commands are usually Subsystem chapter for details).
based on user input (relayed through the Control • The specific way that the robot will respond to
Subsystem), the final decision on what command is joystick movement is determined by a combination
issued, as well as the actual flow of electricity (from of Transmitter and Microcontroller settings. See
the Power Subsystem) is all controlled by the Logic Appendix on Control for a full listing of control
Subsystem. layouts.
• Motors from the Motion Subsystem plug into the
Motors port bank on the top of the Microcontroller. … the Power Subsystem?
• Since the Microcontroller is a device that
…the Sensor Subsystem? contains a large number of electronic
components, including two computer processors,
• The Logic Subsystem relies on feedback from the
it needs power, which is provided by the Power
Sensor Subsystem to provide information about
Subsystem.
the robot’s environment. It uses this data to make
• The Microcontroller redistributes electrical
informed decisions about how the robot should
energy from the Power Subsystem battery to the
behave.
other subsystems’ components (like motors).
• The actual behavior that is activated when a sensor
• The Power Subsystem battery holder (or battery
is triggered depends on which port the sensor is
pack) connects to the Microcontroller module
plugged into on the Microcontroller and the Code
using a two-pin connector inside a plastic
being executed.
housing, which is mechanically keyed to prevent
it from being plugged in backward. The port is
on the rear of the Microcontroller next to the
power switch.
05/08
7 • 12 Inventor’s Guide