A tiny turtle robot DEI The University of Padova.

Slides:



Advertisements
Similar presentations
Intermediate Robotics Getting to the Next Level Guiding Question: How might I move the robot consistently, accurately, and predictably? –Review basics.
Advertisements

First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
EducateNXT Follow the Leader Using Bluetooth communication, one robot can be made to follow the actions of a second robot. Features in this presentation:
Dublin Robotics Boosters NXT-Step Programming Workshop.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Computer Science 1000 LOGO I. LOGO a computer programming language, typically used for education an old language (1967) the basics are simple: move a.
Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
Scripts and Flow Control. Scripts So far we have been entering commands directly into the command line But there is a better way Script files (and functions)
The Turtle Laboratory Sequence LMICSE Workshop August , 2006 Villanova University.
Program Design and Development
The Turtle Laboratory Sequence LMICSE Workshop June , 2005 Alma College.
The NXT is the brain of a MINDSTORMS® robot. It’s an intelligent, computer-controlled LEGO® brick that lets a MINDSTORMS robot come alive and perform.
Reviewing Common Blocks for St. Agnes Elementary School Teachers by Jenny Chang Feb. 26th, 2007 USC & University Neighborhood Outreach Robotics STEM program.
LEGO Mindstorms NXT Programming We will be using the Common Palette for our Robots This is how you download your program onto the brick Drag and drop a.
Loops and Switches. 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give.
Robotics Enrichment class Mr. Bosworth. Goals of Class Learn how to build a basic robot that performs various functions Learn how to program robot to.
LabVIEW an Introduction
Program ultrasonic range sensor in autonomous mode
GIRLS Robotic Camp. Let’s Begin Meet and Greet – Camp leaders introduce themselves – Students introduce themselves.
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber.
LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals.
ROBOTICS MY BLOCKS. OBJECTIVES Create, edit and configure a my block Insert a my block inside a program and test its functionality.
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
More switches, Comparison Day 7 Computer Programming through Robotics CPST 410 Summer 2009.
Using Waits, Loops and Switches WAIT please!. Waits, Loops and Switches Pre-Quiz 1. In programming, what is a loop? When is a loop useful? 2. How can.
Robotics Overview of NXT-G Actuators in Mindstorms. Touch sensor Labwork: Right turn. Touch/bump. [Explore move versus Motor Move mini & motor mini. Motor*.]
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
MSW Logo By Awin 9s.
Logo For beginners By Dali Matthews 9S What is logo?
Motors and Sound Troubleshooting Tips. © H-CCS Problem 1 Why can’t I download my program to the RCX?
CONTROL SYSTEMS Control Systems A command is a directive that performs a specific task An argument is a variable that can be used by the function reveiving.
Real-Time Data through Data Hubs. Begin by adding a basic Move block, 5 rotations 75% power.
Conditions and loops Day 4 Computer Programming through Robotics CPST 410 Summer 2009.
According to the image, what is the file name? According to the image, what is the program name? Quiz Example.ev3 Falcon.
Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks.
Castor Bot. Now, we will begin creating a robot Log onto your computer On your screen, click on the website labeled “castor bot” Your building instructions.
Find the Mindstorms Icon on the computer.. To start a new program click go.
LEGO® MINDSTORMS® NXT Move Block.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class3/Lab 2.
Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
Data Hubs and Wires. Begin by adding a basic Move block, 5 rotations 75% power.
Mindstorm NXT-G Introduction Towson University Robotics.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
ROBOTICS Jason Bell Brad Carlson
Lego Mindstorm Robots 9797 kit.  Students will learn how to identify how to detect a change in a condition.  Students will learn where and how to identify.
LOGO WHAT IS IT? HOW TO USE IT AND HOW USEFUL CAN IT BE?
What is it? How to use it and how useful can it be?
Advanced issues in Robotics and Programming Dr. Katerina G. Hadjifotinou Experimental Junior High School of the University of Macedonia.
ADVANCED EV3 PROGRAMMING LESSON By Seshan Brothers Random Block.
EV3 Programming By Dianna de Matos.
How Do You Make a Program Wait?
Introduction to LEGO Mindstorms EV3 What is in the box?
LOGO 32 By: Xenon 9S.
Understanding Communication with a Robot? Activity (60 minutes)
Module 2 Controlling a Lego EV3 Robot
Learning to program with Logo
Learn… Create… Program
Controlling your quadcopter
By Sanjay and Arvind Seshan
Learn… Create… Program
Using Animation and Multimedia
Learn… Create… Program
Learn… Create… Program
Getting started with LEGO EV3 Mindstorms software
Implementing Variables in Your Programs
Controlling your quadcopter
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

A tiny turtle robot DEI The University of Padova

A Tiny RobotTurtle

Objectives A very simple moving robotic construction Straight line and rotation moving allowed The robot can execute single moving commands like a Logo turtle (forward, backward, rotate left and right)‏ For demonstration purposes Logo-like commands are implemented as NXT-G user commands and NXC functions

Building instructions Run the TinyRobotTurtle model using Lego Digital Designer (file TinyRobotTurtle.lxf) (also the local mode is ok)‏ You can run the animation of the building instruction selecting the Building Instruction mode (F7)‏ In the Building Instruction Player you can choose the type (sugg. Vehicles) and how many bricks to be added with each step (sugg. 1..3)‏

