understanding the 2008 frc robot controller chris gregory frc1089 – team mercury

24
Understanding The Understanding The 2008 FRC Robot 2008 FRC Robot Controller Controller Chris Gregory Chris Gregory FRC1089 – Team Mercury FRC1089 – Team Mercury www.mercury1089.com www.mercury1089.com

Upload: penelope-barber

Post on 17-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Understanding The 2008 Understanding The 2008 FRC Robot ControllerFRC Robot Controller

Chris GregoryChris Gregory

FRC1089 – Team MercuryFRC1089 – Team Mercury

www.mercury1089.comwww.mercury1089.com

Page 2: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

AgendaAgenda

I.I. What I will I learn from this workshop?What I will I learn from this workshop?II.II. What is the Robot Controller?What is the Robot Controller?III.III. How do we communicate with it?How do we communicate with it?IV.IV. Robot States (Modes)Robot States (Modes)V.V. How does it connect to the rest of your How does it connect to the rest of your

robot?robot?VI.VI. Tips & TricksTips & TricksVII.VII. Additional ResourcesAdditional ResourcesVIII.VIII. Q & AQ & A

Page 3: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

I. What will I learn?I. What will I learn?

How the RC interacts with devices in How the RC interacts with devices in the FRC competition, on and off the the FRC competition, on and off the fieldfield

How to correctly set up your Robot How to correctly set up your Robot Controller within your robotController within your robot

The procedure for downloading code The procedure for downloading code to your robotto your robot

Tips and Tricks to help you along the Tips and Tricks to help you along the wayway

Page 4: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

II. What is the Robot Controller? II. What is the Robot Controller?

Page 5: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

II. What is the Robot Controller?II. What is the Robot Controller?

““Heart and Brains of Robot”Heart and Brains of Robot” Contains a PIC processor calculating Contains a PIC processor calculating

at 10.0 MIPS, with 128k at 10.0 MIPS, with 128k programmable flash memoryprogrammable flash memory

Programmable in C using a C18 Programmable in C using a C18 CompilerCompiler

What you’re here to learn more What you’re here to learn more aboutabout

Page 6: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

III. How do we communicate with III. How do we communicate with the RC?the RC?

RC Interfaces with Operator Interface RC Interfaces with Operator Interface (OI) via three methods(OI) via three methods• Radio-Controlled using your radios Radio-Controlled using your radios

(practice)(practice)• Connected via Tether CableConnected via Tether Cable• Radio-Controlled via the Competition Radio-Controlled via the Competition

port (At the events)port (At the events)

Page 7: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Connected Via Tether CableConnected Via Tether Cable

Robot receives input from OI and controls Robot receives input from OI and controls parts of the robot based on the parts of the robot based on the programmable codeprogrammable code

Robot sends data BACK to OI such as Robot sends data BACK to OI such as battery voltage, which motors are running, battery voltage, which motors are running, etc.etc.

Use the tether to synchronize your OI and Use the tether to synchronize your OI and RC, as well as to set your team numberRC, as well as to set your team number

Don’t screw the tether in!Don’t screw the tether in!

Page 8: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Connected Via Tether CableConnected Via Tether Cable

Connected this way, the OI does not Connected this way, the OI does not require a power source, as it is run require a power source, as it is run from the robot’s batteryfrom the robot’s battery

Not a good way to drive the robot Not a good way to drive the robot around, as the stock tether is only 6’ around, as the stock tether is only 6’ longlong

DON’T SCREW THE TETHER IN!!!!!DON’T SCREW THE TETHER IN!!!!!

Page 9: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Radio-controlled (Practice)Radio-controlled (Practice)

Radios connected to both RC and OIRadios connected to both RC and OI• (Use a tether cable first to synchronize them (Use a tether cable first to synchronize them

the first time you use them)the first time you use them) Useful for testing at home, but no radio Useful for testing at home, but no radio

control allowed in pits at competition.control allowed in pits at competition. Operator Interface requires external power Operator Interface requires external power

(included in KOP)(included in KOP) Screw the radio into the robot, and keep Screw the radio into the robot, and keep

