wiki:SoftwareOverviewControl

Version 17 (modified by David Albert, 8 years ago) (diff)

--

Robot Control

FRC robots are controlled by an on-board computer and operate in one of two main modes:

  • Teleop - Remote control like driving a radio-control (R/C) car
  • Autonomous - The robot operates independently according to programmed instructions

Teleop Control

FRC Driver Station In many ways, a robot in teleop mode is like a big, sophisticated remote-control car. When an FRC robot is in Teleop mode, a human driver stands at a Driver Station (see picture to right) and uses a laptop running special software and joysticks or gamepads to control the robot.

The driver station laptop typically displays status information about the robot and can display video streaming from the robot's cameras. The human driver watches the video and controls the robot using joysticks or a gamepad to remotely drive the robot and operate its mechanisms. The picture to the right shows a driver station ready to run at a competition. Teams typically use one or two joysticks to drive the robot; with two joysticks, one controls the left motors and the other the right motors in an arrangement known as tank drive. A second human player often operates another joystick or gamepad to control mechanisms (arms, turrets, shooters, etc.) on the robot.

In competition scenarios, drivers must often operate the robot while it is obstructed from direct view (e.g. behind a structure); in these cases, the streaming video from the robot is critical to successful driving.

Exercise: Drive a robot (ask for a senior student or mentor for help)

  • Materials Needed: robot with camera, freshly charged battery, driver station, mentor or senior student
  • Activities:
    • Connect/install battery in robot
    • Turn on robot using main breaker
    • Turn on driver station laptop
    • Establish wireless link between driver station and robot
    • Drive robot
    • Drive by wire (watching only the streaming video from the robot)
  • What happened: The driver station provides controls and wireless communications allowing a human driver to operate the robot remotely.

Autonomous Operation

At the start of each competition, the robot is placed in "autonomous mode" where it operates independently to perform a sequence of required tasks. The autonomous operation is controlled by the robot's on-board computer running software that monitors the robot's environment using sensors and interacts with it using actuators (e.g. motors) driving mechanisms (arms, levers, etc.). To accomplish tasks, the software must determine the robots location and position, locate the objects it must interact with, move to them and manipulate them with its actuators, all without human intervention.

Autonomous operation is among the most advanced aspects of FRC competition; the Autonomous portion of each competition is short (15 seconds at the start of each 150 second match) and the robot earns points for each task it accomplishes independently.  Because many teams are not able to field robots with sophisticated Autonomous operation, point values are often high, even for relatively simple tasks.

http://files.shandymedia.com/wp-content/uploads/2017/07/26090104/Terminator.jpg

Exercise: robot turtle

The simplest example of programming a robot for autonomous operation is "turtle graphics" where you program a robotic turtle to draw things using a pen attached to its tail. You give the robot simple instructions like (RIGHT 90 to tell the robot to turn 90-degrees to the right) and the robot does whatever you tell it to with the pen dragging behind it. If you give the robot clever instructions, you can make it draw anything.

  • Materials needed: computer with web browser and internet connection, patience
  • Activties:
    • Launch browser and go to the the robot turtle simulator
    • Open the list of commands you can use to control the turtle in a separate tab or window
    • Click the "Start a new drawing" link
    • In the box on the right, enter a set of instructions for the turtle robot; you can see examples here
    • Click the Draw It button to see the results
    • Experiment, look at and try examples
  • What happened: Using simple instructions, you can program a robot to operate autonomously and achieve surprisingly sophisticated results.

Software is Complex

It's important to note that the robot turtle exercise involves an ideal robot operating in an ideal world. Much of the complexity of software involves its need to interact in the real world. For example, the robot turtle:

  • has no obstacles to avoid
  • doesn't need to find targets
  • walks on perfect terrain
  • moves precisely how you instruct it

By contrast, for a real robot, even simple things like moving forward in a straight line are quite complex:

  • The motors that power each wheel vary slightly in speed and strength so applying the same power to each motor will cause the robot to turn, not go straight
  • Robot wheels don't have equal traction with the ground (especially if the robot has no mechanical suspension)...if the robot isn't perfectly level and balanced (which it never is), one wheel on a 4 wheel robot may have little or no traction at all!
  • The terrain the robot is traversing may have obstacles, bumps, ramps, etc.

So even the act of driving forward in a straight line is challenging. Control Systems students must write software that uses sensors to continuously monitor the robot's environment while adjusting power to each motor to achieve the desired results. Examples of sensors include:

  • a compass to determine orientation
  • a gyroscope to determine when the robot is turning
  • wheel encoders to determine how fast each wheel is turning
  • laser rangefinders to determine how far the robot is from objects around it
  • intelligent vision systems to identify targets


This should give some appreciation for the challenges facing self-driving cars which are essentially robots that carry people.

Attachments (1)

Download all attachments as: .zip