0% found this document useful (0 votes)
179 views

Robotics

The document provides an overview of the graphical programming environment Rogic used for robotics education. It describes the main screen interface which includes an options menu, button area, programming area, command area, and navigation bars. The programming area is where blocks are placed to control functions, chips like motors and sensors, delays, conditional statements, and repetition. Rogic uses a block-based visual programming language to make programming robots easier for students by avoiding complex syntax.

Uploaded by

3e.karen.garcia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
179 views

Robotics

The document provides an overview of the graphical programming environment Rogic used for robotics education. It describes the main screen interface which includes an options menu, button area, programming area, command area, and navigation bars. The programming area is where blocks are placed to control functions, chips like motors and sensors, delays, conditional statements, and repetition. Rogic uses a block-based visual programming language to make programming robots easier for students by avoiding complex syntax.

Uploaded by

3e.karen.garcia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 98

Introduction to Robotics

Stage 1: Graphic Environment of Rogic

Disciplinary Academic Body of Information and


Communication Technology
Stage No. 1 GRAPHIC ENVIRONMENT OF ROGIC
Programming concepts

Programming is the methodology or steps necessary to build a program. During this process, the
program is written according to the syntax of a programming language, it is tested, improved,
installed, and maintained.

A program is a set of instructions called commands that, written in a specific way (syntax) result in a
computer or robot performing a certain task correctly and quickly.

For a program to be considered of high quality, it must be accurate, clear, efficient, and portable.

A programming language is the set of symbols, words, and rules (syntax) that control a computer’s
physical and logical behavior. It allows the programmer, among other things, to specify the data that
will be processed and stored in the computer.
Block-structured programming language

These languages contain a section of code that allows a group of statements to be handled as one,
removing the obstacle of syntax and concentrating on the logic of programming.

The graphical user interface in Rogic is simple, it allows you to control the robot through icons that
simulate a flow diagram based on logic. You can perform easy programming exercises or add
sequential, conditional, and cyclic control structures. At this stage, we will get to know the graphical
environment of Rogic, which is a block programming language.
B. Button area
A. Options menu
Rogic’s main screen

C. Programming area

D. Delete command F. Command area E. Navigation bars


OPTIONS MENU

The Menu in Rogic contains the File, Setting, Mode and About options that display various
commands, such as saving and opening a program, as well as configuration and updates for the
robot.
File It contains the options: New To start a new program.
Open To open a program in order to Save To save a program we are still editing.
execute it or edit it.
Save As To save a program for the first time, it allows us
to choose the location where we want to save it.
Exit. to quit the program. Setting This option allows us to adjust the CPU port where
the robot will be connected to the computer.
Mode Robot updates, Bluetooth wireless connection, About It shows information about the Rogic’s
and virtual remote control. version we are using.
Download
BUTTON AREA It compiles and downloads the program in the
Robot CPU.
These are buttons used to download the program
directly to the CPU of the robot you have created, Run
as well as to run and stop a program. It starts the execution of the program (to see the
robot in motion, it must be connected to the
computer).

Stop
It stops the running program (when the robot is
connected to the computer).

www
It is the link to the official website.

Exit
It closes the program.
COMMAND AREA

The Rogic software screen has a set of commands


that are useful to give the robots precise structure and
instructions through programming.

Each of the commands has different functions, some of


them have sub-commands, each with a different function,
which are explained below.
Programming area. On Rogic’s main screen, the blue squared area is the place where the programming is
carried out as the programming blocks are placed and nested.

Delete commands. The programming blocks to be deleted are placed on this icon.

Navigation bars. They are used to navigate the programming screen.

Programming Area

Navigation bars
Delete commands
Functions
It is the first command button that appears on the Rogic
screen. When you select it for the first time, the
subcommand “New” (void) is displayed. This allows us to
create functions.
• A function is a group of orders to which we
assign a name, this name is necessary to be
able to call the function during the execution of
the program.

• The main characteristic of a function is that it


solves a simple, concrete, and specific task, as
part of the complete solution that is being
designed.

• When we execute a Rogic program, the


execution process is started by the Robot in the
main function, that is to say “Start” (Start ();). The
new functions are written after Start.
Chips
The next button on the Rogic screen is “Chips”. When selected, 8 commands are displayed, through which
you can program different output interfaces in the robots such as motors, servo motors, LEDs, horns, etc. It
will also allow you to declare variables and perform calculations.

