MyRIO Robot Project |
---|

Home | Components | LabVIEW Tutorial Videos | LabVIEW Programming | Acknowledgment |

**Introduction**

The objective of this lab is to
apply PI (proportional-integral) control to a two-wheel cart which is
driven by
two motors via NI myRIO. Given the desired velocity and orientation,
the cart
should be able to steer properly while keeping the velocity unchanged.
To make
such control design feasible, two encoders are implemented to measure
the
rotational speed and orientation of the motors respectively. In
addition,
pulse-width modulation (PWM) is used to regulate
the driving voltage which is
the input of each motor.

The control process will work in the
following way:

The user gives the command (desired
linear velocity and angular rate) to NI myRIO. The command can be
further
transformed into desired speed for both left and right wheel by
kinematics, in
RPM (revolutions per minute). The encoders
measure the motor speed in counts,
which is also converted into RPM. The resulting linear velocity and
angular
rate are compared with the user-defined ones, where the differences are
calculated. These differences are called error, which are the inputs of
the
controller. The controller is a discrete PI controller.
The output of the
controller is the desired voltage that is going to drive the motors.
Thus, a
closed loop control system is constructed.

**1. Vehicle Motion Principle**

The autonomous vehicle is modeled as a rigid body that satisfies some constraints, which means the motion of the system is not completely free. They are in which the instantaneous velocities of system components are restricted, thereby limiting the local motion of the system. This means that the mobile vehicle cannot move sideways based on the principle of a rolling wheel.

**2. Model Kinematics**

Kinematics is the study
of the mathematics of motion without
considering the forces that affect motion. It deals with the geometric
relationships that govern the system and develops a relationship
between
control parameters and the behavior of a system in space. According to
the vehicle
model, the linear speeds of the right and left wheels, Vr

where,

The vehicle’s
coordinates*ψ*) changed
with respect to time can be calculated using the following equations.

From the Equations
(4)-(6), the kinematic model of the mobile vehicle
with two independently driving wheels can be represented in Cartesian
model as
Equation (7).

where, *X* and *Y* are position
variables, *ψ* is a heading direction angle (yaw angle), Vc and

Rearranging the above
equations, the position and the orientation
of the autonomous vehicle can be determined by a set of differential
equations
as below:

These principles guide you through the process of writing the program.

.