CS 395 Fall 2000 Behavior-Based Robotics Pracitce Quiz 1

Similar documents
Northwestern University CS 395 Behavior-Based Robotics Behavior Design

General Syntax. Operators. Variables. Arithmetic. Comparison. Assignment. Boolean. Types. Syntax int i; float j = 1.35; int k = (int) j;

Robotic Behaviors What makes a robot a robot? It is the ability of the robot to independently accomplish complex tasks. Being able to independently

Positional Motion Profiling for FRC

Indra Works DS Tuning Procedure

Northwestern University -Based Robotics Conflict Resolution

MS4SSA Robotics Module:

6.001 Notes: Section 17.5

In Java, data type boolean is used to represent Boolean data. Each boolean constant or variable can contain one of two values: true or false.

2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)...

CS103 Spring 2018 Mathematical Vocabulary

1.7 Limit of a Function

Everything You Always Wanted To Know About Programming Behaviors But Were Afraid To Ask

Overview of Course. Practical Robot Implementation Details. August 28, 2008

Robotics and Electronics Unit 5

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Laboratory 1: Eclipse and Karel the Robot

Goals: - to be able to recognize the position-time, velocity-time and acceleration-time graphs of each of these main types of motion:

ENGR 40M Project 3c: Switch debouncing

Complex behavior emergent from simpler ones

WIntroduction. Motion Control Architectures. Chuck Lewin, Founder of Performance Motion Devices

Programming Preset Heights in ROBOTC for VEX Robotics By George Gillard

Polygons and Angles: Student Guide

Last update: May 6, Robotics. CMSC 421: Chapter 25. CMSC 421: Chapter 25 1

Robotics 2c. The Programming Interface

Selection of controllers and integrated systems

In this lecture we cover a number of networking issues pertinent to the support of distributed computing. Much of the material is covered in more

Program your face off

Make your own secret locking mechanism to keep unwanted guests out of your space!

Pong in Unity a basic Intro

Sphero Lightning Lab Cheat Sheet

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between

Automatic Pouring Robot. Akilah Harris-Williams Adam Olmstead Philip Pratt-Szeliga Will Roantree

Homework 13: User Manual

Appendix C: HVAC PRO Modules

An Epic Laser Battle

CS 142 Style Guide Grading and Details

EEL 5666C FALL Robot Name: DogBot. Author: Valerie Serluco. Date: December 08, Instructor(s): Dr. Arroyo. Dr. Schwartz. TA(s): Andrew Gray

Fraction Addition & Subtraction

Velocity: A Bat s Eye View of Velocity

Section 3 Board Experiments

Intro. Scheme Basics. scm> 5 5. scm>

Advanced Debugging I. Equipment Required. Preliminary Discussion. Basic System Bring-up. Hardware Bring-up, Section Plan

LEGO Energy Meter. How to Get Started

Tech Tips. BeeBots. WeDo

Programming Project #2: Solving Quadratic Equations Date Due: Monday 25 September 2017

Steering 1. from Millington, "Artificial Intelligence for Games", MKP 2006.

Robotics/Electronics Review for the Final Exam

For this chapter, switch languages in DrRacket to Advanced Student Language.

(Refer Slide Time 00:01:09)

CS 3L (Clancy) Solutions and grading standards for exam 1

STEP 1: MODULE MOUNTING / WIRING:

CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist

Recursively Enumerable Languages, Turing Machines, and Decidability

Robotic Motion Planning: Review C-Space and Start Potential Functions

ACTIVITY 2: Reflection of Light

The Beginners Guide to ROBOTC. Volume 2, 3 rd Edition Written by George Gillard Published: 18-July-2016

Jerry Cain Handout #5 CS 106AJ September 30, Using JSKarel

SPARTAN ROBOTICS FRC 971

Total Score /15 /20 /30 /10 /5 /20 Grader

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003

