Host Force Feedback Button-Triggered Ramp Force Host Force Feedback Externally-Triggered Ramp Force navigation bar

Table of Contents

Host Force Feedback Button-Triggered Ramp Torque

Produces a ramp torque effect on a game controller on the host that is triggered by a button.

Library

QUARC Targets/Devices/Peripherals/Host/Force Feedback Game Controllers/Ramp Force Effects

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/Peripherals/Host/Force Feedback Game Controllers/Ramp Force Effects')

Description

Host Force Feedback Button-Triggered Ramp Torque

The Host Force Feedback Button-Triggered Ramp Torque block produces a torque on the host game controller in response to a button being pressed on the game controller that ramps from the starting magnitude to the ending magnitude specified at the block's start and end inputs respectively.

The Tx, Ty and Tz inputs define a torque vector whose direction determines the direction of the torque applied by the game controller. The start and end magnitudes and direction of this torque are updated every sampling instant according to the inputs to the block, although the torque is only active after the specified button is pressed. The parameters of the block determine the temporal characteristics of the effect, such as the duration and envelope. A Host Force Feedback Game Controller block must be present in the model to configure the game controller.

Limitations

Unused axes

Warning Unused axes should be left unconnected or connected to the

Ground

MATLAB Command Line

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

doc('Ground')
block. Do not connect unused axes to any other type of block because doing so will require a game controller with all the connected axes. For example, if the Tx, Ty and Tz inputs are all connected then the game controller will need to support all three axes in order for the effect to be rendered.

Level of support

Warning Not all force feedback game controllers will support a ramp torque effect that is triggered by a button. If button-triggered ramp torque effects are supported, a game controller may not support all the axes or features of this block.

Conditionally-executed subsystems

Warning Force effects are downloaded to the device and implemented by the device itself. Hence, placing this blocking in a conditionally-executed subsystem does not disable the effect when the subsystem is not being executed. Instead of using a conditionally-executed subsystem, set the magnitude of the torque to zero or use a Host Force Feedback Externally-Triggered Ramp Torque block for this purpose and trigger it using the button states read by the Host Force Feedback Game Controller block.

MATLAB/Simulink R2010a Support

Warning Note that the Host Force Feedback Button-Triggered Ramp Torque block available in this build of QUARC 2.1 does not currently support MATLAB/Simulink R2010a. Quanser is currently working on a solution to not only have this block work with MATLAB/Simulink R2010a but also greatly improve its overall performance and capabilities.

Input Ports

Tx

The X component of the direction of the applied torque. The positive X direction is from left to right. If this axis is unused, connect it to a

Ground

MATLAB Command Line

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

doc('Ground')
block or leave it unconnected.

Ty

The Y component of the direction of the applied torque. The positive Y direction is from left to right. If this axis is unused, connect it to a

Ground

MATLAB Command Line

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

doc('Ground')
block or leave it unconnected.

Tz

The Z component of the direction of the applied torque. The positive Z direction is from left to right. If this axis is unused, connect it to a

Ground

MATLAB Command Line

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

doc('Ground')
block or leave it unconnected.

start

The initial magnitude of the normalized torque (-1.0=-maximum, 0.0=no torque, 1.0=+maximum) to apply in the direction specified by the input vector (Tx, Ty, Tz). Negative magnitudes reverse the direction of the applied torque. If an envelope is applied then the torque actually starts at the Envelope attack level and this value is used instead to calculate the ramp torque during the "sustain" portion of the envelope in which the torque ramps linearly.

end

The final magnitude of the normalized torque (-1.0=-maximum, 0.0=no torque, 1.0=+maximum) to apply in the direction specified by the input vector (Tx, Ty, Tz). Negative magnitudes reverse the direction of the applied torque. If an envelope is applied then the torque actually ends at the Envelope fade level and this value is used instead to calculate the ramp torque during the "sustain" portion of the envelope in which the torque ramps linearly.

Output Ports

This block has no output ports.

Parameters and Dialog Box

Host Force Feedback Button-Triggered Ramp Torque

Controller name

The identity of the associated Host Force Feedback Game Controller block. The Host Force Feedback Button-Triggered Ramp Torque block must be associated with a Host Force Feedback Game Controller block.

Effect gain (tunable online)

A normalized gain to apply to the effect. The torques are scaled by this gain before being applied to the device. The gain must be a fraction between 0 and 1 inclusive. This parameter is useful for scaling effects for a different game controller.

Button number (tunable online)

The button which will trigger the effect. Up to 32 buttons are supported on Windows, with buttons numbered from 0 to 31. Button 0 is typically the "fire" button on the game controller.

Trigger repeat interval (tunable online)

The interval in seconds between the end of one playback and the start of the next when the effect is triggered by a button press and the button is held down. Setting this value to -1 prevents repetition.

Envelope attack level (tunable online)

The normalized magnitude (0.0=no torque, 1.0=maximum) of the torque at the beginning of playback. The effect will increase (or decrease) quadratically from this magnitude to the value it would be at the envelope attack time if no envelope were applied.

Envelope attack time (tunable online)

The amount of time in seconds for the magnitude of the effect to increase (or decrease) quadratically from the attack level to the value it would be at the envelope attack time if no envelope were applied. This parameter may be zero.

Envelope fade level (tunable online)

The normalized magnitude (0.0=no torque, 1.0=maximum) of the torque at the end of playback. The effect will decrease (or increase) quadratically from the value it would be at the envelope fade time if no envelope were applied, down (or up) to this fade level.

Envelope fade time (tunable online)

The amount of time in seconds for the magnitude of the effect to decrease (or increase) quadratically from the value it would be at the envelope fade time if no envelope were applied, down (or up) to the fade level. This parameter may be zero.

Effect duration (tunable online)

The total duration of the effect in seconds. It should be larger than sum of the envelope's attack and fade times. The difference between the effect duration and the sum of the attack and fade times determines the time for which the ramp torque is linear and independent of the envelope.

Delay in starting the effect (tunable online)

The time in seconds to delay starting the effect after the trigger button is pressed.

Effect sampling period (tunable online)

The sampling period of the effect in seconds. This parameter determines the sampling period of the effect on the device itself. It is not related to the sample time of this block. If this value is zero, the default sampling period is used.

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.

A sample time of -1 indicates that the block inherits its sample time from its inputs.

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.

The default sample time is set to -1 because this block typically inherits its sample time from its inputs.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

Yes

Yes

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

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

See Also

 

navigation bar