• DC Motor: Movement of direct current motors.


• Servo: It controls the degrees of position in the servo motors.
• Voice: It programs the horn.
• Dot Matrix: Matrix or arrangement of LEDs that can be turned on and off.
• ON: It activates the selected output ports.
• OFF: It turns off the selected output ports.
• Variable: It declares variables for the functions.
• Calculate: It performs calculations for the functions.
Delay

This command gives the instruction to wait for


a certain period of time until the execution of
the next instruction, it has a range of 0.1 to 25
seconds.
While

The “While” button presents three repeat control commands.

While: The robot evaluates a condition and, if the condition is true, the robot
will repeat the instructions inside While.

Break: It is used to exit a cycle, when it is executed, the control of the


program goes immediately to the next instruction.

Loop: This command orders the robot to repeat one or more times the
instructions that are within the Loop status.

Rogic accepts a repeat range of approximately 1 to 127 times.


If Else

The button If Else presents programming commands that allow the conditioning of the actions of our robot.

• IF Else: Status of conditional control, the Robot evaluates a condition with the
help of its sensors. If the condition is true, the Robot performs instructions, if the
condition is false, it processes different instructions.
• IR Remote Control 5: It conditions the movements of the robot through a 5-button
remote control and an infrared receiver.
• IR Remote Control 8: Conditions the movement of the robot through an 8-button
remote control and an infrared receiver.
• Bluetooth R/C 12: Conditions the movement of the robot through a 12-button
remote control and a Bluetooth module.
• Bluetooth R/C 10: Conditions the movement of the robot through a 10-button
remote control and a Bluetooth module.
• Contact S/W: Conditions the actions of the robot using contact sensors.
• Rand: Random control function.
Sensors

A sensor is a device that detects events or changes in its physical or chemical environment, measures
magnitudes, and sends this information to a processor for further reading or processing.

The If Else button presents the commands for:

• IR Sensor: It emits a beam of light that is interrupted or reflected


by the object to be detected.
• Magnetic: A pair of metallic sheets that attract each other in the
presence of a magnetic field, closing the circuit.
• PIR Sensor: Passive infrared sensor, it measures the radiated
infrared light from objects in its field vision.
• Tilt Sensor: It detects the inclination of an object, through a
physical mechanism when reaching a certain angle.
• Color Sensor: It emits RGB (red, green, blue) light on objects,
calculates the color coordinates, and compares them with the
saved reference value.
Smart Rogic’s work interface

Smart Rogic is an application used to program the functioning of a robot from a distance, through
communication by Bluetooth and a personal computer or a mobile device, such as a cellphone, a
tablet, or an iPad.

The application is downloaded from the Play Store or App Store (Apple) in any mobile devices or on
a webpage.

SmartRogic
Download the program

Execute or run the program


Smart Rogic’s screen
Stop the program in the robot
Settings (connect bluetooth,
Once the application has save/open app, version)
been installed on the mobile
device or PC, open it to Close the editing menu

observe the elements of the Copy

main screen. You can Cut

compare it with Rogic’s Paste


Delete a programming block
screen and define some of its
main parts.
Command menu

See the program in C language

Undo

Redo

Remove program
Button area: In this area, the communication between the mobile device and the robot is generated
to execute the program elaborated on Smart Rogic. It contains the following buttons:

• Download: It downloads the program to the robot’s CPU.


• Run: It starts the execution of the program.
• Stop: It stops the execution of the program.
• Setting: It establishes the communication between the
robot and the mobile device, in addition, it manages the
programs elaborated on Smart Rogic.
Programming area: The blue squared area is the place where
the programming is carried out as the programming blocks are
placed and nested.

Delete Commands: There are many ways to eliminate a


command button on SmartRogic, one of them is to press on the
delete icon.
Commands area: In this area of Smart
Rogic is where the commands are found,
these commands are: Functions, Chips,
Delay, While, If Else, and Sensors.

In order to configure each of the


command buttons on the programming
area, you only have to press twice to open
its work configuration.
Bluetooth connection

