ROBOTC for VEX On-Site Professional Development

Slides:



Advertisements
Similar presentations
While Loops and If-Else Structures
Advertisements

Engineering Roles We will be forming groups of 3 students
Automation and Robotics
VEX and Robot C Chris Patterson Presented by Modified by J. Andazola.
Developed in collaboration with Introduction to Programming.
VEX Robotics Platform and ROBOTC Software Introduction.
Vex Robotics Introduction to Sensors. introduction to sensors Sensors assist robots in seeing and feeling the physical world through which they travel.
VEX Robotics Platform and ROBOTC Software
Autonomy using Encoders Intro to Robotics. Goal Our new task is to navigate a labyrinth. But this time we will NOT use motor commands in conjunction with.
Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.
Connecting VEX and ROBOTC
Testbed: Exercises.
ROBOTC for VEX Online Professional Development
VEX Robotics Platform and ROBOTC Software
ROBOTC Software Introduction. ROBOTC Software ROBOTC developed specifically for classrooms and competitions Complete programming solution for VEX Cortex.
Program ultrasonic range sensor in autonomous mode
Coding for the FIRST Tech Challenge: RobotC
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
Introduction to the VEX ® Robotics Platform and ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
Programming Design ROBOTC Software Principles of Engineering
Robot C and Natural Language
Autonomy using Encoders Intro to Robotics. Autonomy/Encoders Forward for Distance In this unit, you will learn to use the encoders to control the distance.
AUTOMATION WITH ROBOTC Starting to write and troubleshoot computer code.
Session 12 Sensors and Timers. 3 Main Types of Robot Projects Command-Based Robot A more complicated project for more complicated robots Iterative Robot.
While and If-Else Loops ROBOTC Software. While Loops While loop is a structure within ROBOTC Allows a section of code to be repeated as long as a certain.
Automated Mechanisms Help. Potentiometers Potentiometer Check –Analog Port 2 How they work –Analog sensor –Measures rotation of a shaft between 0 and.
RobotC Remote Control. Learning Objectives: Focusing on Virtual World with Physical Examples Understand Real-Time Joystick Mapping Understand how to use.
VEX and Robot C Chris Patterson Frisco ISD CTE Center Presented by.
Automation and Robotics.  First you select the platform type so that you can use Natural Language PLTW.
Vex Robotics program three: using motors and sensors together.
Connect VEX and ROBOTC Electrical Engineer Responsibilities © 2011 Project Lead The Way, Inc.Automation and Robotics VEX.
ROBOTC for VEX Online Professional Development. Homework Questions Thoughts? Questions?
Introduction to VEX® components
ROBOTC for VEX Online Professional Development Jesse Flot
Programming Design ROBOTC Software. Behavior-Based Programming A behavior is anything your robot does –Turning on a single motor or servo Three main types.
Basic Programming: Until Commands. The Problem with Wait States Motor Speed is affected by battery power. –If the battery is fully charged, the motors.
Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.
Decision Making: while loops and Boolean Logic. While Loops A while loop is a structure within ROBOTC which allows a section of code to be repeated as.
Sensor Information: while loops and Boolean Logic.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
Programming Design ROBOTC Software Principles Of Engineering
Electrical Engineer Responsibilities
ROBOTC for VEX Online Professional Development
Electrical Engineer Responsibilities
ROBOTC for VEX Online Professional Development
VEX Robotics Platform and ROBOTC Software
ROBOTC for VEX On-Site Professional Development
ROBOTC for VEX Online Professional Development
Electrical Engineer Responsibilities
Programming Design ROBOTC Software Computer Integrated Manufacturing
Electrical Engineer Responsibilities
Movement using Shaft Encoders
Autonomy using Encoders
RobotC Sensors.
Automation and Robotics
TECH 1 BAMS Technology Education
While Loops and If-Else Structures
Programming Design ROBOTC Software Principles Of Engineering
While Loops and If-Else Structures
While Loops and If-Else Structures
While Loops and If-Else Structures
if-else Structures Principles of Engineering
Robotics Programming Using Shaft Encoders
Robotics Programming Using Shaft Encoders
While Loops and If-Else Structures
Robotics Programming Using Shaft Encoders
While Loops and If-Else Structures
Programming Design ROBOTC Software Principles of Engineering
While Loops And If-Else Structures
Presentation transcript:

ROBOTC for VEX On-Site Professional Development

Troubleshooting Student: My robot won’t stop turning.

Troubleshooting Student: I used the auto straightening code, and it compiles, it isn’t working, it’s just being weird.

Troubleshooting Student: One of my encoders is counting down even though it’s spinning forward.

Troubleshooting Student: My code won’t compile.

Radio Control

Radio Control An out-of-box VEX Microcontroller comes with basic built-in Radio Control functionality The Radio Control Transmitter can be configured to allow some customization of that built-in functionality Still very limited customizability and usefulness! The ROBOTC firmware enables full customization of how the Radio Control Transmitter signals controls the VEX By default ROBOTC turns off reception from the transmitter to save battery life during autonomous programming One line of code turns it back on

Radio Control One Transmitter continuously sends out 6 separate values over 6 separate channels Values range from -127 to 127 Doesn’t something else have values that range from -127 to 127? The “crystal” number must match on the transmitter and receiver The crystal is what controls the frequency of the transmission One transmitter can control multiple robots, so be careful in your classrooms 13 different crystals/frequencies are available

Radio Control Reset Since the Radio Control Transmitter can be configured, there’s the possibility that it’s configured inappropriately for our purposes. Watch the Radio Control Setup and Values and Axes (Part 1) Videos in TRC4V, found in Radio Control > Control Mapping Be sure to follow along with the Radio Control Setup Video!