your radio exposed (BUT NOT your radio exposed (BUT NOT VULNERABLE)VULNERABLE)

Page 10: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Radio-Controlled at the Radio-Controlled at the CompetitionsCompetitions

At the competition, the field controls At the competition, the field controls which status your robot is in through which status your robot is in through the competition port on the OIthe competition port on the OI

Field Techs will shut your robot down Field Techs will shut your robot down if they deem it unsafeif they deem it unsafe

You don’t use your OI Radio or power You don’t use your OI Radio or power source, those are provided through source, those are provided through the competition portthe competition port

Page 11: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

IV. Robot States (Modes)IV. Robot States (Modes)

DisabledDisabled• How your robot starts and ends in a roundHow your robot starts and ends in a round

AutonomousAutonomous• Robot controlled through programming Robot controlled through programming

routines. USUALLY at the beginning of a round.routines. USUALLY at the beginning of a round. Tele-operated (Practice)Tele-operated (Practice)

• Normal robot state: students control the Normal robot state: students control the machine via the OImachine via the OI

ProgramProgram• How you download code to the robotHow you download code to the robot

Page 12: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

IV. Robot States (Modes)IV. Robot States (Modes)

Practice Mode is set by default on power-Practice Mode is set by default on power-up if tether cable connectedup if tether cable connected

Disable Mode is on by default on Disable Mode is on by default on competition field or if no radio/tether competition field or if no radio/tether connectedconnected

Program Mode enabled by pressing Program Mode enabled by pressing Program button on RC for 4 secondsProgram button on RC for 4 seconds

Disable/Practice/Autonomous mode can be Disable/Practice/Autonomous mode can be toggled via a MODE SELECTOR SWITCH toggled via a MODE SELECTOR SWITCH that you must purchase/create/obtainthat you must purchase/create/obtain

Page 13: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

V. How does it connect to the rest V. How does it connect to the rest of your robot?of your robot?

Main Battery (See Electrical Diagram)Main Battery (See Electrical Diagram) Backup BatteryBackup Battery Status/Team Lights (See Manual)Status/Team Lights (See Manual) PWM (Analog) OutputsPWM (Analog) Outputs Relay (Digital) OutputsRelay (Digital) Outputs Analog InputsAnalog Inputs Digital I/ODigital I/O

Page 14: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Backup BatteryBackup Battery

7.2V battery pack used to stop RC 7.2V battery pack used to stop RC from resetting if main power is too from resetting if main power is too lowlow

THIS IS REQUIRED FOR USING SERVO THIS IS REQUIRED FOR USING SERVO MOTORS ON YOUR ROBOTMOTORS ON YOUR ROBOT

Page 15: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

PWM OutputsPWM Outputs

PPulse ulse WWidth idth MModulation outputsodulation outputs Primary used for controlling Primary used for controlling Victor Victor

speed controllers and powering speed controllers and powering Servo MotorsServo Motors

They are ANALOG outputs, They are ANALOG outputs, effectively allowing variable speed effectively allowing variable speed and, in the case of motors and and, in the case of motors and Victors, multiple directions.Victors, multiple directions.

You’ll definitely use these to driveYou’ll definitely use these to drive

Page 16: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Relay OutputsRelay Outputs

Digital Outputs that have 4 states Digital Outputs that have 4 states each (Forward on/off, reverse on/off)each (Forward on/off, reverse on/off)

Useful for devices that only are fully Useful for devices that only are fully on or off (such as the air compressor, on or off (such as the air compressor, a solenoid, or a lower-power motor)a solenoid, or a lower-power motor)

By default, most are controlled by By default, most are controlled by push buttons on your OI joystickspush buttons on your OI joysticks

Page 17: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Analog InputsAnalog Inputs

These are typically used to hook up These are typically used to hook up to more advanced sensors, such as a to more advanced sensors, such as a sonic range finder, a potentiometer, sonic range finder, a potentiometer, or a gyro sensoror a gyro sensor

Allow for more detailed feedback to Allow for more detailed feedback to the Robot, as opposed to an on-off the Robot, as opposed to an on-off switchswitch

