500 likes | 689 Views
Robo-Didactics Hands-on Session. Example: Robot1. Conceptual. Physical. Programming. Rescue course Calibration Selection Line followers Line followers with 2 sensors Branching Loop While function Line follower with multiple colors. Basic course Build a robot Download and test
E N D
Example: Robot1 Conceptual Physical Programming Rescue course Calibration Selection Line followers Line followers with 2 sensors Branching Loop While function Line follower with multiple colors Basic course Build a robot Download and test Using Iconic language Variables Conditions Calibration Jump instructions Conceptual Programming Dance course Loops Sequences Nested Loops Subroutines Subroutines using variable Soccer course Auto Calibration Subroutines Dynamic Programming Concurrency (Multi Threading) Physical
How to build Robot1 The definition of the robot mission is the preliminary fundamental step for the robot assembly. This allows defining the best arrangement of the hardware and software components.
Robot1 mission Robot1 has to follow a black line on a white plane
How to build Robot1: Basic Components • Control Board* Main Control Board RDC-101 – F1 • Input* 1 Infra-Red Sensor RDI-202 – F2 • Output* 2 Gearbox RDO-501 – F3 • Structural Parts* 1 Universal Plate L RDP-802 – F4* 1 Universal Pillar RDP-803 – F5* 2 Cable 20cm (3-pin) RDP-804 – F7* 2 Cable 30cm (3-pin) RDP-805 – F7* 1 Universal Custer RDP-806 – F6* 2 Tire Set RDP-807 – F8* 1 Serial Cable (6-pin) RDP-808 – F7* 1 Battery Housing RDP-809 – F10 • Comunication* 1 232C Serial Communication Board RDI-301 – F9 • Programming* TiColla Software (CD-ROM) RDP-901 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10
How to build Robot1: tools required Screwdrivers are not in the box Box spanner for M3
Robot1 Conceptual Physical Programming Rescue course Calibration Selection Line followers Line followers with 2 sensors Branching Loop While function Line follower with multiple colors Basic course Build a robot Download and test Using Iconic language Variables Conditions Calibration Jump instructions Conceptual Programming Dance course Loops Sequences Nested Loops Subroutines Subroutines using variable Soccer course Auto Calibration Subroutines Dynamic Programming Concurrency (Multi Threading) Physical
Programming in TiColla • You may program your RDS-X01 robot through the standard TiColla programming language • To program the robot it is necessary to have a clear idea of whatyou would like to do and how you can do it
Programming in TiColla • TiColla is a very simple program language
Phase 1: Installation and Start-up • Insert the CD-ROM and double click on the installer to start the installation process. Follow the install instructions and when asked, choose a path where to install TiColla • Start TiColla • When TiColla opens a project window will open
Phase 2 : Software • Configure the input and output ports of the main control board Click on this picture to see the video robot design
Phase 3: Hardware Connect via software the optical sensor to CN3 and the PWM motor control to CN6. Click on this picture to see the video
Phase 4: Software Click on this picture to see the video
Phase 5: Programming Check for errors. When the program is succesfully completed, no error should appear. Error Check
Phase 5.1: the Program • Is important to • correctly connect the blocks • choose the time for the actions Click on this picture to see the video
Phase 5.2: Pre-download • To download your program from the PC to your robot it is necessary to configure your hardware • The procedure is show below 1) Connect the cable to the main board and to the RS 232 C Serial Communications Board • Connect the cable to the PC and the RS 232C Serial Communications Board
Phase 6: Download The video is showing the download of the program on your Robot. For download it is necessary to have the hardware configuration shown below When the status display LED flashes contemporary, the program is downloading. When they are on, the download is finished.
Robot1 Conceptual Physical Programming Rescue course Calibration Selection Line followers Line followers with 2 sensors Branching Loop While function Line follower with multiple colors Basic course Build a robot Download and test Using Iconic language Variables Conditions Calibration Jump instructions Conceptual Programming Dance course Loops Sequences Nested Loops Subroutines Subroutines using variable Soccer course Auto Calibration Subroutines Dynamic Programming Concurrency (Multi Threading) Physical
Infra-red sensors • The infra-red sensor detects the difference of the brightness of the floor • Infra-red ray is irradiated toward the floor from the installed LED and the amount of reflected infra-red ray is measured in terms of voltage change • If the height of infra-red sensor from the floor is fixed, the amount of reflected infra-red ray could be changed by the difference of reflection and absorption ratio for each color of white or black • The sensitivity of sensor can be modulated through the trimmer. The circuit voltage is set around 5V. If the voltage is around 4V in presence of a black surface, the photovoltaic element is in saturation. The voltage should be gradually varied (turning the trimmer to the right or to the left) in order to reach a value of approximately 2V. Then, repeat the same procedure for the white surface, making the voltage reach about 4V.
Adjustment of an Infra-Red sensor • To program it is important to know the “numerical value” of the voltage corresponding the black or white surface (i.e. analog to digital conversion). • A threshold value xV (4V > xV > 2V ) is set through the program in order to detect the black and the white color. • When the measured analog value is bigger than xV, the color is white; on the hand when the measured analog value is smaller than xV the color is black. • If 5V of circuit voltage is set to 255 and 0V is set to 0, the number of white 4V is “204” and black 2V is “102”. In case of xV=y, the numerical value of threshold is chosen as 204 > y > 102. 5v : White(v) = 255: y
Adjustment of an Infra-Red sensor • When you are using not only black and white line but the different color, how would you do? An infra-red sensor provides in output the amount of reflection of the infra-red ray due to the difference of color or the difference of absorption ratio in terms the voltage change, as in the monochrome case. Thus, a table of colors and corresponding voltage value is prepared. • The table is used for the sensor calibration • If the difference of voltage is small, it is difficult to exactly estimate the color due to the influence of the measure error
Adjustment of an Infra-Red sensor • Because infrared sensor is analog, its outputs are 2V, 2.1V, 2.2V...4V. These values are transformed into a number from 0 to 255 through an ADC • This icon permits, in TiColla, to set a digital signal that comes from an IR sensor
How to build Robot2 The definition of the robot mission is the preliminary fundamental step for the robot assembly. This allows defining the best arrangement of the hardware and software components.
Robot2 mission Robot2 has to follow a black line on a white plane and changes trajectory in presence of obstacles
How to build Robot2: Basic Components • Control Board* Main Control Board RDC-101 – F1 • Input* 2 Touch Sensor RDI-201 – F2* 2 Infra-Red Sensor RDI-202 – F3 • Output* 2 Gearbox RDO-501 – F4 • Structural Parts* 1 Universal Plate L RDP-802 – F5* 1 Universal Pillar RDP-803 – F6* 2 Cable 20cm (3-pin) RDP-804 – F7* 2 Cable 30cm (3-pin) RDP-805 – F7* 1 Universal Custer RDP-806 – F8* 2 Tire Set RDP-807 – F9* 1 Serial Cable (6-pin) RDP-808 – F7* 1 Battery Housing RDP-809 – F10 • Comunication* 1 232C Serial Communication Board RDI-301 – F11 • Programming* TiColla Software (CD-ROM) RDP-901 F1 F2 F3 F4 F6 F5 F7 F8 F9 F10 F11
How to build Robot2: tools required Screwdrivers are not in the box Box spanner for M3
How to build Robot2:Step 1 -Sensors • 2 Touch sensors RDI-201 • 2 Infra-Red Analog sensors RDI-202
How to build Robot2:Touch Sensors 1. It is a simple on/off switch which uses, as touch element, a not-stagnated steel spring 2. If the spring touches an obstacle, the switch turns ON activating the appropriate software
How to build Robot2:Touch Sensors 3. They are mounted in front-lateral position, one at the right side and the other at the left side 4. They are not parallel to the motion direction in order to guarantee a better control of the environment
How to build Robot2:Touch Sensors 5. Assembly process: • Fix the spring to RDI-201A slab • Fix the RDI-201B slab to RDI-201A slab
How to build Robot2:Analog IR Sensor 1. It includes a FotoTransistor as fotosensitive element; 2. The sensor active configuration is required to follow the line. This is done by soldering a IR-LED in the back of the sideboard and by realizing a short-circuit of J1 switch (see the red circles in the figure);
Robot2 Conceptual Physical Programming Rescue course Calibration Selection Line followers Line followers with 2 sensors Branching Loop While function Line follower with multiple colors Basic course Build a robot Download and test Using Iconic language Variables Conditions Calibration Jump instructions Conceptual Programming Dance course Loops Sequences Nested Loops Subroutines Subroutines using variable Soccer course Auto Calibration Subroutines Dynamic Programming Concurrency (Multi Threading) Physical
TiColla Software: Programming The program shown in the figure is used to obtain a fotoattractive Robot2 behaviour
TiColla Software: Programming • The program is made of a loop that starts with the Begin Loop icon [A2]* and finish with the End Loop icon [L10]; • For further details on the software refer to the RDX01 instructions manual • For the interaction with an obstacle the following steps are done: * The symbol in the intra quadrants bracket is for indicating the TiColla Cell programm shown in the previous slide
TiColla Software: Programming 1. Start by reading the digital input CN1 [B2], corresponding to the left lateral touch sensor; 2. If the sensors is ON, the value 1 is on CN1 input and the robot has reached an obstacle. In this case motors M1 and M2 are Backward activated with Slow modality[B4-B5]; the Wait instruction is executed and the program is interrupted for 1 sec (M1 and M2 are still activated) [B6]. After the wait intervall, M1 is Backward activatedwith Slow modality[B7], while M2 is Forward activated with Slow modality[B8]; the inverse motor rotation generates the complete rotation of the robot; M1 and M2 are activated for 0.5 sec (wait intervall) [B9]; the next instruction is the end of the loop [L10] and is connected to Wait by Nop cells. The program returns at Step1.
TiColla Software: Programming 3. If the CN1 sensor is OFF, there are not obstacles on the path; the program controls the CN2 state, corresponding to the right lateral touch sensor [D2]. If the value is 1, then a sequence of instructions as for Step2 is executed, with of exception of [D7] and [D8], which generate a motion in the opposite direction with respect to [B7] and [B8] instructions. 4. If also CN2 sensor is OFF, the software controls the value of CN3, corresponding to the left IR sensor [I3].
TiColla Software: Programming 4.A. If the value of CN3 is less than 200 (which means a voltage of 3.9V and the IR-LED on the black), the program continues in the branch [H3]; the program controls the CN4 value, corresponding to the right IR sensor [G4]; if also this sensor is on the black, then M1 and M2 are Forward activated with Slow modality for 0.1 sec [F5-F7]; else the motors have an inverse rotation for 0.1 sec that generates a rotation of the robot [H5-H7]; the loop is closed in [L10] and the program returns at Step1. 4.B. If the value of CN3 is more than 200 (LED is on the white), the program continues in the branch [L3] and controls CN4 value [M4]. If the LED is on the black , M1 and M2 have an inverse rotation for 0.1 sec, else if Led is on the White, M1 and M2 are Forward activated for 0.1 sec [N5-N7] to follow the black line before the end of the loop in [L10].
Robot2 Conceptual Physical Programming Rescue course Calibration Selection Line followers Line followers with 2 sensors Branching Loop While function Line follower with multiple colors Basic course Build a robot Download and test Using Iconic language Variables Conditions Calibration Jump instructions Conceptual Programming Dance course Loops Sequences Nested Loops Subroutines Subroutines using variable Soccer course Auto Calibration Subroutines Dynamic Programming Concurrency (Multi Threading) Physical
Calibration: Touch sensors • The sensors capability to recognize the contact depends on the point where the spring is fixed to the slub RDI-201A (see red circle in the figure)
Calibration: Analog IR Sensors • The Analog IR Sensor is calibrated by fixing the slub so that FotoTransistor are 13mm over the path; • Verify that the LED is ON (there is a voltage of 1.2V between Anode and Catode); • Regulate the trimmer to have 2V on the Main Board if LED is on the black line and 4V if it is on the white
Calibration: Analog IR Sensors • To fix the distance of the IR-LED from the transmission axis at best is important in order to improve the performance of the robot control during line tracking