Radio Control Signals

Radio Control Direct Value Mapping Program Flow Tracing Values from the transmitter are directly used to control the motors (1:1 ratio) Program Flow Tracing Radio Control with Wait States Radio Control with a Loop (real-time control) Indirect Value Mapping Values from the transmitter are modified before being used to control motors Can make the robot easier to control Appropriate in situations that require more “delicate” movements Notice: the robot reads the right side of the equal sign first

Advanced Radio Control Attach the Arm! Use the Transmitter buttons to control the arm The Transmitter buttons send values of -127, 0, or 127 Would direct mapping or indirect mapping be most appropriate for controlling the arm? Why? More loop control please? Is remote controlling the robot forever always appropriate? Question: Where would the wait statement go if we wanted the robot to be remote controlled for a controlled amount of time? Answer: Nowhere! We need something else. Solution: Timers Can be thought of as internal stopwatches (4 available) Like encoders, timers should be “cleared” anytime before they are used Watch where you clear them!

Advanced Radio Control Wasting Time? The time it takes to turn on the VEX and start Radio Control is wasted time. Could we make the robot wait to start it’s timer until we were ready? Any ideas? Wait for a Transmitter Button press The robot won’t start the timer until we say so The robot also can’t move until we says so Program Flow Trace Could this idea also be used to make a “more friendly” start button on a non-radio controlled robot? Other ideas of how to improve radio control? Use the buttons to initiate common actions Turn 90 degrees, move straight forward, ect

Advanced Radio Control Assigning a function to a button press Auto pickup

Radio Control Challenges TRC4V Videos (recommended) Watch remaining Control Mapping videos 3-5 Race to the Finish Remember to Journal Remember to Pseudocode Shut off your transmitter when it’s not in use! Drastically saves the battery life (and your ears) The transmitter is always transmitting, even if the robot isn’t on

Advanced Radio Control Challenges TRC4V Videos (recommended) Watch remaining Radio Control Videos (Control Mapping, Timers, Buttons sections) Minefield Level 1 Challenge Remember to Pseudocode Remember to Journal RoboDunk First try it Tele-Operated, then Autonomously

Competition Templates VEX Competitions have a “Field Management System” in place Manages when robots are enabled/disabled Determines whether the robots are in autonomous/tele-operated mode A Competition Template is available that can be programmed in to work with the Field Management System Contains autonomous and tele-operated sections Found in the Sample Programs > Competition folder

Troubleshooting Student: My loop should only be running for 1 minute, but it never stops.

Touch Sensors Touch Sensor Check How they work Two Types Front sensor plugged into A/D 1 Rear Sensor plugged into A/D 4 How they work Digital sensor - Pressed or Released Watch out for “bouncing” Two Types Limit Switches – on Squarebot 3.0 Bumper Switches Setting them up ROBOTC Motors and Sensors Setup window Using them The SensorValue[] command

Touch Sensors Start Button Fine-tuned arm control Remember back to how we used the Transmitter button to start the timer portion of the program. How would we implement the same thing with the limit switch? Fine-tuned arm control Using the limit switches to tell the robot when it has reached it’s minimum and maximum points

Touch Sensor Challenges Quick-tap Challenge Incorporating Sensors, Variables, Loops, If Statements, Timers, Boolean Logic, Pseudocoding, and FUN all into one activity Addition & Subtraction Everything you just learned, but with another twist

The Ultrasonic Rangefinder Ultrasonic Rangefinder Check Input wire plugged into A/D Port 5 Output wire plugged into INT Port 1 How they work Similar to how bats and submarines work Digital sensor – but returns distance values between 0 & 255 (Can also return values of -1 or -2 if used improperly) Resolution is in inches (a value of 5 = 5 inches away) Setting them up ROBOTC Motors and Sensors Setup window Using them Be careful not to use them immediately as your program starts – they take time to initialize and will return negative values The SensorValue[] command

The Ultrasonic Rangefinder Forward until Near Move forward until the robot is “near” an object, then stop Thresholds Automatic Pick-up Forward until Near + picking up the mine Assign to a button

Sensor Challenges TRC4V Videos (recommended) Watch Remaining Sensing Section Videos Minefield Level 2 Challenge Remember to Pseudocode Remember to Journal The two are not mutually exclusive! The Speed of Sound Sonic Scanner Level 2 (Start)

Potentiometers Potentiometer Check How they work Setting them up Sensor plugged into A/D 1 How they work Analog sensor Measures rotation of a shaft between 0 and ~265 degrees Returns values 0 – ~1023 Internal mechanical stop Setting them up ROBOTC Motors and Sensors Setup window Using Analog and Digital Sensors Using them The SensorValue[] command

Potentiometers Variable Speed Program Arm Control Use the rotation of the potentiometer to control how fast the robots motors spin Arm Control Instead of using the limit switches, use the potentiometer to control how far the arm is allowed to swing up and down

Servo Motors Very similar in appearance to the normal motor Very different in operation Rotates between 0 and 120 degrees Where the motor is set to a “power value” the servo is set to a “position value” -127 = 0 degrees, 0 = 60 degrees, 127 = 120 degrees, ect Servo motors are programmed exactly the same way as normal motors in ROBOTC, so the programmer must know the hardware and intent

Pneumatics

Pneumatics Solenoids operate as Digital Outputs Are plugged into Analog/Digital Ports Are set to open by setting them to 1 Are set to close by setting them back to 0 Demo in ROBOTC

End of Day Challenge Minefield Level 2 Incorporate an autonomous scoring behavior before your tele-operated code begins One “mine” should always be in the same place, near the goal