LEGO BB-8 Release: LEGO BB-8. Learn how to automate a LEGO BB-8for motion, light, and sound using Crazy Circuits. Written By: Joshua

OrbBasic LESSON 1 Goto and Variables Student Guide

Contents. Important Safety Notice. Your dash cam Introduction What's in the box

Big Picture: Overview of Issues and Challenges in Autonomous Robotics + Impact on Practical Implementation Details

WebRTC: Possible? Don McGregor Research Associate MOVES Institute.

Embedded Systems and Software

MCS 118 Quiz 1. Fall (5pts) Solve the following equations for x. 7x 2 = 4x x 2 5x = 2

HOBO Motor On/Off Data Logger (UX90-004x) Manual

Chapter01.fm Page 1 Monday, August 23, :52 PM. Part I of Change. The Mechanics. of Change

MegaPi Born to Motion Control

Interlude: Expressions and Statements

COMP 410 Lecture 1. Kyle Dewey

Week 5, continued. This is CS50. Harvard University. Fall Cheng Gong

CS12020 (Computer Graphics, Vision and Games) Worksheet 1

RE: ENSC 340 Functional Specification for Automated Air Hockey Player

Clearpath Communication Protocol. For use with the Clearpath Robotics research platforms

Session 4 Starting the Air Raid Game

MATLAB TUTORIAL WORKSHEET

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

Earthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way

KNOCK LOCK MAKE YOUR OWN SECRET LOCKING MECHANISM TO KEEP UNWANTED GUESTS OUT OF YOUR SPACE! Discover: input with a piezo, writing your own functions

WEEK 9 TCP/IP, PHYSICAL AND DATA LINK LAYERS

Getting Started Guide

Some Notes on R Event Handling

LME Software Block Quick Reference 1. Common Palette

RMCWin. WalkThrough. This document is intended for walking through RMCWin with customers over the telephone/internet.

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Interrupts, timers and counters

C - Colour Mixing. Let's use the Sparkle module and some switches to make a colour mixer! 2018 courses.techcamp.org.

Getting Started in RobotC. // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run

BONE CONTROLLER ASSET VERSION 0.1 REV 1

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning

Self-Correcting Projectile Launcher. Josh Schuster Yena Park Diana Mirabello Ryan Kindle

IVR: Open- and Closed-Loop Control. M. Herrmann

Report on Periscope booth project Study group: International Design Project 2016: Team A

CMSC 201 Fall 2016 Lab 09 Advanced Debugging

Title: Counting While Loops

Making a One Degree Motor Arm with Potentiometer and PID

Transcription:

CS 395 Fall 2000 Behavior-Based Robotics Pracitce Quiz 1 This is longer than a real quiz would be. Question 1 (30 points) You have a robot equipped with a heat-sensing camera that can track people. You want to write a program to follow a person around. You run the following behavior on the robot: (define-signal follow-person (behavior see-person? (rt-vector (* person-heading rotate gain) (let ((range-error (- person-range desired-range))) (+ (* range-error range-p-gain) (* (integral range-error) range-i-gain)))))) The robot successfully tracks you and follows you. However, when you stop suddenly, it keeps driving and rear-ends you. Explain each of the following in one sentence of less than 20 words. Assume that the tracking system is working perfectly and that the control loop is operating at high frequency so that the problem is not lag-related. A. Why does the robot collide with you even though it contains a feedback loop to keep you at a specified distance? (10 points) Answer: There are two different ways of thinking about this. Either answer would be acceptable: The integrator is charging up and can t discharge until it s seen a lot of errors of the opposite sign, that is, until it s been too close for long enough to reduce the integral. Or more compactly: PI control is intended for tracking objects with a constant velocity. B. How can you modify the system to prevent this failure mode without adding any additional sensors or sensory processing? You need not write any code for this (although you may if you want). It is sufficient to explain what needs to be done in one English sentence. (10 points) Either: Don t use PI control, or Reset the integrator somehow if the distance to the target becomes too small. Other solutions are probably possible too. C. Explain how your proposed modifications will hurt other aspects of the robots' performance (if they will at all) (10 points).

