You are on page 1of 21

Educational Robotics

Stage 1 INTRODUCTION TO MECHANICS


AND ROBOT CONTROL

Discipline Academic Body


of Information and
Communications
Technology
Textbook
Stage No.1 INTRODUCTION TO MECHANICS AND ROBOT CONTROL
1.1 Introduction

The Educational Robotics Learning Unit studies the design, construction and programming of robots
and electronics applied to the components included in the robotics kit, focusing on the electronic parts
and their basic operation that responds to the elaborated programming.
1.2 Robotics Concepts

A Robot is a machine controlled by a computer and programmed to move, manipulate objects and perform
tasks interacting with its environment.

Robotics studies the design, construction, programming and application of machines capable of performing
various tasks.

Program: set of instructions based on a programming language that a computer interprets in order to perform
a specific function.
Command: it is an instruction or order that the user provides to a computer or robot, from the command line (in
textual programming) or from the graphical interface (visual programming) in a programming carried out.

A programming language is a language designed to describe the set of consecutive actions that a robot must
execute.
Examples of programming languages:
Java, JavaScript, C#, C++, Python, PHP.
Robot Components

Mechanical Hardware

Control Processors

Communication Interface

Perception Sensors
Construction phases
Mechanics

Electrical

Electronics

Computing
1.5 Build a Robot with Kit Parts

1.5.1 ROBOMASTER KIT


1.5.1.1 Central Processing Unit (CPU)
1. Motor Port Corresponds to the input pins, specially dedicated for motors, the Robomaster kit has 4 pairs of
pins, of which 2 pairs correspond to Motor1 and 2 pairs of pins to Motor2.
2. Output ports (Out Port) The outputs are the signals sent by the CPU to execute an action, the Robomaster
CPU has 8 output ports, the function of these outputs is to send a high or low level pulse to activate or
deactivate some actuator.
3. Input ports (In Port) The digital inputs that interpret signals received by sensors at a high or low level, 0V or
5V respectively, in the case of the Robomaster CPU have 7 digital input ports.
4. Power Switch It corresponds to a switch and its function is to open or close a circuit to turn on the CPU.
5. Motor Driver It is the component in charge of controlling the motors, commonly known as the H bridge.
6. Microprocessor It is an electronic circuit that works as the central processing unit (CPU) of a computer.
7. Power supply
(Power Connector) It is the entry port vo
1.5.1.2
KIT
elements
A. Electronic
elements
1.5.1.2
KIT
elements
A. Electronic
elements
1.5.1.2
KIT
elements
B. Mechanical
elements
1.5.1.2
KIT
elements
B. Mechanical
elements
1.6 Programming a Robot

1.6.1 Programming

B. How is a robot programmed?


To program a robot it is necessary to establish the ideal algorithm to develop the process that allows our
robot to carry out the specified instructions.

This algorithm is translated into a programming language readable by the robot's control system. This
language must allow to specify in a clear and simple way the tasks that the robot must carry out.
1.6 Programming a Robot

1.6.1 Programming

C. Programming procedures.

• There are various robot programming procedures and various types of programming software as well.
• Textual or indirect programming.
• Guided or direct programming.
1.6 Programming a Robot

1.6.1 Programming

D. Programming in Rogic software.


To learn more about the programming
context, we will return to a basic example
of the ignition of a DC motor, to later make
the comparison with command line
programming.

1. Move a motor forward for 5 seconds and it stops.


2. The engine stops and a led lights up.
3. The led remains on for 3 seconds.
4. The led turns off.
E. Programming with Rogic Editor Open

Rogic Editor Open is one of the alternatives to the scratch language that we commonly use in Rogic,
since programming stops being visual programming and becomes textual programming, something very
similar to the C ++ language, in this viewer a library called schoolkits is used. h, said library brings with it a
series of preloaded commands that are used to carry out programming in textual form.
E. Programming with Rogic Editor Open

To access Rogic Editor Open, just right Once we enter, the interface will appear with the
click on the work area and then select initial commands that are loaded automatically when
the option with its name from the menu the viewer is opened.
that appears
G. Features

Function: It is the first command button that appears on the Rogic screen. When you select it for
the first time, the “New” subcommand is displayed that 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.
G. Features

Example: A basic example for the use of functions is to


declare at the beginning the way in which we will turn left
and right, in this way each time we need to turn, we will
save time thinking about the solution since we have
declared it at the beginning , as we can see in the image
on the right:
As we can see, the Rogic programming shown includes
two functions, one called Right and the other called Left,
in these functions there are the DC Motors with the
configuration that will make the robot turn to the right and
to the left, respectively.
And so when we continue in the programming we can
realize that in button 3 the Left function is used or called,
and in button 4 the Right function, this is a simple
example, however, in more extensive and complicated
programming, the Using functions can make the
programming process much easier for us.
H. Variable and Calculate

Within theplantilla 2023 “Chip” section, there are


two extremely important command buttons
when preparing a schedule for an autonomous
robot. We are talking about the Variable
command button, and the Calculate command
button.

One of the main uses for these command


buttons is to be able to count, and to be able to
Declare variables.
do so it is necessary to use both, for example,
we can count a certain number of lines on the
Perform calculations with
floor, or the number of times we press a button.
variables

You might also like