WEBVTT

00:00.110 --> 00:06.680
The orders to control library has been designed for the development of any control system for robots

00:06.680 --> 00:07.910
and Ros two.

00:08.420 --> 00:15.410
For this reason, this library offers various interfaces and configurations to adapt to the different

00:15.440 --> 00:16.940
needs of each robot.

00:16.970 --> 00:23.960
In particular, this library offers three different interfaces that corresponds to three different control

00:23.960 --> 00:24.800
logics.

00:24.830 --> 00:32.660
The control of an actuator in fact can be implemented for position, velocity or force or torque.

00:33.630 --> 00:40.410
The position control is exactly what we will be using in this course to control our robot.

00:40.860 --> 00:47.820
Controlling an actuator for position means implementing a control logic that moves a certain system

00:47.820 --> 00:54.900
from its current position to a desired position and potentially following a specific trajectory during

00:54.900 --> 01:01.410
these movement, reaching intermediate configurations between the initial and the final position.

01:02.310 --> 01:10.290
Let's consider a real case where a motor that controls a link of a robotic arm needs to rotate to reach

01:10.320 --> 01:12.330
a position of 90 degrees.

01:12.960 --> 01:19.140
Let's also assume that the motor is currently stationary at the zero degree position.

01:19.860 --> 01:26.280
The error variable, which is provided as an input to the control system is calculated as the difference

01:26.280 --> 01:27.840
between the desired position.

01:27.840 --> 01:31.230
So 90 degrees and the current position of the motor.

01:31.230 --> 01:32.490
So zero degrees.

01:32.880 --> 01:37.500
Therefore the error variable is also equal to 90 degrees.

01:38.530 --> 01:45.430
This value is passed as an input to the control system, which applies a specific logic to calculate

01:45.430 --> 01:51.670
the commands to be sent to the motor, to reach the desired position and minimize the error variable.

01:52.400 --> 01:57.140
So the motor that controls the robot link starts to rotate.

01:57.140 --> 02:03.650
And in the next time step when the control loop is executed again, it will have rotated by a certain

02:03.650 --> 02:04.190
angle.

02:04.580 --> 02:12.650
Let's assume, for example, that it has rotated by 30 degrees, so the error variable is recalculated

02:12.650 --> 02:19.700
as the difference between the target position, which still remains 90 degrees and the current position

02:19.700 --> 02:22.700
of the motor, which now is 30 degrees.

02:22.940 --> 02:29.280
Therefore, in this iteration of the loop, the error variable corresponds to 60 degrees.

02:29.300 --> 02:35.150
Once again, this error variable is passed as an input to the control system which calculates the new

02:35.150 --> 02:37.520
commands to be sent to the robot.

02:38.030 --> 02:44.510
Once again, the motor executes the command received from the control system and moves towards the desired

02:44.510 --> 02:45.110
pose.

02:45.650 --> 02:48.890
At the next time step the control loop repeats.

02:48.890 --> 02:55.860
So this time the motor is at the 60 degrees position in the error variable is recalculated as the difference

02:55.860 --> 02:57.390
between the desired position.

02:57.390 --> 02:59.940
So 90 degrees and the current position.

02:59.940 --> 03:03.450
So 60 degrees resulting in 30 degrees.

03:03.540 --> 03:06.900
We can see that with each control loop iteration.

03:06.930 --> 03:13.200
The error variable is effectively decreasing, indicating that the system is approaching the desired

03:13.200 --> 03:13.980
position.

03:13.980 --> 03:18.510
So the arm continues to move and a new control loop begins.

03:18.510 --> 03:22.320
So the current position of the motor is 90 degrees.

03:22.350 --> 03:28.470
The error variable is also recalculated and represents the difference between the desired position.

03:28.470 --> 03:32.880
So 90 degrees and the current position that is also 90 degrees.

03:32.880 --> 03:35.760
And therefore in this case the error variable is zero.

03:36.720 --> 03:43.140
However, depending on the implemented control system, even when the error variable reaches zero and

03:43.140 --> 03:48.720
the system reaches the desired position, the control system is not turned off or stopped.

03:48.750 --> 03:56.700
It continues its execution to correct any external disturbance, such as gravity, acting on the robotic

03:56.700 --> 03:59.700
arm which can push the robots downwards.

04:00.390 --> 04:06.030
The control system tasks in this case is to maintain the arm stable in the current position.

04:06.910 --> 04:14.080
In addition to position control, the Ros2 Control Library also supports the velocity control.

04:14.780 --> 04:17.780
In this type of control, the goal changes.

04:17.900 --> 04:24.950
Instead of having a motor to reach a specific position, we want it to start moving to start rotating

04:24.950 --> 04:26.780
with a certain velocity.

04:27.140 --> 04:33.770
Therefore, the input to the control system is represented by the desired velocity and the error variable

04:33.770 --> 04:39.050
is calculated as the difference between the desired velocity and the current velocity of the motor.

04:39.230 --> 04:46.070
And so the control system sends commands to the actuator to rotate at the desired velocity in order

04:46.070 --> 04:48.110
to minimize the error variable.

04:49.030 --> 04:56.650
Furthermore, the Ros2 control also supports force or torque control applied to the motors.

04:57.540 --> 05:04.020
This type of control is useful, for example, in manipulation application where fragile objects needs

05:04.020 --> 05:06.210
to be grasped without breaking them.

05:06.690 --> 05:12.120
In this case, our position control could apply too much pressure and break the object.

05:12.120 --> 05:14.550
Or it could apply not enough pressure.

05:14.550 --> 05:15.750
And so drop it.

05:16.200 --> 05:21.180
In this case, a force torque control is used where the input variable is.

05:21.180 --> 05:25.560
For example, the force to be applied in order to grasp an object.

05:25.560 --> 05:31.740
And the error variable is calculated as the difference between the desired force and the current force

05:31.740 --> 05:33.750
that the gripper is applying.

05:33.750 --> 05:40.230
And so the control system ensures that the gripper is closed with the right force in order to grasp

05:40.230 --> 05:43.170
and manipulate the object without breaking it.
