Quanser Q4
This card is no longer available. For a newer card with similar capabilities, visit the Quanser DAQ website.
The Quanser Q4 is an innovative H.I.L. control board with an extensive range of input and output support. A wide variety of devices with analog and digital sensors as well as quadrature encoders are easily connected to the Quanser Q4. This single-board solution is ideal for use in control systems and complex measurement applications.
The QUARC driver name for this card is q4 .
No other board offers this combination of features and performance! Ideal for control systems and measurement of complex systems. The features of the Quanser Q4 are:
This single board integration enables you to turn your PC into a powerful Desktop Control Station.
Clocks
The Quanser Q4 supports two hardware clocks: HARDWARE_CLOCK_0 (0) and HARDWARE_CLOCK_1 (1). Both clocks have 60 ns resolution and 32-bit range. The SYSTEM_CLOCK_1 (-1) clock is also supported. It has 1 ms resolution. The hardware clocks may also be configured as PWM outputs. HARDWARE_CLOCK_0 appears as a PWM output at the CNTR_OUT pin and HARDWARE_CLOCK_1 at the WATCHDOG pin.
By default, the clocks are configured as hardware timebases. To use the clocks as
PWM outputs, they must be configured on the HIL Initialize block's
Clocks tab. Set the Hardware clocks field to
all the clocks that will be used on the board for the current diagram.
For example, enter 0:1
to indicate hardware clocks HARDWARE_CLOCK_0 (0) and HARDWARE_CLOCK_1 (1). Specify 1
to indicate HARDWARE_CLOCK_1 (1) only.
Set the Clock mode field to the desired mode. If the vector specified in this field is shorter than the Hardware clocks vector, then the value of the last element in the vector will be used for the rest of the clocks. Hence, a scalar value will apply to all clocks specified in the Hardware clocks field. See the description of the HIL Initialize block for details on these modes.
The Quanser Q4 allows a third hardware "clock" to be specified as a timebase only: HARDWARE_CLOCK_2 (2).
This "clock" actually represents the external interrupt line, EXT_INT
. Specifying a value of 2
for the
hardware clock in a HIL timebase, stream or buffered I/O block causes the EXT_INT
line to be
used as the interrupt source so that an external clock may be used as a timebase. The Clock mode
cannot be set for this hardware clock because it can only be configured as a timebase and not a PWM output.
Analog Inputs
The Quanser Q4 supports 4 14-bit analog inputs with a ±10V range. Hence analog channel numbers range from 0 to 3.
Since the range of the analog inputs is fixed at ±10V, there is no need to configure the analog input ranges.
Analog Outputs
The Quanser Q4 supports 4 12-bit analog outputs in which each channel may be configured for a ±10V, ±5V
or 0-10V range. As there are 4 outputs, analog channel numbers range from 0 to 3.
The range of each analog output is individually programmable, so
each channel may be assigned one of the three supported ranges. The ranges are set on the
HIL Initialize block's
Analog Outputs tab by setting the Analog output maximums
and Analog output minimums
fields to the appropriate value of each channel indicated in the Analog output channels field.
For example, if the Analog output channels are set to
[0, 2, 3]
,
the Analog output maximums are set to [10, 5, 10]
and the Analog output minimums
are set to [-10, -5, 0]
then channel 0 will be configured for a ±10V output range, channel 2 for a ±5V output range,
and channel 3 as a 0-10V range.
In order to have analog outputs set to a particular voltage when the model is loaded
or unloaded, the analog outputs must be configured on the
HIL Initialize
block's Analog Outputs
tab. Set the Analog output channels field to
all the analog output channels that will be used on the board for the current diagram.
For example, enter 1:3
to indicate channels 1 through 3. Specify
[0, 2, 3]
to indicate channels 0, 2 and 3.
Set the Analog output maximums and the Analog output minimums field to the appropriate values for the desired analog output ranges. Then set the Initial analog outputs and Final analog outputs to the desired voltages.
If the vectors specified in these fields are shorter than the channel vector, the value of the last element in the vector will be used for the rest of the channels. Hence, a scalar value will apply to all channels specified in the Analog output channels field.
Digital Inputs
The Quanser Q4 supports 16 bidirectional digital I/O lines and 3 special digital input lines. Hence digital input channel numbers range from 0 to 18. Channels 16 through 18 are FUSE, EXT_INT and CNTR_EN respectively. A digital I/O line cannot be used as an input and output at the same time.
Since the first 16 digital I/O lines may be individually programmed as inputs or
outputs on the Quanser Q4, all of those 16 channels which will be used for digital inputs
should be configured on the HIL Initialize
block's Digital Inputs tab. Set the Digital input channels field to all
the digital I/O channels that will be used as digital inputs on the board for the current diagram. For example, enter
3:15
to designate channels 3 through 15 as digital inputs. Specify
[0, 4, 5]
to indicate that channels 0, 4 and 5 are to be configured
as digital inputs.
Digital Outputs
The Quanser Q4 supports 16 bidirectional digital I/O lines. Hence digital output channel numbers range from 0 to 15. A digital I/O line cannot be used as an input and output at the same time.
Since the 16 digital I/O lines may be individually programmed as inputs or outputs
on the Quanser Q4, all the channels which will be used for digital outputs should be configured
on the HIL Initialize block's
Digital Outputs tab. Set the Digital output channels
field to all the digital I/O channels that will
be used as digital outputs on the board for the current diagram. For example, enter
3:15
to designate channels 3 through 15 as digital outputs. Specify
[0, 4, 5]
to indicate that channels 0, 4 and 5 are to be configured
as digital outputs.
To set the digital output values when the model is loaded or unloaded, set the Initial digital outputs and Final digital outputs to the desired values respectively. If the vectors specified in these fields are shorter than the channel vector, the value of the last element in the vector will be used for the rest of the channels. Hence, a scalar value will apply to all channels specified in the Digital output channels field.
Each digital output can source up to 25 mA of current maximum, with a total of 75 mA maximum for each set of four channels (0-3, 4-7, etc). Do not exceed these maximums!
Encoder Inputs
The Quanser Q4 supports 4 quadrature encoder inputs with 24-bit count values. Hence encoder channel numbers range from 0 to 3.
In order to set the encoder counters to a particular count or to change the default
quadrature or filter frequency when the model is loaded, the encoder inputs must
be configured on the HIL Initialize
block's Encoder Inputs tab. Set the Encoder input channels
field to all the encoder channels that will be
used on the board for the current diagram. For example, enter
2:3
to
indicate channels 3 through 3 are used as encoder inputs. Specify
[0, 2, 3]
to indicate that channels 0, 2 and 3 are used as encoder inputs.
The Quanser Q4 supports non-quadrature (count and direction), 1X quadrature, 2X quadrature
and 4X quadrature. The Quanser Q4 supports filter frequencies of
1 /(60e-9 * N)
where N
=1..511. In other words, valid Quanser Q4 filter frequencies range from
33kHz to 16.7MHz. Since the Quanser Q4 has 24-bit counters, valid initial count values range
from -8,388,608 to +8,388,607. If the vectors specified in these fields are shorter
than the channel vector, the value of the last element in the vector will be
used for the rest of the channels. Hence, a scalar value will apply to all channels
specified in the Encoder input channels field.
PWM Outputs
The Quanser Q4 driver supports two PWM output channels using its two hardware clocks. Change the mode of a hardware clock to use it as a PWM output. See the section on Clocks above.
In order to configure the PWM mode or frequency, or to set the value of the PWM
outputs when the model is loaded or unloaded, the PWM outputs must be configured
on the HIL Initialize block's
PWM Outputs tab. Set the PWM output channels
field to all the PWM output channels that will be
used on the board for the current diagram. For example, enter 0:1
to
indicate channels 0 and 1. Specify 1
to indicate channel 1 alone.
Set the PWM output mode field to the desired output mode. The Quanser Q4 supports all the PWM output modes: duty cycle, frequency or period. See the description of the HIL Initialize block for details on these modes. Then set the Frequencies in Hz or duty cycle field to the desired frequency or duty cycle. The Quanser Q4 supports PWM output frequencies from 0.008Hz to 16.7MHz. However, the PWM output frequency affects the number of bits of resolution. For example, a frequency of 16.276kHz results in 10 bits of resolution in the duty cycle, while a frequency of 4.069kHz results in 12 bits of resolution. A frequency of 65.104kHz results in 8 bit resolution. If the vectors specified in these fields are shorter than the channel vector, the value of the last element in the vector will be used for the rest of the channels. Hence, a scalar value will apply to all channels specified in the PWM output channels field.
Other Inputs
The Quanser Q4 card does not support other inputs.
Other Outputs
The Quanser Q4 card does not support other outputs.
Interrupts
The Quanser Q4 supports 10 different interrupt sources. Interrupts may be generated from the encoders or external interrupt sources.
Fuse interrupt
The Quanser Q4 is capable of detecting if the fuse on the terminal board blows. While the fuse should never blow under normal operation, failure of the fuse is a safety-critical event so the Quanser Q4 is capable of generating an interrupt when it happens. Use interrupt channel 0 to respond to this interrupt.
External interrupt (EXT_INT) interrupt
This interrupt is generated when a falling edge appears on the EXT_INT pin on the Control header. Use interrupt channel 1 to respond to this interrupt.
Encoder index pulse interrupts
Each encoder channel is capable of generating an interrupt when the index pulse is seen. There is a separate interrupt for each encoder channel. Use interrupt channels 1000-1003 to respond to these interrupts for encoder channels 0-3 respectively.
Encoder error interrupts
The Quanser Q4 can determine if there is excessive noise on an encoder channel. While excessive noise may not lead to an error in the encoder counts due to the on-board digital filtering, it is a condition that warrants attention. Each encoder channel is capable of generating an interrupt when excessive noise is seen on the inputs. There is a separate interrupt for each encoder channel. Use interrupt channels 4400-4403 to respond to these interrupts for encoder channels 0-3 respectively.
Watchdog
The Quanser Q4 supports the use of the 32-bit general purpose clock, HARDWARE_CLOCK_0, as a watchdog timer. The timer may be programmed with any interval between 60 ns and 128 seconds. The board is capable of resetting the analog outputs to 0V and the digital outputs to tristate (pulled high by internal 47K resistive pullups) upon expiration of the watchdog timer. Resetting of the outputs occurs without software intervention, and therefore may be used as a safety mechanism in the event of software failure.
To enable the resetting of the analog and digital outputs, check the "Set analog outputs at watchdog expiration" and "Set digital outputs on watchdog expiration" options in the HIL Initialize block parameters and set the analog and digital outputs on watchdog expiration to 0 V and 2 (tristate) respectively. Then place a HIL Watchdog block in the diagram.
When the watchdog functionality is used, the WATCHDOG
pin will reflect the status of the
watchdog timer. The WATCHDOG
pin may be found on the CONTROL header on the Quanser Q4 terminal
board. This pin is normally high. If the watchdog timer is allowed to
expire, then this pin will go low. Once the watchdog has expired, further I/O is disabled until the
watchdog state is cleared or the watchdog timer is stopped. The watchdog pin remains low after expiration
until the watchdog is restarted or the watchdog is configured for other functionality, such as a PWM output
or hardware timebase.
Hence, in Simulink models, the WATCHDOG
pin will remain low after watchdog
expiration even after the model is stopped, unless a HIL Watchdog Clear
block is used to clear the watchdog state. Restarting the model causes the WATCHDOG
pin to go
high once more. These semantics make the WATCHDOG
pin useful for ensuring product safety.
The fuse on the Quanser Q4 terminal board also acts as a watchdog in the sense that if the fuse blows, the analog outputs are reset to 0V and the digital outputs go tristate (pulled high by internal pullups). In this case, the model or application should be stopped and only restarted once the fuse has been replaced. This action of the fuse cannot be disabled.
Board-Specific Options
The Quanser Q4 card does not support any board-specific options.
Properties
The Quanser Q4 driver currently supports the following read-only properties:
Property |
Type |
Description |
---|---|---|
PROPERTY_INTEGER_VENDOR_ID |
Integer |
PCI vendor ID |
PROPERTY_INTEGER_PRODUCT_ID |
Integer |
PCI device ID |
PROPERTY_INTEGER_SUBVENDOR_ID |
Integer |
PCI subvendor ID |
PROPERTY_INTEGER_SUBPRODUCT_ID |
Integer |
PCI subdevice ID |
PROPERTY_STRING_MANUFACTURER |
String |
Manufacturer name |
PROPERTY_STRING_PRODUCT_NAME |
String |
Product name |
PROPERTY_STRING_MODEL_NAME |
String |
Model name |
Targets
Target |
Supported |
Comments |
---|---|---|
Yes |
Fully supported. |
|
Yes |
Fully supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
No |
Not supported. |
|
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Supported with no communication to the hardware. |
Normal simulation |
Yes |
Supported with no communication to the hardware. |
See Also
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.