16
2nd Semester 2012 | KOR110S ROBOTINO HANDBOOK

Robotino Handbook

Embed Size (px)

DESCRIPTION

robotica

Citation preview

2nd Semester 2012

|

KOR110S ROBOTINO HANDBOOK

PLEASE READ THE FOLLOWING CAREFULLY

With each Robotino chapter submission you will have to provide a word document. This worddocument is to motivate why you programmed the Robotino as you have. This word document is notmeant to be like a diary entry where you enter what you did with the Robotino today nor is it to tellus what you have learned.The word document is to explain what function blocks were connected to what function block andwhy this was done. You are also to explain from what port to what port on the function blocks youhave connected the “wires” and once again why you did this.

The word document should contain a MINIMUM of 100 words.

SOMETHING else to take note of is that the Robotino sometimes behaves differently on the sim thanit would in real life, so make sure you play with it at each opportunity you get. The majority of thetime the Robotino will only be available to you during the normal KOR110S days (Wednesdays from8:30 – 16:30)

Please ensure that if you have more than one file to submit for the Robotino chapter that you either.rar or .zip them to aid the marking process.

Please remember that the above rules are to help you in your growth process and that itshould in no way spoil your fun with the Robotino as it can be quite entertaining to playwith once you get the hang of it. Enjoy!

Robotino workbook

Chapter 1.1: Introduction to RobotinoRemove Robotino and all of its parts from the box. Place the Robotino on the platform to ensure itdoes not roll off of the table.

Inspect the Robotino and answer the following in a word document:

Number of Omnidrive wheels:Number of sensors:How many buttons on the Robotino:

Once the questions have been answered make sure to install Robotino View 1.7 and Robotino Sim1.2.*

Open the Robotino View and answer the following questions:

How many tabs are there on the right hand side:What button must be pressed to get to help:

Make sure to expand all of the tabs and take note of the operators under them. Click on some ofthem and press F1, this will give more information on the operator.

Now lets write your first program!

Click on the “New function block program” or the icon that represents a white page with a fold inthe top left corner.

Tip1: Each time you create a new function remember to add the bumper operator:The bumper can be found under “Robotino Hardware” and the exit under “Sequence control”.Always use Exit C, this will be explained later on.

Writing the Function:

We will start by creating a function to make the Robotino go forward.

First add the operator Motor, found under “Robotino Hardware”, add three of these, naming themMotor 1, Motor 2, Motor 3 respectively.

Now add the Omnidrive, also found under “Robotino Hardware”.

Connect the Motors to the Omnidrive. Click on the “v1 set” connector of the Omnidrive and connectit to the first motor. Ensure that you connect all 3 motors in a similar fashion before continuing tothe next section.

The Omnidrive needs an input to give an output to the motors. Under “Generators” find constantand add. Then connect it to the Omnidrive and add a value of 100. This can be done in the bottomleft corner. The constant connector must be connected to the “vx set” of the Omnidrive.

Chapter 1.2: Joystick & control panel:Blocks:

Programming: to use the joystick is simple, connect the motors to the omnidrive, then connect thejoystick to the omnidrive, then open the joystick menu(see figure), this is done by double clicking onthe joystick block. In the menu change A,B,C to what output you want it to be, this will also dependon where they connect to the omnidrive, more can be explained in class.

The control panel is another way of controlling the robotino directly:

It can be connected directly to the omnidrive. Then by double clicking on the control panel will openthe menu. When the robotino is connected, the control panel can be used to manoeuvre therobotino.

Subject Line: Robotino Submission 1File Name: Init_Surname_Robotino1

Chapter 2: Velocity

Varying the Robotino’s velocity:

Before we delve into the process of varying the speed of the Robotino. I would like you to firstlyanswer the following question:

Q) In what unit is the Robotino’s velocity measured.

A)___________________________________________________________________________________________________________________________________________________________________.

You‘re probably wondering why only one question. The simplest answer is that whilst consideringyour intended velocity for the Robotino, you must also consider safety in terms of the Robotino andif it were to hit someone. One of the other considerations is how to make the Robotino stop in timeif you want it to stop a certain distance from an object.

The process required to vary the velocity of the Robotino is fairly simple there are multiple methodsof doing so which range from using various input functions, mathematical functions and generatorfunctions.