If you get rid of PI control, and just use P control, then the robot will always lag the target by an amount that depends on the target s velocity. If you reset the integrator, it will lead to jerky motion, since the translational velocity will be discontinuous. Question 2 (10 points) Consider the following freespace follower: (define-signal follow-freespace (behavior #t (rt-vector (* (- left-distance right-distance) rotate-gain) (let ((distance-error (- distance-ahead goal-distance))) (cond ((< distance-error 5) (* distance-error low-translate-gain)) ((and (> distance-error 5) (< distance-error 20)) (* distance-error medium-translate-gain)) (else maximum-translate-velocity))))) Assume that left-distance, right-distance, and distance-ahead are the amount of freespace ahead and to the left, ahead and to the right, and directly ahead of the robot, respectively, and assume that they are functioning properly. You find that this program works well, but once in a while it inexplicably charges into the wall at high speed, then backs up slowly, then behaves more or less normally. Explain why in one sentence of 20 words or less. ANSWER: The problem is that neither of the first two cond clauses catch the case where distanceerror is exactly 5, so it falls through to the else clause. The fix is to change either the <5 test or the >5 test to be <=5 or >=5. Of course, this question isn t specific to robotics, but it is important that you be able to fix mundane errors in your robot code Question 3 (20 points) Suppose you try to write a wandering behavior as follows: (define-signal wedged? (and (< distance-ahead 20) (= left-distance right-distance))) (define-signal unwedge (behavior wedged? (rt-vector 200 0))) (define-signal wander (behavior-or unwedge follow-freespace)) This program seems to work well except that when it drives up to a wall, it goes postal: it jerks to one side, then turns back, then jerks again, on and on until you kill it. Assume follow-freespace behavior has

been fixed, so the error must be in unwedge or in the way the two behaviors are combined. Explain in one sentence of 20 words or less: A. Why it does this stupid thing (hint: what's the name of this phenomenon?) (10 points) ANSWER: The phenomenon is called chattering. In this case it s due to using exact equality in the wedged? test. B. How to fix it (10 points) Change the equality test to something looser, i.e. (< (abs (- left-distance right-distance)) threshold). Question 4 (10 points) Desired trajectory Low gain High gain Consider the freespace follower from question 2 and assume that the translation control bug has been fixed. Again, you find that it mostly works well, but that it doesn't corner well. When it comes to a corner, it: Starts turning slowly, but then overshoots the corner Comes to the far wall and has to stop driving forward However, it keeps turning until it's finally unblocked (see figure, dashed line). You try to fix this by raising the rotate gain. While this causes it to corner well, it oscillates when going down a straight corridor (see figure, dotted line). Explain how to make it corner well without oscillating badly or getting blocked (solid line in the figure). Limit your explanation to one sentence of less than 20 words. If you prefer, you may give the appropriate code for the rotation signal. ANSWER: Make the rotate gain dependent on the center-distance, i.e. (define-signal rotate-gain (if (< center-distance threshold) high-gain low-gain))

Question 5 (20 points) Base Turret Tazer Direction of forward motion Heat sensor You're building a robot for the design competition. This year's event is the Faculty Safari, in which you build robots to roam the halls of the CS department, hunting and subduing faculty members. You robot is an RWI base like the ones you've been using in class that runs a sonar-based wandering program. You've added a turret built from a Futaba model airplane servo motor. Futabas are integrated servo-motor packages that contain a motor, a drive-train, a position sensor, and a P controller implemented using an analog circuit. The Futaba takes an analog signal that specifies the direction the servo should point in. The analog P controller generates the appropriate drive signals for the motor to turn it to the right position. Futabas are cheap, fairly strong, and quite fast. However, they have bad drive trains. Their cheap plastic gear boxes are noisy and inefficient. They are also inaccurate because their bearings contain enough friction to make them stop short of their set-points. For example, when moving from 0 degrees to 90 degrees, a Futaba might stop at 85 degrees because the error is small enough that the output of the analog P-controller is insufficient to overcome friction. Your robot has a turret-mounted directional heat sensor that reports the direction (in the turret's coordinate system) of the strongest heat source, and a turret-mounted air tazer that fires a pair of high-voltage electrodes at the rapidly fleeing faculty member. You use the wandering program above to drive around in search for faculty, and you add to it the following behavior to shoot them: (define-signal zap-ian (behavior #t (turret-motor-vector ;; How to turn (integrate (if see-heat? (* heat-bearing rotate-gain) 0)) ;; When to fire (and see-heat? (= heat-bearing 0)))))

Assume that: turret-motor-vector takes a rotational velocity and a fire control signal (a Boolean), respectively, as arguments. heat-bearing gives the direction of the heat source, assuming there is one, relative to the turret's current direction. Thus, if the heat source is dead-ahead, it reads zero, otherwise it returns a positive or negative number giving the number of degrees error in the current turret orientation. If there is no heat source, it returns a random number. The integrator is used because the turret's Futaba needs a position signal, but the heat-bearing signal only gives a position error. In theory, the rotate-gain could be 1 and the turret would always point to the target within one cycle of the control loop. However, there is enough lag in the system that this leads to oscillation. So a small rotate gain is used to ensure stability. Answer each of the following questions in one sentence of 20 words or less. A. It almost never seems to shoot, even when you stand there like a sitting duck. Why? (10 points) ANSWER: Because a P controller never completely cancels the error, yet the fire controller requires heat-bearing to be exactly 0. B. When a person walks into the area, the turret seems to notice them, turn more or less toward them, and stop. However, after a little while, the turret will suddenly "twitch" to one side of the target and stop. After a while, it twitches again to the other side. It seems to continue this behavior indefinitely: it sits still for a while, then suddenly moves to the opposite side, over and over again. Explain why. What is this phenomenon called? (10 points) It s chattering because of integrator wind-up due to stiction. C. Explain how to stop the twitching. You may give code, or a single English sentence. (10 points) Use conditional integration so that it only integrates the error when it is over some threshold. (This can be done by wrapping the argument to integrate in a call to suppress-weak). Question 6 Give the equivalent C, C++, or Scheme code for the following program. You need not give the same code that the GRL compiler would generate, simply a program that has identical behavior. (define-signal wedged? (> (true-time (< center-distance 30)) 500)) (define-signal unwedge (behavior wedged? (rt-vector 2000 0))) (define-signal follow-freespace (behavior #t (rt-vector (* (- left-distance right-distance) rotate-gain) (* (- center-distance stopping-distance) translate-distance))))

(define-signal base-controller (drive-base unwedge follow-freespace)) Note that we have not given definitions for most of the signals here. If the definition isn t given for a signal, just assume that its current value is always in a global variable with the same name as the signal. So if writing in C, the current value of the signal center-distance would always magically be in the C variable center_distance. (Pretend, for example, that there s a separate thread computing and recomputing it asynchronously). You should also assume that: The translational and rotational velocities of the base are set by calling the procedures settranslate-velocity! and set-rotate-velocity!. (If you re writing C code, then they would be set_translate_velocity and set_translate_velocity). You can get the current time (in milliseconds) by calling the procedure ms-clock (or ms_clock, if you re writing C). ANSWER: void main() { int onset=0; int msclock; int wedged, rotate, translate; } while (1) { msclock = ms_clock(); if (center_distance>=20) onset = msclock; wedged = msclock-onset>500; if (wedged) { rotate = 2000; translate = 0; } else { rotate = (left_distance-right_distance)*rotate_gain; translate = (center_distance-stopping_distance)*translate_gain; } set_rotate_velocity(rotate); set_translate_velocity(translate); }