The Bluetooth is a communication protocol that allows the wireless transmission of data (pictures, music,
contacts, among others) and voice between different devices placed near each other, within a radius of,
generally, ten meters.

The use of Bluetooth has been associated with cell phones since they were the first devices to incorporate this
protocol.

Nevertheless, nowadays this wireless technology is present in smartphones, tablets, portable computers,
mouse, keyboards, printers, headphones, tv, digital cameras, MP3 players, or game console.
Bluetooth connection 1. Click on settings

2. Click on connect bluetooth


This technology allows to maintain a wireless
connection with the robot, performing the 3. Connect the robot
following steps: by clicking on the
current bluetooth
device
n k y o u
T ha
Introduction to Robotics
Stage 2 Sequential Programming Structures

Disciplinary Academic Body of Information and


Communication Technology
OPERATION OF A ROBOT
A Robot is mainly composed of:

Sensors: Actuators:
Controller:
They allow the robot to Mechanisms that allow
It processes the
become aware of its the robot to
information it receives
surroundings and send communicate and infer
and transforms it into
information to the in its environment.
actions.
controller.
BASIC OPERATION
Environment (Program)

Input Process Output

Feedback

Output devices:
Input devices: Processing devices:
They can be different
In computers it is the
They are generated actuators such as
CPU, in robots they
through the sensors. motors, servomotors,
are called controllers.
LEDs, horns, etc.
PROGRAMMING STRUCTURES

Sequential Conditional Cyclical


Programming: Programming: Programming:
It is to tell the robot, When evaluating a When part of the
step by step, the condition that can program repeats as
actions that will be be answered as true many times as
executed. or false. indicated in the
same program.
Instruction 1
SEQUENTIAL
PROGRAMMING Instruction 2
STRUCTURES
Instruction 3

Instructions or commands are executed, one after the


other, as they are written in the program.

Instruction n
Example:

In this program, the task of the RaceBot robot


is to turn on the three LED lights for a
second, then, turn them off for a second and
turn them back on for another second.
Motion
A. Kinematics

It is the study of the movement of mechanisms in space whose


magnitude used is called “displacement”.

In robots, a kinematic study allows us to know the exact location in which


the robot’s actuator that will manipulate objects is located.

It is important to make a schematic diagram of the robot, indicating its


dimensions and possible movements.
B. Joints

They are mechanical structures that allow the movement of the


different parts of the robot.

There are two basic types of joint:

• Rotational: It allows an angular movement, usually produced


by motors. Its movement is measured in degrees or radians.

• Linear: It allows one-way travel. Its displacement is measured


in units of distance.
C. Links

Rigid structures that give amplitude to the movements of the joints.

D. Degrees of Freedom of a Robot

Also called DOF, it is the number of independent movements a


robot perform and, in most cases, it is equal to the number of joints
that the robot has.
DC MOTORS
It is a machine that converts electrical energy into
mechanical, causing a rotary movement due to the
action of a magnetic field.

Its speed is easily controlled, for this reason, they


are used when constant speed control is required.
DC motor parameters
• Operating voltage
It refers to the voltage with which the motor must work; in educational robots they generally use
between 1.5V and 12V.

• Operating current
It is the amount of current that the motor requires. The greater the load the motor has, the higher
the current it needs.
Increase in current with respect to the load

Current

Load
DC motor parameters
• Speed
It refers to the speed with which the motor shaft rotates; is given in revolutions per minute (rpm). In
our case, we will use engines with speeds of up to 100 rpm and 600 rpm.

• Torque
It is the force that the motor exerts on the load. The larger the torque, the heavier the load may be.

• Speed Control
It is controlled through a PWM (Pulse-Width Modulation) signal composed of a series of pulses. In
Rogic, we can choose a speed on a scale of 0 to 15, which are the margins of PWM signals that
the program uses to control the speed of a motor, where 0 indicates that the voltage sent to the
motor is equal to 0V and 15 is the maximum voltage that the controller can send to the motor,
which is between 5V and 7V, considering that the speed of a motor depends on the voltage it
receives.
Microwave
oven

Car window lift Printer

Common
uses
Connection
between
blocks

Command block
DC Motor
Connection port

Ahead
Behind
Speed
Example: We program Motor 1 and Motor 2 with a forward direction and a speed of 10 units.

If we leave the programming just


