Clocks Analog Inputs Analog Outputs Digital Inputs Digital Outputs Encoder Inputs PWM Outputs Other Inputs Other Outputs Interrupts Watchdog Board-Specific Options Properties Targets See Also navigation bar

Quanser QBot Platform

The Quanser QBot Platform is an Unmanned Ground Vehicle (UGV) built and sold by Quanser Inc. The Quanser QBot Platform is based around an NVIDIA Jetson Orin Nano, which has a 6-core Arm® Cortex®-A78AE v8.2, 1.5 GHz 64-bit CPU with 4 GB 64-bit LPDDR5 34 GB/s RAM. It also contains a 512-core NVIDIA Ampere GPU with 16 Tensor cores with CUDA support, an Intel D435 RGBD camera and additional I/O supplied by Quanser. The QUARC Target associated with the Quanser QBot Platform is the QUARC Linux QBot Platform Target. The Quanser QBot Platform HIL card may only be used with QUARC when this target is selected. The following characteristics are of particular interest when using the Quanser QBot Platform with QUARC:

* Communications channels are accessed through the Stream API blocks, see Serial protocol, SPI protocol and I2C protocol.

The QUARC driver name for this card is qbot_platform.

To select the Quanser QBot Platform HIL board, select the QUARC qbot_platform board type from the drop-down list on the Main tab of the HIL Initialize block.

Warning

Note that the QUARC Linux QBot Platform Target must be selected to use the Quanser QBot Platform board.

The Quanser QBot Platform supports different means of communicating with it as a target. It supports wireless (WiFi) communications, which is most readily configured initially by connecting a monitor, mouse and keyboard and using the Ubuntu OS desktop to connect to the WiFi router. If a wireless connection is used then its IP address will show up on the LCD display with a WiFi symbol beside it. Once configured, it should reconnect automatically whenever the WiFi signal is available.s

The Quanser QBot Platform also supports a 10/100/1000 Mbps wired LAN connection. If the LAN connection is used, its IP address will show up on the LCD display with a LAN symbol beside it. If both WiFi and LAN are connected then the LAN IP address will be displayed on the LCD display, as it is the fastest connection. In the case of WiFi or LAN the IP address is determined by the adapter settings. Typically, the IP address is assigned dynamically by a DHCP server on the network.

Display

The LCD display on the Quanser QBot Platform typically displays the battery voltage and IP address of the card, as well as status messages.

The LCD display on the Quanser QBot Platform may also be driven from QUARC using the LCD Display block. Select the WS0010 display type.

The URI to use for this display is lcd://qbot_platform:1.

Warning

The LCD has a refresh rate of 49 Hz, thus it would not show the display characters if the LCD is being written faster than that. In certain conditions, if the LCD is not able to keep up, a message Writing to LCD too fast will be shown on the LCD. Please power cycle the Quanser QBot Platform in order resolve this.

Communications

The communications ports provided on the Quanser QBot Platform board can be utilized through the QUARC Communications blockset and the Quanser Stream API (see QUARC Communications Protocols).

For SPI communications, a sample URI for communications would be:

spi://localhost:0?baud='1000000',phase='off',lsb='off',frame='0'

where the frame option selects the SPI CE line to frame the SPI bus transaction (0 or 1). Note that the SPI port must be enabled using the jetson-io.py utility for SPI communications to be used. Once the SPI port is enabled, the corresponding digital I/O will no longer be available as digital I/O.

For I2C communications, a sample URI for communications would be:

i2c://localhost:0?baud='400000',address=0x69

where the address option specifies the I2C slave address. Note that the I2C port must be enabled using the jetson-io.py utility for I2C communications to be used. Once the I2C port is enabled, the corresponding digital I/O will no longer be available as digital I/O.

For serial communications, a sample URI for communications would be:

serial://localhost:1?baud='115200',word='8',parity='none',stop='1'

The UART must be enabled using the jetson-io.py utility for UART communications to be used. Once the UART port is enabled, the corresponding digital I/O will no longer be available as digital I/O.

Clocks

There are currently no configuration options for the Quanser QBot Platform clocks.

Analog Inputs

The Quanser QBot Platform supports 6 analog inputs. Hence, analog input channel numbers range from 0 to 5. The full suite of analog inputs are enumerated in the table below:

Channel

Description

0

Battery 0 voltage (typically 12.1V when fully charged)

1

Battery 1 voltage (typically 12.1V when fully charged)

2

Motor 0 (left) current in Amps

3

Motor 1 (right) current in Amps

4

PCB current in Amps

5

PCB voltage

Analog Outputs

The Quanser QBot Platform card does not support analog outputs.

Digital Inputs

