Vous êtes sur la page 1sur 5

1 Simulation Overview

Simulation serves a very important role in robotics development. The following list describes a few of the tasks simulation allows you to perform:
Analysis of kinematics and dynamics of robotic manipulators Offline programming Design of different control algorithms Design of the mechanical structure of robots Design of robotic cells and production lines

Given these use cases, the LabVIEW Robotics team is providing some simulator examples for robotics users. In these examples, you can see how to control a simulated NI Robotics Starter Kit robot and a simulated iRobot.

1.1 Accessing the LabVIEW Robotics Module Help


In LabVIEW, select HelpSearch the LabVIEW Help and refer to the Robotics ModuleSimulating Mobile Robots topic on the Contents tab of the LabVIEW Help for more information about designing and controlling simulated robots. Note: In LabVIEW, select HelpFind Examples to launch the NI Example Finder, which you can use to browse or search for example VIs.

1.2 Robotics Starter Kit Robot


A Starter Kit robot is a fully-assembled robot base with an ultrasonic sensor, encoders, motors, a battery, and an NI Single-Board RIO (sbRIO) that runs LabVIEW and the LabVIEW Real-Time Module and LabVIEW FPGA Module software. Refer to the Robotics ModuleLabVIEW Robotics Starter Kit topic on the Contents tab of the LabVIEW Help for more information about the Robotics Starter Kit.

2 Artificial Neural Network (ANN) Simulation Example


This example demonstrates how to design and validate control algorithms using the robotics simulator in the LabVIEW Robotics Module. The example demonstrates trajectory tracking by applying an artificial neural network (ANN) control algorithm to the simulated NI Starter Kit 1.0.

Figure 2.1. Trajectory tracking control

Figure 2.1 shows the control diagram, where P_ref is the reference or desired posture (x, y, orientation) and P is the current posture of the robot. The velocity controller outputs the required linear and angular velocity (v, w) according to the difference between P_ref and P. Then through the inverse-kinematic model, (v, w) is converted to velocities (v_l, v_r) of the robots left and right wheels. Finally, (v_l, v_r) are inputs to the simulator which applies the velocities to the DaNI robot. In this example, the velocity controller uses a classical tracking algorithm to control the robot so the robot can get to the reference posture smoothly. This example also provides the following two inverse kinematic models.
Analytical function model Artificial neural network (ANN) model

This demo shows that the ANN model performs as good as or better than the analytical model.

2.1 Example Files


After installing the Artificial Neural Network (ANN) Simulation example, open the example. The Artificial Neural Network.lvproj appears as shown in the following screenshot.

The ANN on Simulated Starter Kit 1.0.vi is the main VI of this project. The following screenshot shows the Front Panel of this VI.

When the simulation starts, the robot follows the path predefined by the red points:

2.2 Supplementary VIs


The simulator example contains a few important VIs, which are described in the following sections. 2.2.1 Utility_GenerateTrajectory.vi

This VI interpolates between positions in a path made up of (x, y) positions. method specifies the interpolation method. By default, this example uses cubic Hermite method. path specifies an array of positions (x, y). ntimes specifies the interpolation locations between every (x,y) element. Interpolation between elements repeats ntimes. trajectory returns an array of (x, y, O, ds) values resulting from interpolation, where O is the desired orientation at position (x, y), and ds is the distance from the previous point to the current point. 2.2.2 ANN_VirtualVehiclePosture.vi

This VI returns the reference postures (x, y, O) required to travel trajectory. You can view the execution of this VI as representing a virtual vehicle travelling the trajectory at a velocity of linear velocity. trajectory is array of (x, y, O, ds), where O is the desired orientation at position (x, y), and ds is the distance from the last point to current point. linear velocity specifies the desired linear velocity of the virtual vehicle. dt specifies the time interval at which to calculate the posture. virtual posture returns the posture (x, y, O) of the virtual vehicle. velocity specifies the real linear velocity of the virtual vehicle. angular velocity specifies the real angular velocity of the virtual vehicle. 2.2.3 ANN_GetPosture.vi

This VI returns the current posture information (x, y, O) of the DaNI robot from the simulator. In realworld applications, you can acquire posture information from sensors. position specifies the three dimensions (x, y, z) of the DaNI robots position. quaternion specifies the quaternion of the DaNI robot. vehicle status specifies the posture (x, y, O). The position input specifies the position (x, y) and the quaternion input specifies the orientation O.

2.2.4

ANN_4WheeledController.vi

This VI returns the linear velocities of the left and right wheels. ESN trained specifies the input weight, feedback weight, internal weight, and output weight. model type specifies which inverse kinematic model to use. You can specify the analytical kinematic model or ANN kinematic model options. current posture specifies the current posture (x, y, O), of the DaNI robot, where O is the orientation. desired posture specifies the reference posture (x, y, O), of the DaNI robot, where O is the orientation. vref (nan) specifies the reference linear velocity. If this input is not wired, the default value is NaN, which means there is no input of reference linear velocity, and the reference linear velocity will be derived from desired posture. wref (nan) specifies the reference angular velocity. If this input is not wired, the default value is NaN, which means there is no input of reference angular velocity, and the reference angular velocity will be derived from desired posture. dt specifies the time interval. wl returns the linear velocity of the left wheels. wr returns the linear velocity of the right wheels.

Vous aimerez peut-être aussi