The one that we will be focusing on will mainly be the generator functions as this makes it easier tocontrol the Robotino with a logical function block program.

Exercise 2.1

For the first exercise of this chapter you will be using the following function blocks.

1)

The sine generator is simply an input that generates a high and low input in the form of asine curve.

2)

The up counter does precisely what it name suggests , it counts up when certain conditions are met.

3)

The omnidrive will be used as indicated in Chapter 1.

4)

3 x Motors to be used as in Chapter 1.

2.1.1) Use the function blocks as stated above to make the Robotino move forward with a velocitythat increments as time passes. It is required that the up counter will have to increment with therising and falling edge. Remember to add a bumper as stated in Chapter 1.

2.1.2) Use the function blocks as stated above in conjunction with the mathematical function blocksof your choosing to make the Robotino move forward in increments of 5 per millisecond. Once againthe up counter is required to increment with the rising and falling edge.

Exercise 2.2

The following function blocks will be required for this exercise.

1) Omnidrive2) 3 x Motors

3)

The constant generator does as it name suggests it generates a constant output signal.

2.2.1) Use the function blocks as stated above to make the Robotino move at a constant velocity inall 4 directions.

2.2.2) Use the function blocks as stated above to make the Robotino rotate clockwise and anti-clockwise at 45ᵒ/s and stop after it has reached 135ᵒ from its starting position. You will also require atime generator as well the greater than or less than mathematical function block.

2.2.3) Use the function blocks as stated above in conjunction with the timer once again and amultiplication function block to increment the Robotino’s velocity in any direction of your choosing.

The importance of the bumper.

It should be quite clear why the bumper is so important. The bumper is a safety feature to protectthe Robotino and anyone it might come into contact with. As with most of the things you will becreating or writing code for during your studies in the Mechatronics course ,and if you complete itthe rest of your career, safety must always be one of your first considerations.

Subject Line: Robotino Submission 2File Name: Init_Surname_Robotino2

Chapter 3: Passive avoidThis chapter explains how to manipulate the direction of the Robotino while it reads the input of thesensor. So by manipulating two sensors values the Robotino can be told in which direction to turn.For now only two sensors will be used, but at a later stage it will be expected to use all the sensors.The hardware that will be needed is:

This is the minimum hardware that will be needed, the distance sensors that can be used is 3 and 8.Tip: Remember that whet the value returned increases it means that the Robotino is moving closerto an object, so the Robotino needs to turn away from that object.Programming: to start we need to add the value of the two sensors together, but first the onesensors value needs to be made negative. This will give us a small value, this value shows us whichway to turn. Depending on which object is closer it will give either a small positive or small negativevalue. When this value is inputted to the omnidrive’s omega pin, the robotino will turn away fromthe object. The robotino will either turn clockwise or anti-clockwise depending on whether it’s apositive or negative value given to the omnidrive. Which value needs to be made negative will takesome experimentation, as well as what value you will need to multiply the signal with. Multiplyingthe signal before it goes to the omnidrive will cause the robotino to avoid the object better, as theamount that it will turn will be greater.

Subject Line: Robotino Submission 3File Name: Init_Surname_Robotino3

Chapter 4: Active Avoidance

Active avoidance is a term used for when the Robotino’s sensor picks up an object it has to avoid,the sensor will be coupled with one of the exits so that in your Flow Control Program (Hence forthreferred to as FCP) the next Function Block Program (Hence forth referred to as FBP) in thesequence may be selected, this next Function Block Diagram will then make the Robotino activelyavoid the object and, if you so choose, continue on its current path or after none of the sensors pickup the object, continue on its original path.

Fig 4.1

Example of the FCPfor the activeavoidance.

In Fig 4.1 above you will notice that the FCP (The option to open new FCP is located in the top,second to left, below file) starts with a Start as all correct flow charts do. The start will then becoupled with your first FBP, in this case the Move Forward FBP.

As you can see from the Fig 4.2 below the Move Forward FBP has 2 Exit points, being A and C.Attached to Exit A in the FCP is the Left or Right Comparison FBP.

Fig 4.2

This is an example of the Move Forward FBP.

Fig 4.3

This is the example of the Left and RightComparison FBP.

