Table of Contents > QUARC > User's Guide > Using Devices
Haptics
Advanced robotic control applications require sophisticated mathematical algorithms such as forward and inverse kinematics. These algorithms are not easy to derive and require detailed knowledge about the robot's dimensions and other parameters. QUARC provides a set of blocks to be used in implementing control algorithms for haptic devices manufactured by Quanser. Using these blocks can significantly simplify the task of designing controllers for such devices. Currently provided blocks for this purpose can be found in the Simulink Library Browser under the QUARC Targets/Devices/Quanser/Haptics/Pantographs/Haptic 5-DOF Wand library. These blocks can be used when working with Quanser's Haptic 5 Degree of Freedom Wand whose image is depicted below.
The Haptic 5-DOF Wand is a redundant actuator robot that can be used for robotic applications as well as haptic applications. There are a total of 6 DC motors installed on the system. Each of the top and bottom pantographs seen in the figure above are driven by three motors, two at their shoulders and another more powerful motor at their waist. Position measurement of the actuated joints is obtained by using 6 high resolution optical encoders mounted directly to the rear of each motor.
In order to implement controllers for the Haptic 5-DOF Wand robot, the first thing that needs to be done is to convert joint angles to world co-ordinates such that the task space position of the end-effector handle is fully described and available to use throughout the design. For the Haptic 5-DOF Wand, position can be described by a 5-element vector with each element corresponding to a freedom degree of the robot. The encoders measure the number of turns each motor shaft has made. In order to get the robot's joint angles the Haptic 5-DOF Wand Joint Angles block can be used which can be found in the Simulink Library Browser under the QUARC Targets/Devices/Quanser/Haptics/Pantographs/Haptic 5-DOF Wand/Interfacing library. Input to this block is a 6-element vector containing the number of counts on each of the 6 encoders. The block outputs a 6-element vector containing the robot's 6 joint angles in radians. More information about this block can be found in the Haptic 5-DOF Wand Joint Angles block section in QUARC documentation.
Once joint angles are obtained the Haptic 5-DOF Wand Forward Kinematics block can be used to convert them to world co-ordinates. The Haptic 5-DOF Wand Forward Kinematics block can be found in the Simulink Library Browser under the QUARC Targets/Devices/Quanser/Haptics/Pantographs/Haptic 5-DOF Wand/Kinematics library. The input to this block is a 6-element vector denoting the joint space angles of each of the 6 robot joints. The block outputs a 5-element vector containing the world co-ordinate position and orientation of the robot's end-effector handle. The first three elements of the output vector denote the x, y and z position of the end-effector in millimeters and the last two elements denote its orientation (yaw and roll respectively) in Radians. For more information about this block please refer to the Haptic 5-DOF Wand Forward Kinematics block section in QUARC documentation.
The diagram below shows a hypothetical position control system for the 5-DOF Haptic Wand that uses this block. Please keep in mind that this model does not necessarily implement a complete control system and should not be used as a template for control design. The model is only presented for illustration purposes.
The Haptic 5-DOF Wand Plant block could contain a sub-system in which interfacing to the hardware is implemented using appropriate read and write HIL Blocks. An example sub-system that achieves this task is depicted below. Please note that this example is simplified and is only meant to illustrate that the plant is interfaced to the hardware using HIL Blocks. In a complete such sub-system, other blocks such as Saturation or signal conversion blocks may be present.
The channels containing encoder counts are read in via the HIL Read Encoder block and assigned to the Encoder Counts signal. This signal is input to the Haptic 5-DOF Wand Joint Angles block which as mentioned above outputs the robot's joint angles in radians as a 6-element vector. The resulting angs signal can now be fed into the Haptic 5-DOF Wand Forward Kinematics block which in turn outputs the world co-ordinate position and orientation of the end-effector handle as a 6-element vector. This signal along with the desired position/orientation can be fed into a position controller sub-system that calculates the force that should be exerted on the end-effector handle in order to track the set-point. However this force needs to be converted to a current and eventually a voltage that can be applied to the motors. The force to torque conversion can be done using the Haptic 5-DOF Wand Inverse Force Kinematics block. The Haptic 5-DOF Wand Inverse Force Kinematics block can be found in the Simulink Library Browser under the QUARC Targets/Devices/Quanser/Haptics/Pantographs/Haptic 5-DOF Wand/Kinematics library and can be used to convert world co-ordinate end-effector forces to joint torques. Inputs to this block are a 6-element vector containing joint space angles in radians and a 5-element vector containing translational forces and torques exerted on the end-effector handle. The first three elements of the second input to this block are expressed in Newtons while the last two are expressed in Newton-millimeters. The block outputs a 6-element vector that contains joint torques in Newton-millimeters. For more information about this block please refer to the Haptic 5-DOF Wand Inverse Force Kinematics block section in QUARC documentation.
Once the joint torques are obtained the resulting signal is fed into the Haptic 5-DOF Wand N-mm to Amps block. This block is used to convert joint torques to motor currents and can be found in the Simulink Library Browser under the QUARC Targets/Devices/Quanser/Haptics/Pantographs/Haptic 5-DOF Wand/Interfacing library. Input to this block is a 6-element vector containing joint torques in Newton-millimeters while the output is a 6-element vector containing the current to be applied to each motor in Amperes. For more information about this block please refer to the Haptic 5-DOF Wand N-mm to Amps block section in QUARC documentation.
The signal output by the Haptic 5-DOF Wand N-mm to Amps block needs to be converted to a voltage before being applied to the motors. This can be achieved by using the Haptic 5-DOF Wand Motors block which can be found in the Simulink Library Browser under the QUARC Targets/Devices/Quanser/Haptics/Pantographs/Haptic 5-DOF Wand/Interfacing library. Input to this block is a 6-element vector containing currents to be applied to each of the 6 motors of the Haptic 5-DOF Wand. The block outputs a 6-element vector containing the voltages required at the analog outputs to produce the desired motor currents. For more information about this block please refer to the Haptic 5-DOF Wand Motors block section in QUARC documentation.
The voltages output by the Haptic 5-DOF Wand Motors block are fed into the plant where as shown in the figure above the HIL Write Analog block is used to write the voltage values to the Q8.
The Inverse Kinematics block found in the Simulink Library Browser under the QUARC Targets/Devices/Quanser/Haptics/Pantographs/Haptic 5-DOF Wand/Kinematics library, performs the opposite functionality of the Forward Kinematics block. The input to this block is a 5-element vector containing the world co-ordinate position and orientation of the robot's end-effector handle. The block outputs a 6-element vector containing the joint angles of the robot in radians. For more information about this block please refer to the Haptic 5-DOF Wand Inverse Kinematics block section in QUARC documentation.
The Velocity Kinematics block is found in the same library as mentioned above and can be used to convert joint angular velocities to world co-ordinate velocities. Inputs to this block are a 6-element vector containing joint space angles in radians and a 6-element vector containing joint angular velocities in radians per second. The block outputs a 6-element vector that contains the world co-ordinate translational and angular velocities of the end-effector handle. The first three elements in the block's output represent translational velocities (in millimeters per second) of the end-effector in the x, y and z directions respectively. The last two elements represent end-effector's angular velocity (in radians per second) around x and y axes respectively. For more information about this block please refer to the Haptic 5-DOF Wand Velocity Kinematics block section in QUARC documentation.
The Inverse Force Kinematics block is found in the same library is mentioned above and can be used to convert world co-ordinate end-effector forces to joint torques. Inputs to this block are a 6-element vector containing joint space angles in radians and a 5-element vector containing translational forces and torques exerted on the end-effector handle. The first three elements of the second input to this block are expressed in Newtons while the last two are expressed in Newton-millimeters. The block outputs a 6-element vector that contains joint torques in Newton-millimeters. For more information about this block please refer to the Haptic 5-DOF Wand Inverse Force Kinematics block section in QUARC documentation.
In order to take safety precautions when operating the Haptic 5-DOF Wand robot, it is recommended to always have an emergency stop push button connected to your setup. This gives you the ability to completely disable the system to prevent damage to operating personnel and the robot in case an emergency occurs or the controller goes unstable. The Haptic 5-DOF Wand Emergency Stop block can be used to monitor the status of the emergency stop push button. Input to this block is a 2-element vector read from the digital input channels of the connected HIL board. For example digital input channels 14 and 30 on the Q8 HIL board are typically used to read the status of the emergency stop. The Haptic 5-DOF Wand Emergency Stop block outputs the status of the emergency stop push button (1 = engaged, 0 = not engaged). Figure below adds this block to the plant sub-system example discussed earlier.
Please note that there are additional blocks available to use with the Haptic 5-DOF Wand that can be found in the Simulink Library Browser under the QUARC Targets/Devices/Quanser/Haptics/Pantographs/Haptic 5-DOF Wand/Interfacing library. Please refer to each block's documentation for more details by right-clicking on the block and selecting .
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.