The Quanser QBot Platform supports 36 digital inputs. The first 28 channels are user-accessible reconfigurable digital I/O lines that may be used as digital inputs. Channels 0 and 1, however, are reserved for a HAT EEPROM I2C interface. A digital I/O line cannot be used as an input and output at the same time. Nor can it be used for communications (SPI, I2C or UART) or PWM at the same time. The full suite of digital inputs are enumerated in the following table:

Since the digital I/O lines may be individually programmed as inputs or outputs on the Quanser QBot Platform, all 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 2:4 to designate channels 2 through 4 as digital inputs. Specify [2, 4, 5] to indicate that channels 2, 4 and 5 are to be configured as digital inputs.

Channel

Description

0-27

User-accessible bidirectional digital I/O lines.

28

Motor 0 (left) stall detect

29

Motor 0 (left) stall error

30

Motor 0 (left) overcurrent detect

31

Motor 0 (left) overcurrent error

32

Motor 1 (right) stall detect

33

Motor 1 (right) stall error

34

Motor 1 (right) overcurrent detect

35

Motor 1 (right) overcurrent error

36

Limit switch 0

37

Limit switch 1

38

Battery 0 connected

39

Battery 1 connected

Digital Outputs

The Quanser QBot Platform supports 31 digital outputs. The first 28 channels are user-accessible reconfigurable digital I/O lines that may be used as digital outputs.A digital I/O line cannot be used as an input and output at the same time. Nor can it be used for communications (SPI, I2C or UART) or PWM at the same time.

Since the digital I/O lines may be individually programmed as inputs or outputs on the Quanser QBot Platform, 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 bidirectional digital I/O channels that will be used as digital outputs on the board for the current diagram. For example, enter 2:4 to designate channels 2 through 4 as digital outputs. Specify [2, 4, 5] to indicate that channels 2, 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.

The full suite of digital outputs are enumerated in the following table:

Channel

Description

0-27

User-accessible bidirectional digital I/O lines. Note that channels 0 and 1 are reserved by the O/S for identifying custom Pi 4 daughterboards and cannot be used.

28

Motor 0 (left) enable

29

Motor 1 (right) enable

30

QArm mini power enable

31

Doward facing LEDs power enable

Encoder Inputs

The Quanser QBot Platform supports two encoder inputs. The encoder channels are enumerated in the table below:

Channel

Description

0

Motor 0 (left)

1

Motor 1 (right)

In order to set the encoder counters to a particular count, 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 0:1 to indicate channels 0 through 1 are used as encoder inputs.

PWM Outputs

The Quanser QBot Platform driver supports up to 5 PWM output channels. Hence, PWM output channels range from 0 to 4. Each PWM channel is completely independent and can have its own duty cycle and frequency.

Channels 0 and 1 are used to control the two motors on the Quanser QBot Platform, with fixed mode (duty cycle), frequency (23195), configuration (bipolar), alignment (leading-edge), and polarity (active high) settings.

Channels 2 to 4 are the Orin Nano GPIO PWM channels, which can have frequency up to 800000 Hz. Before they may be used, they must be configured using jetson-io.py utility. The jetson-io.py utility must be run with root privileges. The following table documents the PWM channel, GPIO number, and jetson-io.py utility name for each PWM channel for the Orin Nano GPIO PWM channel.

PWM channel

GPIO number

jetson-io name

2

GPIO 22

pwm1

3

GPIO 13

pwm5

4

GPIO 12

pwm7

Warning

Note that once a GPIO is configured as a PWM channel then it will no longer be recognized as a digital I/O line.

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.

The maximum frequency for theses generic PWM channel is 800 kHz, and the minimum frequency is 9.1553 Hz.

Set the PWM output frequency (a.k.a., pulse rate) in the "Frequencies in Hz or duty cycle" field. The PWM output mode is typically set to duty cycle mode (0) or time mode (4) when driving ESCs or R/C servos. Set the Initial PWM outputs and Final PWM outputs fields to the desired initial and final output values respectively. The interpretation of these output values depends on the PWM mode selected. 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 QBot Platform supports eight other input channels. The other input channels are defined as follows:

Other Input Channel

Description

Units

3000

Gyroscope in X

(rad/s)

3001

Gyroscope in Y

(rad/s)

3002

Gyroscope in Z

(rad/s)

3003

Motor 0 (left) speed

(rad/s)

3004

Motor 1 (right) speed

(rad/s)

4000

Accelerometer in X

(m/s2)

4001

Accelerometer in Y

(m/s2)

4002

Accelerometer in Z

(m/s2)

14000

Encoder velocity for motor 0 (left)

(counts/s)

14001

Encoder velocity for motor 1 (right)

(counts/s)

As a reference, the generic table for the Other channels for any HIL Data Acquisition Card is reproduced below. SI units are used.

Other Channel

Description

Units

0 - 999

Linear position along the X, Y and Z axis

(m)

