Robotics Week 3 beginning wheel control

Slides:



Advertisements
Similar presentations
Graphical RobotC NXT (EV3) Robot Workshop 2015 Instructor: Dr. Fred Brauchler Assistant: Chris Parker 2/7/2015Lawrence Technological University1.
Advertisements

Navigating the BOE-BOT
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.
Motor control drive in circles Pragmas configure motors Turning right in function of time Turning left in function of time Main program starts from here.
RobotC Programming for LEGO Mindstorms NXT Carnegie Mellon Dacta Lego Timothy Friez Miha Štajdohar SOURCES:
Right Face Introductory Presentation. Opening Activity How can you use this to make a right turn program? This is your program from Full Speed Ahead to.
Diameter, Circumference, and Rotational Sensors Robotics Academy All Rights Reserved.
EV3 Software EV3 Robot Workshop 2015
  investigate the relationship between the diameter and circumference of a circle.
Math Circumference of Circles & Area of Circles. Vocabulary A circle is the set of all points in a plane that are the same distance from a given point,
Getting Started! Lego Mindstorms Program NXT 2.0.
Application of Math and Science Principles Creating a robot that moves a specified distance straight ahead and Creating a robot that turns a specified.
Measured Turns Introductory Presentation. Opening Activity In the Right Face Activity, we made our robot turn right using the program below.
In the original lesson we learned that a robot should move forward a specific distance for each rotation. That distance traveled is equivalent to the.
Simple Pi Challenge! Pi = 3.14 Diameter = 5.6 cm Distance Robot Travels in 1 Rotation = 3.14 * 5.6 cm 3.14 * 5.6 = cm Circumference = Pi * Diameter.
Minds and Computers 3.1 Preview Spin left motor Spin right motor Wait until the motors have spun two rotations Stop left motor Stop right motor What five.
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
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.
Working Backwards Finding Circumference From Area.
Find the Mindstorms Icon on the computer.. To start a new program click go.
Circumference and Area of Circles Math 7. Vocabulary circle centerA circle is a set of points in a plane that are the same distance from a given point,
By Droids Robotics INTERMEDIATE PROGRAMMIN G LESSON MOVE DISTANCE MY BLOCK (MOVE_CM)
EV3 Software EV3 Robot Workshop
ROBOTC Software EV3 Robot Workshop
Tutorials NXT-G / EV3 Programming. Tutorials NXT-GEV3.
ROBOTC Software EV3 Robot Workshop Lawrence Technological University.
Estimating the Area of a Circle Math 8 Stewart COPY SLIDES THAT HAVE A PENCIL.

MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
Do Now:. Circumference What is circumference? Circumference is the distance around a circle.
EV3 Programming: Moving and Turning CONFIDENTIAL © 2014 Cymer, LLC.
Bot Shop Jane Taylor Dee Wallace Robot C For Vex.
+ Math Module 1 Rates of Change & Mathematical Models.
Variables. A variable is a space in your robot’s memory where you can store data, such as whole numbers, decimal numbers, and words. Variable names follow.
Robotics Starter: Quiz Review
Calculating Rotations for Turns
INTERMEDIATE PROGRAMMING Lesson
Measurement: Circles and Circumference With Mr. Minich
Understanding Communication with a Robot? Activity (60 minutes)
Robo-Math How Far? The Distance a Robot Travels in One Rotation of the Motor = The Circumference of the Wheel Circumference (of the Wheel) = Diameter (of.
Introductory Presentation
Module 2 Controlling a Lego EV3 Robot
Surface Area and Volume
Introductory Presentation
Measured Turns.
PROMGRAMING YOUR ROBOT
Autonomy using Encoders
Introductory Presentation
Introductory Presentation
INTERMEDIATE PROGRAMMING LESSON
FeMaidens Programming
INTERMEDIATE PROGRAMMING LESSON
Repeating Behaviors.
SENSORS.
Which way does the robot have to turn to get to the charger?
RobotC While loop When and how to use the while loop
Robotics Programming Using Shaft Encoders
Robotics Programming Using Shaft Encoders
Robotics Week 6 line follower
Robotics Week 4 Functions and reusable code
Compiled from various Internet sources Presented by Mr. Hatfield
Robotics Week 2 Getting Started Using the Display
Circumference of circle Application
RobotC Programming for LEGO Mindstorms NXT
Compiled from various Internet sources Presented by Mr. Hatfield
Wheels and Distance.
NOTES 10.9 Circumference and Arc Lengths.
BEGINNER PROGRAMMING LESSON
My first robot programming - Simple “GoTo”
Presentation transcript:

Robotics Week 3 beginning wheel control Compiled from various Internet sources Presented by Mr. Hatfield Robotics Week 3 beginning wheel control

Motor Control Motor control is both easy and difficult in ROBOTC. In it’s simplest form Motor[motorC] = 50; Will cause motorC to run at 50% power, unfortunately only for one millisec. Power can be between -100 and 100

How Long to Run So we add a sleep command to cause Motor command to continue. Motor[motorC] = 50; sleep(5000); //5000 miliseconds or 5 sec. Now motorC will run for 5 seconds, the sleep command causes it to do what it was doing for as long as it is told.

What About 2 Wheels Easy, just add another Motor command Motor[motorB] = 50; Motor[motorC] = 50; sleep(5000); //5000 miliseconds or 5 sec. Now both motorB and motorC will move at 50% power for 5 seconds

Can I Go Backwards Yes, reverse the power in the Motor command Motor[motorB] = -50; Motor[motorC] = -50; sleep(5000); //5000 miliseconds or 5 sec. Now both motorB and motorC will move backwards at 50% power for 5 seconds

Can I Go a Certain Distance Not directly with a ROBOTC command however with a little math and a couple ROBOTC commands you can. ROBOTC offers the ability to turn as specific number of degrees of rotation. If you know the circumference of your wheel then a simple calculation will give you a distance.

Distance to Travel Equals Rotations * Circumference (Degrees / 360) * Circumference (MotorEncoder / 360) * Circumference Which leads us to: MotorEncoder = (360 / Circumference) * Distance to travel

Show Me an Example First lets look at making the motor go a specific number of degrees, say 720 or two full rotations (this will cause the robot to turn) //Resets the motor encoder using the resetMotorEncoder command resetMotorEncoder(motorC); //While the encoder for the motorC is less than 720 while(getMotorEncoder(motorC) < 720) { //Move the wheel motor[motorC] = 50; } //Stop the motors motor[motorC] = 0;

Show Me an Example Lets make the robot move forward by moving both wheels at the same time (it is not necessary to reset the motor encoder on both wheels.) //Resets the motor encoder using the resetMotorEncoder command resetMotorEncoder(motorC); //While the encoder for the motorC is less than 720 while(getMotorEncoder(motorC) < 720) { //Move the wheel motor[motorC] = 50; motor[motorB] = 50; } //Stop the motors motor[motorC] = 0; motor[motorB] = 0;

Move the Robot 10 cm //causes the robot to move forward 10 cm float d = 10; //Distance for robot to travel in cm float dia = 5.6; //Standard EV3 wheel diameter in cm float pi = 3.14; //PI approximation float circ = pi * dia; //calculate the circumference float deg = (360 / circ) * d; //calculate the circumference //Resets the motor encoder using the resetMotorEncoder command resetMotorEncoder(motorC); //While the encoder for the motorC is less than 720 while(getMotorEncoder(motorC) < deg) {//move until requested deg motor[motorC] = 50; motor[motorB] = 50; } motor[motorC] = 0; motor[motorB] = 0;

Try To: Move the robot forward 20 cm Move the robot backward 20 cm Do both of the above Make the robot turn left then right Make the robot turn left 90 degrees Make the robot travel in a square Make the robot dance

Congratulations!!! I am assuming that you have a functioning EV3 with ROBOTC I am assuming that you were able to make your robot move according to the instructions in the previous slide