with this indication, what
happens?

The DC Motor command, as well


as all the other commands in
Rogic, works for a millisecond,
making it imperceptible.

Therefore, if we want to see the


robot actually moving forward with
a speed of 10 units, we must use
a command that tells the robot
how long it should perform that
action.
Servomotor
It is a direct current motor, which
has the ability to be controlled and
kept stable in any position within
its operating range, generally 180
degrees.

The parts of a servomotor are: a


direct current motor, a gear
reduction system, a control loop,
and terminals.
Common
uses
Connection
between
blocks

Servomotor
command block
Delay
It is one of the most used
functions in programming, it
makes the processor wait a
defined time before executing the
next instruction.

It has an input parameter in


milliseconds ranging from 0.1 to
25 seconds.

It is a delay in time, in which any


action that is on or off during the
operation of the program will
remain in that state for the
assigned time.
It is a function that
makes the processor
wait a while before
executing the next
instruction

Delay
Songs
Video games
Means of
transportation
Softwares
Robots

Delay of doors Delay in opening the


opening in the subway microwave door

Common
uses
LED
Light Emitting Diode

It consists of a semiconductor material with two


terminals that emit electromagnetic radiation in the
form of light when activated.

The main feature of LED lights is that they convert


the low-voltage electrical current that passes
through its chip into light.

Its advantage over other technologies is that they


do not overheat, they do not have a filament that
can burn like traditional bulbs, they are very small,
and do not pollute the environment.
LED operation

As we can see in the figure below, energy flows from the highest voltage to the lowest.

In this electrical circuit, the energy leaves the positive terminal and passes through the resistor, which
absorbs energy just like the led; it then emits light to check that there is electricity flowing through the
circuit and, finally, the circuit is closed by connecting it to the negative terminal.

Electricity Resistor
flow

5 volts
LED
battery
Common
uses
BUZZER

A buzzer is an electroacoustic transducer; it


produces a "beep" sound that occurs continuously
or intermittently in the same tone. Inside, there is
an electromagnet and a plate that vibrate very
quickly when they receive an electrical signal.
Common
Uses
To program output devices such as LEDs or Buzzers, the ON and OFF commands are
used, choosing the OUT port to which the devices are connected.

Example:
If we have plugged a horn into the OUT 1 port on the CPU and it is given the
instruction to make a sound for two seconds, turn it off for a second and then turn it on
again for a second, the programming in Rogic would look graphically as follows:
ON
We use this command to turn on the
devices connected to the CPU output
ports.

With the ON command, we have To get two LEDs to turn on at the


to select the ports to turn on, same time for 3 seconds,
however, they only turn on for considering that they are connected
milliseconds. Therefore, it is to OUT 1 port and OUT 2 port, we
necessary to determine a period of must set the Delay command.
time during which the indication will
be visible. This will be done by
using the Delay command.
OFF
Command that we use to indicate the
end of an action.

Combination of ON, OFF, and Delay commands. When we find more than one LED light in
the robot and we want to perform an on/off sequential programming, we must understand the
use of the OFF command. This is because we must give the precise indications to be made
to each of the ports. Just as we can turn all the ports on and off at the same time, we can
also indicate that they turn on one by one at a certain time, interspersed or also
intermittently. This type of programming can be done with the combination of ON, OFF and
Delay commands.
Introduction to Robotics
Stage 3 Conditional Programming Structures

Disciplinary Academic Body of Information and


Communication Technology
Stage 3 Content

• Types of conditional structures


3.1 What are the
Conditional conditional control
structures?

Programming
Structures
• If Else
3.2 Conditional
commands

• IR Sensor
• Remote Control
3.3.Sensor
• Contact Switch
3.1 What are the conditional control structures?
They are programming structures that, when evaluating a condition, allow to decide which alternative the program flow
will follow depending on the result. Rational and logical operators are used to establish complex conditions.

A. Types of conditional structures

The conditional structures can be classified in three types:

• Simple

• Compound or double

• Multiple or nested

Simple
Types of conditional structures

Compound or double Multiple or nested