1000 - 1999

Angular position around the X, Y and Z axis

(rad)

2000 - 2999

Linear velocity along the X, Y and Z axis

(m/s)

3000 - 3999

Angular velocity around the X, Y and Z axis

(rad/s)

4000 - 4999

Linear acceleration along the X, Y and Z axis

(m/s2)

5000 - 5999

Angular acceleration around the X, Y and Z axis

(rad/s2)

6000 - 6999

Force along the X, Y and Z axis

(N)

7000 - 7999

Torque around The X, Y and Z axis

(N.m)

8000 - 8999

Magnetic Field Along The X, Y and Z axis

(T)

9000 - 9999

Pressure along the X, Y and Z axis

(Pa)

10000 - 10999

Temperature along the X, Y and Z axis

(°C)

11000 - 11999

Operating capacity as a percentage (0.0 to 1.0 represending 0% to 100%)

(%)

12000 - 12999

Time

(s)

13000 - 13999

Counts

(counts)

14000 - 14999

Counts per second

(counts/s)

15000 - 15999

Counts per second2

(counts/s2)

16000 - 16999

Enumerated quantity

Other Outputs

The Quanser QBot Platform supports six other output channels. Refer to the table below for a list of the channels:

Channel

Description

Units

11000

LED strip 0 red

(0.0 to 1.0 represending 0% to 100%)

11001

LED strip 0 green

(0.0 to 1.0 represending 0% to 100%)

11002

LED strip 0 blue

(0.0 to 1.0 represending 0% to 100%)

11003

LED strip 1 red

(0.0 to 1.0 represending 0% to 100%)

11004

LED strip 1 green

(0.0 to 1.0 represending 0% to 100%)

11005

LED strip 1 blue

(0.0 to 1.0 represending 0% to 100%)

3000

Motor 0 (left) speed command

(rad/s)

3001

Motor 1 (right) speed command

(rad/s)

Interrupts

The Quanser QBot Platform card, or its driver, does not support any interrupt sources.

Watchdog

The Quanser QBot Platform supports a watchdog timer for resetting outputs on watchdog expiry. The board will reset digital outputs 28-30, PWM outputs 0-1, and other outputs to the user-configured values when the watchdog expires. Resetting of the outputs occurs without software intervention, and therefore may be used as a safety mechanism in the event of software failure.

Place a HIL Watchdog block in the diagram to program the watchdog timer. This block also reloads the watchdog each time it is executed.

Once the watchdog has expired, further I/O is disabled until the watchdog state is cleared.

Hence, in Simulink models, the outputs will remain reset 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 also causes the watchdog state to be cleared, allowing the outputs to be used once more. These semantics make the watchdog useful for ensuring product safety.

Warning Due to safety reason, the Quanser QBot Platform has a 3 seconds watchdog automatically configured and enabled. This ensures that in the event of software crashes, the motors on Quanser QBot Platform would be safely shutdown.

Board-Specific Options

The Quanser QBot Platform has a number of board-specific options to control specialized functionality of the board. These options configure the IMU and PWM.

motor_mode

This option configures the operating mode of the two motors. The valid values are:

Operating Mode

Value

PWM Mode

0

Velocity Mode

1

pwm_limit

Set this option to the minimum PWM command that can be applied to the motors. This limit applies to all motor_mode. The maximum value is 0.7.

motor0_deadband_compensation

This option offsets the motor 0 (left) command by the specified PWM command (i.e. range of 0 to 1) to compensate for amplifier deadband.

motor1_deadband_compensation

This option offsets the motor 1 (right) command by the specified PWM command (i.e. range of 0 to 1) to compensate for amplifier deadband.

enc0_velocity

Set this option to the minimum velocity in counts per second that should be detected by the motor digital tachometer. This limit is an artificial limit that is useful when friction stops the device long before it reaches the slowest detectable velocity of the Quanser QBot Platform hardware. If this option is set to zero then the slowest velocity measurable by the hardware is used. The default value is enc0_velocity=0.0 which disables the clamping function.

enc1_velocity

Set this option to the minimum velocity in counts per second that should be detected by the pendulum digital tachometer. This limit is an artificial limit that is useful when friction stops the device long before it reaches the slowest detectable velocity of the Quanser QBot Platform hardware. If this option is set to zero then the slowest velocity measurable by the hardware is used. The default value is enc1_velocity=0.0 which disables the clamping function.

gyro_rate

This option sets gyroscope's sensor's sampling rate. Valid values range from 12.5 to 32000. The units are Hz.

gyro_ord

This option determines the order of the filter used for gyroscope's onboard filtering. Valid values are 1, 2 or 3.

gyro_fs

This option sets the full-scale range of gyroscope's sensor. Valid values range from 15.625 to 2000. The units are degrees per second.

gyro_bw

