Download the GOTO BEACON program from the E10 website, Robot lab section,

Slides:



Advertisements
Similar presentations
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Advertisements

1 Signals, Circuits, and Computers John Athanasiou Part B Spring 2010.
MOTION CONTROL ECE 105 Industrial Electronics Engr. Jeffrey T. Dellosa College of Engineering and Information Technology Caraga State University Ampayon,
PHY 235 Robotics Workshop Day 3 IR Distance Sensing.
EML 2023 – Motor Control Lecture 4 – DAQ and Motor Controller.
Photos and Sensor Instructions
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Digital Tachometer ENGR 4803 Electromechanical Systems & Mechatronics.
IR Receiver Board. Global Variables Main() for GOTO_Beacon Program Call three functions Note: you need to change freq for the beacon you want to find!
Programming Concepts C: GOTO_Beacon ENGR 10 Introduction to Engineering 1.
Introduction to Sensors
Lightning Detector Michael Bloem December 5, 2002 Engr 311.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Robotics Day4.
Testbed: Exercises.
Program ultrasonic range sensor in autonomous mode
Programming Concepts Part B Ping Hsu. Functions A function is a way to organize the program so that: – frequently used sets of instructions or – a set.
ROBOTC for VEX On-Site Professional Development
Introduction to Engineering Lab 4 – 1 Basic Data Systems & Circuit Prototyping Agenda REVIEW OF LAB 3 RESULTS DEFINE a DATA SYSTEM  MAJOR TYPES  ELEMENTS.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
Available at: Lesson 3.6 – Program Line Follower in Autonomous Mode Program Line Follower in Autonomous Mode.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Introduction to Robo Pro
10/10/ Controlling YOUR ROBOT. 10/10/2015 Basic Stamp  Basic Stamp Input - output pins Interpreter Chip Power supply: 5 Volts voltage Memory: EEPROM.
Forging new generations of engineers
Vex Robotics Programming Sequence. Now that you’ve had some practice downloading and using the included programs, it's time to learn to write some of.
7.2 V battery pack and charger Put the battery in the charger station at the end of the lab. period. Red light indicates charging. Ken Youssefi Introduction.
Programming Design ROBOTC Software Principles of Engineering
Robot C and Natural Language
1 Lecture on Lab 6 Lab 7 Lab 8. 2 Lab 6: Open Loop Controller As you learned in lab 5, there are two kinds of control systems: open loop and closed loop.
Trash2D2 Oral Report 1 IMDL David Mercado. Objective #1: Hold Trash Robot Body – Trash Can ▫Sturdy Outer Body ▫Inner Cavity Holds 13 Gallon Bag ▫20 Gallon.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
Photos and Sensor Instructions
Variables and Functions ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
Figure 12.1 The UP1-bot. Figure 12.2 Left: Radio Control Servo Motor and Right: Servo with Case and Gears Removed.
PROMGRAMING YOUR ROBOT How Servos Work: How to control your robot.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4/Lab3.
Vex Robotics program three: using motors and sensors together.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
Mechanical Components and Programming Ken Youssefi Introduction to Engineering – E10 1.
Testbed Coding In this activity you will code different challenges for the Testbed. For each challenge a sample program is shown. Use what this sample.
ROBOTC for VEX Online Professional Development. Homework Questions Thoughts? Questions?
Introduction to Robots and the Mind - Sensors - Bert Wachsmuth & Michael Vigorito Seton Hall University.
Introduction to VEX® components
Programming Design ROBOTC Software. Behavior-Based Programming A behavior is anything your robot does –Turning on a single motor or servo Three main types.
Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
Mechatronics – a design process that includes
Programming Design ROBOTC Software Principles Of Engineering
Introduction to Programming in RobotC
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Timers and Event Counters
ROBOTC for VEX Online Professional Development
Vex Ultrasonic Sensor (US) Interfacing and Programming
Programming Design ROBOTC Software Computer Integrated Manufacturing
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Automation and Robotics
Module F: Presentation Understanding Robot Fundamentals
Download the GOTO BEACON program from the E10 website, Robot lab section,
Controlling YOUR ROBOT
An Introduction to VEX IQ Programming with Modkit
Storing Values as Variables
Line Following Behavior
Programming Design ROBOTC Software Principles Of Engineering
Photos and Sensor Instructions
ENGR 1 Presentation Thomas Matthews.
An Introduction to VEX IQ Programming with Modkit
Obstacle Detection.
Programming Design ROBOTC Software Principles of Engineering
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Lego MINDSTORMS EV3.
Presentation transcript:

Programming Concepts Part C GOTO_Beacon ENGR 10 Introduction to Engineering

Download the GOTO BEACON program from the E10 website, Robot lab section, Old controller New controller (Cortex)

Main() for GOTO_Beacon Program Note: you need to change freq for the beacon you want to find! Global Variables Infinite loop Call three functions

Cortex Main() for GOTO_Beacon Program The only difference between the two programs are the port assignments Move function Motor ports 1 and 10

The main body of the GOTO_Beacon program is an infinite loop with three functions in the loop While Loop (1==1) { Read_PD(); //read 8 Photo-detector outputs find_max(); //find the max detector output move(); // move to the direction of max PD } PD7 PD0 PD4 Right side Left side

Read_PD() This function reads the intensity of all 8 Infrared Photo-Detectors and stores the intensity (0 to 1023) into PD0~PD7 variables. It also produces the sum of all 8 readings (PD_sum). The sensing sensitivity is set by expose_time. This function reads the intensity of either 1kHz or 10kHz infrared signal depending on the setting of digital output port 14, 12 on Cortex, (0=1kHz , 1=10kHz). You should set the digital output port #14 (#12 on Cortex) to the intended frequency before this function is called. find_max() This function determines which variable (among PD0~PD7) has the greatest value. The PD number is saved in the variable max_no.

move() If PD_sum < Ambient (noise level, 200), the robot spins at the speed spin_speed (50). If PD_sum > Ambient (beacon is in view), go forward at speed of forward_speed (35). Turns the left wheel faster if max_no (PD #) <4 Red beacon Turns the right wheel faster if max_no > 4, same speed if max_no = 4 Slows the forward motion to slow_speed if PD_sum > slow_level (5000) Stop if PD_sum > stop_level (6000) PD4 PD0 PD7

Read_PD() Function 1 1 Wed 4/8

Main() for GOTO_Beacon Program Find maximum intensity

find_max() Function PD0

Main() for GOTO_Beacon Program 4/13 Move the robot

Move() Program

limit_pwm() Program

if motor 2 is on the left side the robot turns right Example PD2 reads max intensity  max_no = 2  error = 4-2=2  steer=error*steer_sensitivity=2*20=40 Motor2 speed = 127+40+35=202, Motor3 speed=127+40-35=132, if motor 2 is on the left side the robot turns right Mon. 11/2

Cortex Controller PD2 reads max intensity  max_no = 2  error = 4-2=2  steer=error*steer_sensitivity=2*20=40 Motor1 speed = 0+40+35=75, Motor10 speed=0+40-35=5, if motor 1 is on the left side the robot turns right

Try to turn off red beacon. when confirmed, state=3 How to add to the GOTO_beacon program to perform the required task? Use state variable ! Somewhere here, when red beacon is found, state=2. No infinite loop in all blocks! Initialization Read PD(); Find Max(); Move (); While state==1 Find red beacon While state==2 Try to turn off red beacon. when confirmed, state=3 While state==3 Go to green When found, state=4 Find green beacon

Capture green (turn off) , While state==4 Capture green (turn off) , When confirmed. state =5 While state==7 GO home, When confirmed. state =6 STOP

E10 robot, bumper switches, it wonders E10 robot – ultrasonic sensor Hsu/Youssefi

IR Receiver Board

Beacon Frequency Selection (filter) AD14 Freq select (0=1kHz, 1=10kHz) Tuning circuit amplifier To next stage From previous stage AD14 Freq select (0=1kHz, 1=10kHz)

IR Detector Selection Infrared Detectors Selector LEDs counter To next stage 1 1 AD15 pulse AD16 Counter reset 1 Increment count (0 to 1 transition) 1 Count output set to zero Get ready to count

Beacon Frequency Selection (filter) AD14 Freq select (0=1kHz, 1=10kHz) Tuning circuit amplifier To next stage From previous stage AD14 Freq select (0=1kHz, 1=10kHz)

Exposure Control Circuit AD15 From previous stage To AD1 (VEX Analog input) Amplifier 1 Clear ‘film’ (discharge C14) Open ‘shutter’ (allow C14 to charge)