3.2 Conditional commands
If Else
It is a conditional control structure in which the robot evaluates a condition
that can be answered as true/false, yes/no; if the robot executes some actions
in case of being true or other different in case the condition is false.
3.3 Sensor
IR Sensor
Operation
An infrared sensor, also known as IR, is composed normally by an infrared LED and a
phototransistor placed side by side, so the LED acts as emitter and the phototransistor
as receiver.
3.3 Sensor
Remote Control
Operation
Most controls function with infrared emission diodes to emit a light with a frequency out of the light spectre visible for humans. It is so low that it
can’t be perceived. When pressuring some button of the remote control, it transports signals that can be detected by the device to be operated.

For the correct operation, we must be sure that the remote control as well as the control sensor are in the same communication channel by
moving the switch on each one of them with the same numeric pattern.
3.3 Sensor

Contact Switch
Sensor that measures the presence of the object that is detected by directly making physical contact. When the
height of the plunger changes, the sensor calculates internally the amount of the displacement. Contact sensors are
simple and basic, they are used mainly for detecting height, thickness, or object deformation.
3.4 Activities
3.4 Activities
3.4 Activities
3.4 Activities
Introduction to Robotics
Stage 4 Cyclic Programming Structures

Disciplinary Academic Body of Information and


Communication Technology
4.1 What are the cyclic control structures?

• Also known as repetition control, it allows an instruction or


set of instructions to be repeated several times.

• The set of instructions that are repeated certain number of


times is called cycle, loop, or ribbon.

• It is called iteration to each one of the different past


executions of all the instructions contained in the loop.
4.2 Cyclic Commands • While
• Loop
• Break
It is a conditional repetition control
command that allows you to execute a
series of commands repeatedly "as
long as" the given condition is true;
this creates a loop.
A. While
a. Operation When the condition is false, the
program will exit the loop of repetition
and the actions will stop running, that
is, it will no longer perform iterations.
Click

The robot evaluates a condition with help of the


comparison operators and repeats the
instructions within the While block "as long as"
b. Command block the condition is true. As soon as it is false, it
moves to the next instruction in the program.
c. Diagram of the cyclic structure While

The structure is formed by two parts:

1. The expression or condition that is evaluated each time the cycle repeats.

2. The group of instructions that are executed in each iteration.


d. Rogic Editor
When we learn to program, we acquire many skills like the capacity to solve problems, detect
errors and more creativity, but the most important one is the logic of programming. With this
skill we can get a computational thinking.

The programming is made through command lines, they are special words that, by being
written in certain way, called syntax, they make the CPU to understand that it is receiving an
instruction.
Programming by blocks is a graphical programming language that uses interconnected
programs that hide the command line. It allows us to learn the programming logic avoiding syntax
errors.
With the Rogic software we can see lines of code that hide our program by clicking the right
mouse button on the programming area, the Rogic Editor Open screen will open and we can
visualize our programs in line of code.
The While syntax in the Rogic editor looks as the example below:

While (condition)
{
instruction block
};

Characteristics:

• It is an instruction used for processes that are repeated many times.


• The condition is evaluated at the beginning, so the cycle may never execute.
• The cycle repeats as long as the condition is true.
• When the condition becomes false, the cycle stops executing.
This command is very useful when
B. Loop programming, since it allows one or
a. Operation several instructions to be executed
repeatedly a specific number of times.
Inside command While there is the
Loop command.

b. Command block
When adding the Loop programming command in the
programming area and clicking the upper right button, the
following screen will appear:
● In the text chart you write the amount of times an
instruction will be repeated and confirm to apply it.

● Inside the Loop command you add the instructions


that will be repeated.
c. Diagram of the cyclic structure loop

The Loop command works like a counter that uses a variable


that, each time it returns, increments plus one until it completes
the number of times it has been indicated.
d. Rogic Editor
The Loop syntax appears as a for in the Rogic Editor shows in the following way:

for (name of the variable with value initialization; stop condition; increment or decrement)

{
//instructions to execute in each repetition (iteration)
} //end of the cycle
The Break command ends the repetitive
cycle without analyzing the cycle’s
condition.
C. Break When the sentence Break is executed
a. Operation there is a jump to the first line outside the
for that contains it. We must consider
that if we are in nested cyclic structures
it only comes out from the first repetitive
structure that contains it.
Inside the command While there is the
command Break.

b. Command block
c. Diagram of the Break structure
d. Rogic Editor

You might also like