M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW...

30
M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department of Structural Mechanical Engineering, University of Trento Email: [email protected]

Transcript of M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW...

Page 1: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Simulator of a SCARA Robot with LABVIEW

Ing. Luca Baglivo, Ing. Alberto Fornaser

Department of Structural Mechanical Engineering, University of Trento

Email: [email protected]

Page 2: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

INTRO

Page 3: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Simulink Diagram

Page 4: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Simulink Diagram

Page 5: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Time

Trajectory

Speed of theEnd Effector

Using the q it is possible to retrive the pose of the robot and the carthesian coordinate of the End Effector.

Jacobian evaluation

Compensate the error of the position due to numerical integration

Page 6: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

LabView Diagram

Page 7: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

LabView Diagram: GUI

Page 8: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Main Logic Blocks

Page 9: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Main Logic Blocks

Page 10: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Simulator

Page 11: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Software Main Structure

The software is thought in order to pilot a robot.It is a good approach organize the software it in the following way: - First Task -> Move the robot to the HOME position (safe pose); - Second Task -> Move the robot, our simulatoin; - Third Task -> Go back to HOME.

This logic can be achieved through a Sequence structure.

Page 12: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Trajectory

-Time dependent

Input:Center xCenter yRadiusT

Output:x(t) y(t)

)/cos()( tc ktrxtx

)/sin()( tc ktryty

Name: Trajectory.vi

Page 13: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Trajectory

The robot must be settled avoiding a singular initial pose. In such way it is possible to achieve and follow a feasible path without problems

Initial Conditions:Q1 -> -pi/2Q2 -> pi/2Q3 -> 0

A1

A2

Geometry of the robot:A1 -> 300mmA2 -> 350mmA3 -> 0mm

Page 14: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

ROBOT VISUALIZATION

This Vi helps the user to understand the pose of the robot and monitor the evolution of the motion.We need to have the full structure as output, this will simplify the programming interface a lot.

Arm_visualizer.vi

Page 15: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Jacobian and Pseudoinversion

This Vi must evaluate the Jacobian Matrix. The input are the angles of the joints.

The output should be a matrix, and this should be inverted in a second Vi.

NB: J is related to the dimension of the joints, so it is usefull to create a Vi that output these informations.

1)'(' JJJJ inv

Page 16: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Derivator

This Vi must evaluate the velocity of the End Effectot

Important: during the first loop we cannot evaluate the speed, so we need to pass directly a value.

This VI must have 2 additional imput, 2 single value ( double ). These inputs will be used later to introduce a numeric error compensation.

Page 17: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Integrator

This VI is used after the multiplication between the presudoinverse Jacobian and the End Effector Velocity Vector. By integrating the output of that multiplication the qs (angles of the joijts) of the robot can be evaluated.

Using the Output of this Vi it is possible to connect the Robot Visualization Vi, and watch the motion of the robot directly during the processing loop.

Page 18: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Images: Some Hints

A Good methodology in LabView is to start building your Vi referring to an example, copying part of the code and then start adding your own «code».

So, how can we open an Image in Labview?

Go to:

…Program Files (x86)\National Instruments\LabVIEW 2010\examples\Vision\1. Getting Started

Page 19: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

How Initialize and Load an Image

We should works with 2 images at the same time:-One is the source image-One is the destination Image

This is due to the library related to the image processing. LabView does not allow the user to overwrite an image from the same function.

Page 20: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Camera View Simulation

Vi that simulates the camera mounted on the End Effector

Input:- Image of the ground- Coordinates of the End Effector

Vi that performs the chek of the image, the task is to identify the center of a dot seen by the camera.Use Vision Assistant!

Vi that returns the coordiante of the identified dot in the world coordiante system

GIVEN

Page 21: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Camera Simulation

The simulation is based on the identification of a region of 640x480 pixels centered and oriented according to the actual pose of the End Effector.

NB: Camera and Robot Reference Coordinate Systems are different!

World RCS

Camera RCS

Page 22: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Camera Simulation

One of the limits of the graphic library in LabView is that you can not crop region of image using any orientation.

To overcome this issue is possible to shift and rotate the image.

Region to Crop

ROI Centered to the origin 0,0 with dimensions 800x800 pixels

Why 800x800?

In this region i can have all the possible 640X480 sub regions with any generic orientation!

Page 23: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Camera Simulation

Region to Crop

Region to Crop

We shift the image, not the reference system!

Page 24: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Camera Simulation

Now we can apply the rotation to the image.

Page 25: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Camera Simulation

We can now Crop the image to the 640x480 region.This is the resulting image that simulates the view of the camera!

Page 26: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Camera Simulation

NB: The rotation of the image is done around the center of the image itself.

Page 27: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Vision Assistant

Page 28: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

Vision Assistant

Operation Order

Page 29: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion

From Camera to World RCS

Now we have the estimation of the position of the dot expressed in the camera reference coodinate system, but the robot usually works inside its own space (called also World).

We need a Vi that performs the transformation between the camera rcs and the world rcs.

Dot identified inside the image Field of view of the camera inside the world reference system

Coordinates of the dot expressed in the world system

Camera Reference System

Page 30: M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion Simulator of a SCARA Robot with LABVIEW Ing. Luca Baglivo, Ing. Alberto Fornaser Department.

M. De Cecco - Lucidi del corso di Robotica e Sensor Fusion