7 Radio ControlAn out-of-box VEX Microcontroller comes with basic built-in Radio Control functionalityThe Radio Control Transmitter can be configured to allow some customization of that built-in functionalityStill very limited customizability and usefulness!The ROBOTC firmware enables full customization of how the Radio Control Transmitter signals controls the VEXBy default ROBOTC turns off reception from the transmitter to save battery life during autonomous programmingOne line of code turns it back on
8 Radio ControlOne Transmitter continuously sends out 6 separate values over 6 separate channelsValues range from -127 to 127Doesn’t something else have values that range from -127 to 127?The “crystal” number must match on the transmitter and receiverThe crystal is what controls the frequency of the transmissionOne transmitter can control multiple robots, so be careful in your classrooms13 different crystals/frequencies are available
9 Radio Control ResetSince 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 MappingBe sure to follow along with the Radio Control Setup Video!
11 Radio Control Direct Value Mapping Program Flow Tracing Values from the transmitter are directly used to control the motors (1:1 ratio)Program Flow TracingRadio Control with Wait StatesRadio Control with a Loop (real-time control)Indirect Value MappingValues from the transmitter are modified before being used to control motorsCan make the robot easier to controlAppropriate in situations that require more “delicate” movementsNotice: the robot reads the right side of the equal sign first
12 Advanced Radio Control Attach the Arm!Use the Transmitter buttons to control the armThe Transmitter buttons send values of -127, 0, or 127Would 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: TimersCan be thought of as internal stopwatches (4 available)Like encoders, timers should be “cleared” anytime before they are usedWatch where you clear them!
13 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 pressThe robot won’t start the timer until we say soThe robot also can’t move until we says soProgram Flow TraceCould 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 actionsTurn 90 degrees, move straight forward, ect
14 Advanced Radio Control Assigning a function to a button pressAuto pickup
15 Radio Control Challenges TRC4V Videos (recommended)Watch remaining Control Mapping videos 3-5Race to the FinishRemember to JournalRemember to PseudocodeShut 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
16 Advanced Radio Control Challenges TRC4V Videos (recommended)Watch remaining Radio Control Videos (Control Mapping, Timers, Buttons sections)Minefield Level 1 ChallengeRemember to PseudocodeRemember to JournalRoboDunkFirst try itTele-Operated,then Autonomously
17 Competition Templates VEX Competitions have a “Field Management System” in placeManages when robots are enabled/disabledDetermines whether the robots are in autonomous/tele-operated modeA Competition Template is available that can be programmed in to work with the Field Management SystemContains autonomous and tele-operated sectionsFound in the Sample Programs > Competition folder
18 TroubleshootingStudent: My loop should only be running for 1 minute, but it never stops.
19 Touch Sensors Touch Sensor Check How they work Two Types Front sensor plugged into A/D 1Rear Sensor plugged into A/D 4How they workDigital sensor - Pressed or ReleasedWatch out for “bouncing”Two TypesLimit Switches – on Squarebot 3.0Bumper SwitchesSetting them upROBOTC Motors and Sensors Setup windowUsing themThe SensorValue command
20 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 controlUsing the limit switches to tell the robot when it has reached it’s minimum and maximum points
21 Touch Sensor Challenges Quick-tap ChallengeIncorporating Sensors, Variables, Loops, If Statements, Timers, Boolean Logic, Pseudocoding, and FUN all into one activityAddition & SubtractionEverything you just learned, but with another twist
22 The Ultrasonic Rangefinder Ultrasonic Rangefinder CheckInput wire plugged into A/D Port 5Output wire plugged into INT Port 1How they workSimilar to how bats and submarines workDigital 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 upROBOTC Motors and Sensors Setup windowUsing themBe careful not to use them immediately as your program starts – they take time to initialize and will return negative valuesThe SensorValue command
23 The Ultrasonic Rangefinder Forward until NearMove forward until the robot is “near” an object, then stopThresholdsAutomatic Pick-upForward until Near + picking up the mineAssign to a button
24 Sensor Challenges TRC4V Videos (recommended) Watch Remaining Sensing Section VideosMinefield Level 2 ChallengeRemember to PseudocodeRemember to JournalThe two are not mutually exclusive!The Speed of SoundSonic Scanner Level 2 (Start)
25 Potentiometers Potentiometer Check How they work Setting them up Sensor plugged into A/D 1How they workAnalog sensorMeasures rotation of a shaft between 0 and ~265 degreesReturns values 0 – ~1023Internal mechanical stopSetting them upROBOTC Motors and Sensors Setup windowUsing Analog and Digital SensorsUsing themThe SensorValue command
26 Potentiometers Variable Speed Program Arm Control Use the rotation of the potentiometer to control how fast the robots motors spinArm ControlInstead of using the limit switches, use the potentiometer to control how far the arm is allowed to swing up and down
27 Servo Motors Very similar in appearance to the normal motor Very different in operationRotates between 0 and 120 degreesWhere 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, ectServo motors are programmed exactly the same way as normal motors in ROBOTC, so the programmer must know the hardware and intent