Page 18: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Digital I/O portsDigital I/O ports

These ports can be assigned IN CODE as These ports can be assigned IN CODE as input or output, but by default, they are all input or output, but by default, they are all set as INPUT.set as INPUT.

Typically used for switches on the robot, Typically used for switches on the robot, such as limit switches, the air pressure such as limit switches, the air pressure switch (which shuts off the compressor if switch (which shuts off the compressor if you hit the max PSI in your tanks)…you hit the max PSI in your tanks)…

… … or autonomous routine switches (if you or autonomous routine switches (if you wanted to have multiple autonomous wanted to have multiple autonomous routines that you could select by flipping a routines that you could select by flipping a switch on your robot)switch on your robot)

Page 19: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

Flux CapacitorFlux Capacitor

Just Kidding!Just Kidding!

Page 20: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

VI. Tips and TricksVI. Tips and Tricks(mostly learned from other teams’ mistakes)(mostly learned from other teams’ mistakes)

Do not drink liquids around your robot Do not drink liquids around your robot controllercontroller

Make sure that your robot controller’s Make sure that your robot controller’s ports are easily accessible at all times – ports are easily accessible at all times – you’ll never know when you need to you’ll never know when you need to program or tether quicklyprogram or tether quickly

The backup battery will need a home – try The backup battery will need a home – try to create a means to secure it, as the to create a means to secure it, as the connection is a bit “flaky”connection is a bit “flaky”

Page 21: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

VI. Tips and TricksVI. Tips and Tricks(mostly learned from other teams’ mistakes)(mostly learned from other teams’ mistakes)

Label your PWM cables!!!! You may find Label your PWM cables!!!! You may find that you need to disconnect a cable, and that you need to disconnect a cable, and you need to be able to plug them back in you need to be able to plug them back in the right spot.the right spot.

Invest in, or create your own Invest in, or create your own autonomous/disable switchbox. This will autonomous/disable switchbox. This will help with testing, as well as safetyhelp with testing, as well as safety

Keep your wiring clean!Keep your wiring clean! Always keep backups of working code!Always keep backups of working code!

Page 22: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

VI. Tips and TricksVI. Tips and Tricks(mostly learned from other teams’ mistakes)(mostly learned from other teams’ mistakes)

FOR THE LOVE OF GOD, DO NOT SCREW IN FOR THE LOVE OF GOD, DO NOT SCREW IN YOUR TETHER CABLE!YOUR TETHER CABLE!

Treat your robot controller as if it cost you Treat your robot controller as if it cost you $449.95 plus shipping and handling, because $449.95 plus shipping and handling, because that’s how much it costs to replace it.that’s how much it costs to replace it.

Secure your RC in a place that the tether port is Secure your RC in a place that the tether port is easily accessible: You will be required to operate easily accessible: You will be required to operate in this mode at the competitionsin this mode at the competitions

Invest in extra: Main and Backup Batteries, Tether Invest in extra: Main and Backup Batteries, Tether Cables, Victors and SpikesCables, Victors and Spikes

Page 23: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

VII. Additional ResourcesVII. Additional Resources

AndyMark – AndyMark – www.andymark.bizwww.andymark.biz• Place to purchase reliable mode selectorPlace to purchase reliable mode selector

IFI Robotics – IFI Robotics – www.ifirobotics.comwww.ifirobotics.com• Manufacturer of RC – contains other guides and Manufacturer of RC – contains other guides and

manuals, as well as links to programming manuals, as well as links to programming guides and resourcesguides and resources

ChiefDelphi – ChiefDelphi – www.chiefdelphi.comwww.chiefdelphi.com• Team 47’s homepage, considered the unofficial Team 47’s homepage, considered the unofficial

FIRST “hub”, contains a lot of useful resources FIRST “hub”, contains a lot of useful resources on forums. Don’t forget to use the Search on forums. Don’t forget to use the Search button!button!

Page 24: Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury

VIII. Q&AVIII. Q&A

WELCOME TO FIRST!!WELCOME TO FIRST!!