The Left or Right Comparison FBP has two greater as Mathematical Function Blocks , as seen in Fig4.3, one used to compare if Distance Sensor 3’s value is greater than that of Distance Sensor 8 andvice versa for the second , in this manner we can determine which side has the greater open spacefor the Robotino to move to.

The first greater as is connected to Exit A that connects to Move Right FBP in the FCP and the secondis connected to Exit B that connects to Move Left FBP. Both of these will continue moving until thedistance sensor return a value greater than 1, at this time it will exit back to the Move Forward FBP(Take note of Fig 4.1 to get an idea of the flow described above).

Exercise 4.1

4.1.1) In this exercise you are required to use a similar method as the one described above to makethe Robotino navigate a maze as seen in Fig 4.4. The Robotino has to continue doing the course untilit has completed the maze twice, once in a forward facing position and then once in reverse after ithas completed the first cycle.

Fig 4.4

Maze that has to be completed

for exercise 4.1

Subject Line: Robotino Submission 4File Name: Init_Surname_Robotino4

Chapter 5: Intro to Camera

5.1 Camera installation

Camera installation is quite easy the Robotino has a L-shaped bracket with a screw thread in it. Takethe camera and place the hole over the screw thread. Now take the thumb screw and it into thethread through the hole of the camera. Now take the USB plug and put it into the USB port locatedto the top right of the Robotino “brain”. Voila you’re done.

5.2 Line Follow

This is quite a short chapter and it’s also quite a short exercise. Click on file located in the top left.Now click open. Your default location should be C:\Program Files (x86)\Festo\RobotinoView\bin.Now go back one, so that you’re in C:\Program Files (x86)\Festo\RobotinoView. Now double clickthe folder called Example. You should see a program called linefollow.rvw, open it.

Exercise 5.1

5.1.1) Your exercise is simple, you have to modify the example linefollow.rvw to make the Robotinoactually follow the line. It appears that the people who created the Robotino weren’t even able tomake it follow the line themselves. Good luck.

One thing to remember, just because the exercise doesn’t make you actually assemble the line followFBP it doesn’t mean that you shouldn’t try to do it yourself without looking at the example. As youwon’t be allowed to look at it in some of your tests.

Subject Line: Robotino Submission 5File Name: Init_Surname_Robotino5

Chapter 6: Colour Detection

For this chapter you will have to understand how to use the Segmenter and SegExtractor. To start offyou have to have the Robotino rotate, then double click on the segmenter. Pause the segmenter byclicking on the camera located in the top left corner of the segmenter properties pane(As seen in Fig6.1). Now click on the dashed square located in the top right of the segementer properties pane(Also in Fig 6.1). Click and drag over the colour you which to select. Now click on the arrow pointingtoward the open space of the segmenter properties pane. You will now see the colour with anumber located in the previously open space.

Fig 6.1

Segmenter Option Pane

1) Freeze Image2) Rectangle Selection3) Selected Colour4) Colour selected with

Rectangle Selection

Now double click the SegExtractor , click on the dropdown bar located in the top right of theSegExtractor option pane and select the colour that you have selected with the segmenter (As seenin Fig 6.2). Now the Robotino is ready to detect the colour.

Fig. 6.2

SegExtractor Option Pane

1) Colour Selection Drop Down2) Red Cross denoting Robotino

Colour detection

Exercise 6.1

6.1.1) This exercise requires you to make the use the camera, segmenter and SegExtractor to detecta colour, this program has to be made entirely by yourself. You are allowed to use the exampledrive2red.rvw as a reference, if you submit the drive2red.rvw as your own work you will receive a 0for this exercise and you will have one count of plagiarism on your name. Two counts of plagiarismagainst you can see you expelled from CPUT. What’s meant by use it as a reference is that youshould try and figure out how it works and construct you own more simple version of this program.If your program looks very similar to the drive2red.rvw it will result in a 0 on this exercise. It is verypossible to make a simpler version of this program, so get cracking.

6.1.2) This exercise requires you to use the program you created in exercise 6.1.1 and modify it sothat the Robotino will cycle between 4 colours. The Robotino has to move to the first colour, onceit’s a set distance away from it the SegExtractor has to move one number up. This has to be entirelydone by your program. So no manual intervention.

Subject Line: Robotino Submission 6File Name: Init_Surname_Robotino6