Start Programming a Falcon haptic with LabVIEW

If you already have the “hdl” library its time to start programming. Else you can learn how to build it by yourself here.

An impedance-type haptic link this one is a very simple device: it receives Cartesian forces and return its position. As this is a three degrees of freedom (DOF’s) system, only forces and positions along the X, Y and Z axes are exchanged. Also, the status of the tool-tip buttons can be read.

The Cartesian workspace is about 20 cm with with origin at the center position. The Y axis is pointing up and the Z is aiming toward the user.

The good news are that because the concurrent nature of LabVIEW language and the lack of conventional classes architecture, is easier

Minimum example

First you need to “init” the device to get a device ID. If this fail (the device is not ready), a -1 is returned and your program should stop. Else you can “start” the servo thread and make the ID the default ID value for the read and write operations. It is your responsibility to repeatedly read and write to the haptic at a rate of about 1000 times per second (yes, 1000). A lower rate just makes a poorer haptic illusion. At the end you must “Stop” the servo thread and “uninit” the used ID.

Waning: Always “uninit” your device ID before “initing” another one. Else your computer will have a bad digestion and you’ll need to restart LabVIEW. So don’t forget to stop your program using your panel Stop button, instead of the “Abort” button. You are warned!

Let’s start with the initialization:

VI_Initializing

 

Here, in case that the haptic is not ready you get a message and your program stops.

VI_Errordialog

You can start by making a read only program like this. The haptic is not going to move so don’t be afraid to try:

VI_Haptic_reading_minimum

Check in the user panel that the buttons and the position readings are working. You can use a chart and the default array indicators.

VI_haptic_minimum_panel

Remember to stop the program pressing the “Stop” boolean control.

Now you are ready for the next step.

Use the force, Luke

Let’s make another example with force generation. In this next case a simple elastic model is going to be used. The force output force is opposed, and proportional, to the displacement of the haptic from its workspace origin.

VI_haptic_spring_diagram

The elasticity constant can be changed on line, and the positions are shown in a chart.

VI_haptic_spring_panelYou can see the program in action in the following video.


Here you can see the behaviour of the haptic with different elasticities.

If you are lazy…

Here you can find the hdl library (hdl Library). Make sure you have installed the latest Falcon drivers and SDK and then copy the folder “hdl” into your LabVIEW’s user.lib folder.

The archive with the two examples VI from above are here (FalconLabVIEWExamples).

This is a very simple model and I’ll be happy to see your programs.

Cheers!

 

Leave a Reply

Your email address will not be published. Required fields are marked *