Start of trail End of trail navigation bar

Table of Contents

Schunk Gripper Control

Sends position, velocity, and current control commands to the Schunk gripper and reads the position, velocity, and current values from the module.

Library

QUARC Targets/Devices/Third-Party/Schunk/Grippers

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

qc_open_library('quarc_library/Devices/Third-Party/Schunk/Grippers')

Description

Schunk Gripper Control

The Schunk Gripper Control block sends position, velocity, and current commands to the gripper module over an RS232 connection and reads the module's position, velocity and current. The block supports three modes: position control mode, velocity control mode, and current control mode. This mode may be specified internally in the block parameters, or externally via an extra input to the block. Using an external block input allows the mode of operation to change during block execution. If the control mode is specified via the block's Control mode parameter then the control mode is fixed for the duration of the model's execution.

The Schunk Gripper Control block spawns a separate thread to communicate with the gripper module. The priority of this thread is specified using the Priority parameter of the block. Since a separate thread is generated to communicate with the gripper, it is not necessary to account for communication delays when setting the sample rate of the block. Note that the thread may not update the gripper command and outputs at every sampling instant.

Installation Requirements

Install In order to use the Schunk Gripper Control block, the Schunk PowerCube software must be installed. The software should be included with the gripper module, or can be downloaded from the Schunk website. It is recommended that the PowerCube software be installed and tested to ensure that the software is installed correctly and can communicate properly with the gripper. The PowerCube software can also be used to verify the properties of your gripper module such as the module ID, port, and baud rate.

The PowerCube directory must be added to the Path environment variable. For example, if installed under C:\Program Files\amtec robotics, the following should be added to the Path environment variable: C:\Program Files\amtec robotics\PowerCube Software.

Input Ports

cmd

A scalar command sent to the gripper. The units of this input value depend on the control mode. In position control mode, the cmd input is given in metres (m). In velocity control mode, the cmd input is given in metres per second (m/s). In current control mode, the cmd input is given in amperes (A).

vel

A scalar specifying the maximum velocity in m/s used for a trajectory when the module is operating in position control mode. Refer to the gripper documentation for limits on the maximum velocity.

accel

A scalar specifying the maximum acceleration in m/s² used for a trajectory when the module is operating in position control mode. Refer to the gripper documentation for limits on the maximum acceleration.

mode

A scalar specifying the mode of operation of the gripper. This input takes a value of type uint8 and the supported values/modes are as follows:

Mode

Description

1

position control

2

velocity control

3

current control

Output Ports

pos

A scalar output for the last known actual position of the gripper in m.

vel

A scalar output for the last known actual velocity of the gripper in m/s.

cur

A scalar output for the last known actual current of the gripper motor in A.

state

A scalar of type uint32 corresponding to the last known module state. Refer to the gripper documentation for details on the state codes and their meaning.

Parameters and Dialog Box

Schunk Gripper Control

Module ID

The module ID of the gripper being used. Refer to the gripper documentation to determine the correct module ID for your gripper.

Port

The serial port used to communicate between the target and the gripper module. Only enter the port number. For example, enter 1 instead of COM1.

Baud

The baud rate used for serial communications with the gripper module.

Control mode external

If this option is not checked then the control mode is determined by the Control mode parameter. Otherwise, if this option is checked, then the control mode is determined externally via the mode input. In this case, the Control mode parameter is disabled and ignored.

Control mode

When Control mode external is not checked, this dropdown can be used to select the operating mode of the block. The currently supported modes are position, velocity, and current control.

Home module at start

A checkbox used to home the module when the model is started. Grippers typically need to be homed before position control can be used. For some grippers, it is not necessary to home the module each time the model is run as long as the module power is not shut off. Refer to the documentation for your specific gripper for details on the homing procedure.

Priority

The priority of the thread. In general, a value of 0 indicates the lowest priority and higher values indicate a higher priority. The number of priority levels available depends on the type of QUARC target for which code is being generated.

Sample Time

The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

To use the fundamental sampling time of the model, set the sample time to qc_get_step_size, which is a QUARC function that returns the fundamental sampling time of the model.

A sample time of -1 indicates that the block inherits its sample time from its inputs. The default sample time is set to -1.

Active during normal simulation

Indicates whether this block should access hardware during normal simulation. If this option is checked then the Schunk Gripper will be controlled by this block during normal simulation. Such access is convenient for verifying that information is retrieved from the gripper properly. However, the gripper position, velocity or current should generally not be driven during normal simulation to avoid damage to the device, since a normal simulation does not run in real time.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

No

No

QUARC Linux Nvidia Target

No

No

QUARC Linux QBot Platform Target

No

No

QUARC Linux QCar 2 Target

No

No

QUARC Linux QDrone 2 Target

No

No

QUARC Linux Raspberry Pi 3 Target

No

No

QUARC Linux Raspberry Pi 4 Target

No

No

QUARC Linux RT ARMv7 Target

No

No

QUARC Linux x64 Target

No

No

QUARC Linux DuoVero Target

No

No

QUARC Linux DuoVero 2016 Target

No

No

QUARC Linux Verdex Target

No

No

QUARC QNX x86 Target

No

No

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

No

No

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

No

No

* Compatible means that the block can be compiled for the target.

See Also

 

navigation bar