This option sets the bandwidth of the filter used for gyroscope's onboard filtering. Valid values range from 10 to 16000. The units are Hertz.

accel_rate

This option sets accelerometer's sampling rate. Valid values range from 12.5 to 32000. The units are Hz.

accel_ord

This option sets the order of the filter used for accelerometer's onboard filtering. Valid values are 1, 2 or 3.

accel_fs

This option configures the full-scale range of accelerometer. Valid values are 2 to 16. The units are g's.

accel_bw

This option sets the bandwidth of the filter used for acceleromter's onboard filtering. Valid values range from 10 to 16000. The units are Hz.

Properties

The Quanser QBot Platform driver currently supports a number of double properties used to tune the internal Speed Controller gains for the motors. The double properties are enumerated in the table below:

Property

Type

Description

PROPERTY_DOUBLE_QBOT_PLATFORM_P_GAIN

Double

Proportional Gain

PROPERTY_DOUBLE_QBOT_PLATFORM_I_GAIN

Double

Integral Gain

PROPERTY_DOUBLE_QBOT_PLATFORM_FF

Double

Feedforward Term

The Quanser QBot Platform driver also supports the following read-only properties:

Property

Type

Description

PROPERTY_INTEGER_FIRMWARE_MAJOR_VERSION

Integer

Major version number of the firmware

PROPERTY_INTEGER_FIRMWARE_MINOR_VERSION

Integer

Minor version number of the firmware

PROPERTY_INTEGER_FIRMWARE_BUILD

Integer

Build number of the firmware (currently always zero)

PROPERTY_INTEGER_HARDWARE_VERSION

Integer

Revision or patch number of the firmware

Connectors

The Quanser QBot Platform board has one connector for expansion I/O. The pinouts for this connector are listed below. Note that all pins are 3.3V and are not 5V tolerant unless marked otherwise. Exceeding these voltages may damage the board!

Qbot Platform GPIO Connector

I2S SDOUT 2 ← / GPIO 21

4039

Ground

I2S SDIN 2 ← / GPIO 20

3837

GPIO 26 / → SPI MOSI 3

UART CTS THS4 ← / GPIO 16

3635

GPIO 19 / → I2S LRCK 2

Ground

3433

GPIO 13 / → PWM 5

PWM 7 ← / GPIO 12

3231

GPIO 6 / → EXT PERIPH CLK 4

Ground

3029

GPIO 5 / → EXT PERIPH CLK 3

I2C SCL 2 ↔ / GPIO 1

2827

GPIO 0 / ↔ I2C SDA 2

SPI CS1 1 ← / GPIO 7

2625

Ground

SPI CS0 1 ← / GPIO 8

2423

GPIO 11 / → SPI SCK 1

SPI MISO 3 ← / GPIO 25

2221

GPIO 9 / ← SPI MISO 1

Ground

2019

GPIO 10 / → SPI MOSI 1

SPI CS0 3 ← / GPIO 24

1817

3.3V

SPI CS1 3 ← / GPIO 23

1615

GPIO 22 / → PWM 1

Ground

1413

GPIO 27 / → SPI SCK 3

I2S SCLK 2 ← / GPIO 18

1211

GPIO 17 / ← UART RTS THS4

UART RXD THS4 → / GPIO 15

109

Ground

UART TXD THS4 ← / GPIO 14

87

GPIO 4 / ↔ AUD

Ground

65

GPIO 3 / I2C SCL 8

5V

43

GPIO 2 / I2C SDA 8

5V

21

3.3V

Legend

→▯←

=

input

←▯→

=

output

↔▯↔

=

bidirectional I/O

=

3.3V signal

=

power

=

ground

Targets

Target

Supported

Comments

QUARC Win32 Target

No

Not supported.

QUARC Win64 Target

No

Not supported.

QUARC Linux Nvidia Target

No

Not supported.

QUARC Linux QBot Platform Target

Yes

Fully supported.

QUARC Linux QCar 2 Target

No

Not supported.

QUARC Linux QDrone 2 Target

No

Not supported.

QUARC Linux Raspberry Pi 3 Target

No

Not supported.

QUARC Linux Raspberry Pi 4 Target

No

Not supported.

QUARC Linux Raspberry Pi ARM64 Target

No

Not supported.

QUARC Linux RT ARMv7 Target

No

Not supported.

QUARC Linux x64 Target

No

Not supported.

QUARC Linux DuoVero Target

No

Not supported.

QUARC Linux DuoVero 2016 Target

No

Not supported.

QUARC Linux Verdex Target

No

Not supported.

QUARC QNX x86 Target

No

Not supported.

Rapid Simulation (RSIM) Target

Yes

Supported with no communication to the hardware.

Normal simulation

Yes

Supported with no communication to the hardware.

See Also

 

navigation bar