Anda di halaman 1dari 1

A Haptic Interface Using Matlab/Simulink

Magnus Eriksson and Jan Wikander Mechatronics Laboratory, Machine Design, KTH, Stockholm, Sweden
I. Introduction. Haptic is the sense of touching something. A haptic device is connected to a virtual world for enabling touch of 3D modeled objects. If there is a collision in the virtual world between a tool and the object, the device provides force feedback to the user. In this work, a Phantom Omni 3-DOF haptic device [1] is controlled from Matlab/Simulink [2] and the real time prototyping system dSPACE [3]. Usually the Phantom Omni is controlled by commercial drivers and based on C++ programming. Using Matlab/Simulink will enable more open and flexible model based programming of the force algorithms for haptic feedback. This work is done in the context of developing haptic and visual simulation of surgical procedures [4]. II. System Overview A Phantom Omni haptic device is dismantled and the sensors and actuators are low level connected to dSPACE. There are six input signals (3 encoders + 3 potentiometers) and three output signals (3 dc motors). Figure 1 is showing the system overview. Sensor and actuator signals are connected to the dSPACE system that also controls timing in the system. The signals are transferred from dSPACE to Matlab/Simulink (running on a PC) by MLIB-functions. A virtual reality scene is built up in the Matlab VR Toolbox. The procedure of the algorithm is as follows (inertia is assumed to be neglected): Read the encoders and use direct kinematics position of the end effector. Check collision detection. If no collision: No signals to the motors. If collision: Calculate a force and transform it to motor torques. Send PWM-signals from dSPACE to the motors based on the torques. A PD-controller is used to control the motor current. Graphic rendering of the tool object and a virtual scene for interaction. III. Test Results The setup has been tested for an example that shows a sphere inside a box. The sphere follows the position of the haptic device and when it collides with a side of the box a force is calculated in Matlab/Simulink and sent back to the haptic device. The haptic algorithm consists of a boundary-based collision detection algorithm and a spring model (F=kx) for force calculation. The graphical rendering of the virtual sphere is updated at 30 Hz and the haptic feedback is sent to the actuators at 1000 Hz. Figure 2 shows the setup.
Encoder 1 Encoder 2 Encoder 3 Pot.meter 1 Pot.meter 2 Pot.meter 3

dSPACE

Motor1 Motor2 Motor3

Simulink

1000 Hz 30 Hz

Virtual Environment
Figure 1. System and signal overview. MLIB enables the real time communication between Simulink and dSPACE. The Matlab VR Toolbox is used for 3D graphic rendering.

Figure 2. The setup: The dismantled Phantom Omni and the virtual environment. The haptic algorithm checks collision with the virtual walls and sends force feedback to the user.
References [1] Sensable Inc. www.sensable.com [2] Matlab/Simulink. www.mathworks.com [3] dSPACE. www.dspaceinc.com [4] Eriksson, M. Haptic and Visual Simulation of a Material Cutting Process. Licentiate Thesis 2006.

Anda mungkin juga menyukai