Programming with NXT-G We would define:  The 'macro-commands' forward (fd) and back (bk) with a parameter specifying a distance  The 'macro-commands' right and left with a parameter specifying an angle NXT-G supports only user block definitions without explicit parameters We substitute parameters respectively with the common variables Steps and Angle

NXT-G Step 1 a In a new program define the new numeric variable Steps

NXT-G Step 1 b Common variables must be defined with the same name and type in main program and all subprograms

NXT-G Step 2 a Add a Variable block to read the input parameter

NXT-G Step 2 b Set the block as reading the Steps variable

NXT-G Step 3 a Add a Move block to move forward the number of steps specified by the input parameter

NXT-G Step 3 b Select the two output port (A-C) The direction depends on how the motors are put on the robot The power is set on a medium value (40)‏ Brake mode allows a more precise move

NXT-G Step 3 b For simplicity, we decide to set the duration in motor degree units and to make this unit correspondent to the Turtle forward/backward 'unit' In the motor block you can set an arbitrary duration: the actual duration is expressed by the Steps input parameter in motor degree units

NXT-G Step 3 c Connect with a data wire the Variable block output with the Duration input of the Move block Its yellow colour confirms that it is a numeric data wire

NXT-G Step 4 a Select all the blocks and choose Make A New My Block from the Edit Menu Assign Fd as block name and write a description

NXT-G Step 4 b Choose an appropriate icon (you can drag more than one icon)‏ With Finish the block is recorded in your profile and listed as a My Block

NXT-G Step 5 a Define Bk as a new My Block from a new (sub)program similar to Fd but moving the robot backward (a different direction in the Move block)‏

NXT-G Step 5 b Assign an appropriate icon also to this My Block

NXT-G Step 6 a Define two other similar (sub)programs as new My Block named Lt and Rt for the two types of rotations For both commands the input parameter is represented by the Angle common variable which expresses the rotation of the robot turtle in degree We determine experimentally the ratio between the robot and the motor degree units: in the example such a ratio is about 2.22 and, for the sake of precision, the Angle value is multiplied by and then divided by 5600

NXT-G Step 6 b In a new (sub)program define the Angle numeric variable and read it

NXT-G Step 7 a Add a first Math block as a multiplication with the value 12445

NXT-G Step 7 b Connect the output of the Variable block with first operand input (A) of the Math block

NXT-G Step 8 a Add a second Math block as a division with the value 5600

NXT-G Step 8 b Connect the output of the first Math block with first operand input (A) of the second Math block

NXT-G Step 9 a We decide to produce the rotation of the robot controlling singularly each one of the two motors with the same power and opposite direction The synchronization is guaranteed giving the two commands in immediate sequence and waiting for completion only after the second command

NXT-G Step 9 a Add a Motor block for moving backwards the first motor (A) and connect the previous data output to the Duration input

NXT-G Step 9 b Do the same for the other motor (C) but moving forwards and waiting for completion

NXT-G Step 9 c Select all the elements and define the new My Block named Lt

NXT-G Step 10 a The Rt (sub)program is almost identical to Lt: exchange the direction in the two Motor blocks

NXT-G Step 10 b Define a new My Block named Rt with an appropriate icon

NXT-G Step 11 a The demo main program simulates the well known lists of Logo instructions to draw a square with an edge of pixels, forwards and backwards repeat 4 [fd rt 90] repeat 4 [lt 90 bk ] Some sounds are added to separate the various commands

NXT-G Step 11 a Start the program defining the two variables Steps and Angle

NXT-G Step 12 Insert a Loop block with Control type set to Count and Until set to 4 to simulate the repeat command

NXT-G Step 13 Add a Variable block to set the Steps value to 300 (corresponding to a movement of the robot of some centimetres)‏

NXT-G Step 14 a Add a Fd (user) block using the Custom palette

NXT-G Step 14 b Notice that no data wired is usable with user blocks: this is why we use common variables as parameters

NXT-G Step 15 Add a Sound block to produce a Click (!Click sound file) at the end of the previous forward command

NXT-G Step 16 With similar operations add a Variable block to assign the constant 90 to Angle, to rotate right the robot, and to produce a Click sound The first loop is now complete

NXT-G Step 17 Add a Wait block of 2 seconds to separate the two motions

NXT-G Step 18 With similar sub-steps complete the second loop (pay attention to its order of blocks)‏ The last sound file is Applause!

NXT-G Step 19 Now the example is complete Download the program and run it

Programming with NXC To compare the solution in NXT-G with a solution based on a textual language, we use NXC (Not eXactly C) to defined the four basic movements (fd, bk, rt, lt) and the main program

Programming with NXC #define RATIO 12445/5600 void fd(long steps) { RotateMotorEx(OUT_AC, -30, steps, 0, true, true); } void bk(long steps) { RotateMotorEx(OUT_AC, 30, steps, 0, true, true); }

Programming with NXC void rt(long angle) { angle = angle * / 5600; NumOut (0, LCD_LINE1, angle, true); RotateMotorEx(OUT_AC, -30, angle, 90, true, true); } void lt(long angle) { angle = angle * / 5600; NumOut (0, LCD_LINE1, angle, true); RotateMotorEx(OUT_AC, -30, angle, -90, true, true); }

Programming with NXC task main() { repeat(4) { fd(300); PlayFile("! Click.rso"); rt(90); PlayFile("! Click.rso"); } Wait(2000); repeat(4) { lt(90); PlayFile("! Click.rso"); bk(300); PlayFile("! Click.rso"); } Wait(500); PlayFile("! Applause.rso"); Wait(4000); }