Introduction: Positioning and Selection Challenges of Teaching Servo Experiment Platform
In undergraduate courses of mechatronics and control engineering, hands-on experiments are a key component in helping students understand abstract control theory. The ideal teaching experimental equipment should have the following characteristics: safety and reliability, measurable and controllable parameters, modular design, seamless integration with mainstream development environments, and controllable costs.
Quanser QUBE Servo 2 is a self-contained, low-cost servo motor experimental platform designed specifically for this requirement. It integrates a DC motor, photoelectric encoder, built-in current sensor, power amplifier, and data acquisition interface, and is equipped with two additional modules: inertia disk and swing rod. Unlike traditional large rotary servo test benches, QUBE Servo 2 is compact in size (about the size of a fist), yet retains complete closed-loop control teaching functions.
For laboratory managers or course leaders, the following practical issues may arise when deploying the equipment:
Confusion in Interface Selection: Differences and Applicable Scenarios between USB Version and Embedded Version.
Software configuration failure: Common errors during MATLAB/Simulink or LabVIEW driver installation and real-time control environment setup.
Hardware expansion requirements: How to independently design 3D printing modules and integrate them with the system.
Alignment of teaching resources: How to match experimental content with classic textbook chapters such as Nise's "Control Systems Engineering".
This article will provide a complete technical reference for university teachers and laboratory technicians from six dimensions: technical architecture, detailed explanation of dual interface mode, software configuration process, common troubleshooting, modular experimental design, and integration of course resources.
System architecture and working principle
2.1 Core Components
QUBE Servo 2 is a highly integrated experimental system that mainly includes the following hardware:
DC motor: Brushed DC motor, used as the actuator.
Optoelectronic encoder: installed on the motor shaft, outputs orthogonal encoded signals, and can simultaneously measure the position (angle) and speed of the rotor (by differentiating the positions).
Built in current sensor: Real time monitoring of armature current, providing feedback for torque control and current loop experiments.
Integrated power amplifier: converts control signals (PWM or analog voltage) into the power required to drive the motor.
QFLEX 2 computing interface: The second-generation interface technology developed by Quanser, responsible for data acquisition, signal conditioning, and communication with the upper computer.
Additional modules: Inertial disk (increasing rotational inertia) and pendulum rod (forming a first-order inverted pendulum system), hot swappable through quick connection interface.
2.2 Brief description of working principle
The upper computer (PC or microcontroller) sends control voltage commands (usually ± 5V or PWM duty cycle) through the QFLEX 2 interface. The built-in amplifier converts instructions into motor drive voltage. The encoder provides real-time feedback on the rotor position, while the current sensor provides feedback on the armature current. These feedback signals are collected by QFLEX 2 and sent back to the controller, forming a closed loop.
The uniqueness of this system lies in the fact that the control algorithm can run on multiple platforms:
Run MATLAB/Simulink Real Time or LabVIEW on a PC (via USB connection).
Embedded microcontrollers (such as NI myRIO, Arduino, Raspberry Pi) are directly controlled through SPI interfaces.
2.3 Engineering value of three color LED indicator lights
There is a user controllable three color LED light strip on the front of the device. In practical teaching, it can be programmed to be used as:
System status indication: Green indicates normal position tracking, red indicates over limit or alarm.
Visualization of control performance: Brightness or color changes with error (for example, the larger the error, the redder it becomes), helping students intuitively feel the control effect.
Power or enable indication: To avoid students misjudging the system as "crashing" when the motor is not enabled.
Although this detail may be small, it is very practical in teaching demonstrations and can reduce students' reliance on the command line or oscilloscope.
Dual interface mode detailed explanation: USB version vs. embedded version
QUBE Servo 2 offers two interchangeable panels: USB interface panel and embedded interface panel. Users can choose one panel at the time of purchase or purchase another panel separately as a backup. This design allows the same hardware to serve both PC based graphical courses and low-level embedded programming teaching.
3.1 QUBE Servo 2 USB Experimental Edition
Interface: Standard USB 2.0 connection (Type-B).
Supporting software:
For MATLAB/Simulink users: Quanser QUARC real-time control software package needs to be installed, which provides Simulink module library and can directly compile models into real-time executable programs.
For LabVIEW users: Quanser RCP (Rapid Control prototyping) toolkit is required.
Advantage:
The rich toolboxes of Simulink or LabVIEW can be directly used for controller design, such as PID, pole placement LQR、 Adaptive control).
Provide complete ABET certification aligned course materials (in digital media format), including complete dynamic models, pre built controllers, and experimental manuals.
Real time data recording and drawing functions are powerful, suitable for classroom presentations.
Limitations:
Real time running of Simulink models on a PC is required, which has certain performance requirements (but modern mainstream PCs can meet them).
Not suitable for teaching objectives that require students to directly write bare metal C code or register level operations.
Typical application scenarios: Control engineering courses for second and third year undergraduate students, with a focus on controller design and system identification rather than underlying programming.
3.2 QUBE Servo 2 Embedded Experimental Edition
Interface: SPI (Serial Peripheral Interface), connected to external microcontrollers (such as Arduino Uno/Nano, Raspberry Pi, NI myRIO) through a 4-wire cable. The microcontroller needs to be provided by the user.
Software: No need to purchase additional specialized software. Quanser provides Arduino sample code and interface datasheet, which provides detailed explanations of SPI communication protocol, register mapping, command format, etc.
Advantage:
Enable students to experience real embedded system development, including SPI driver writing, interrupt handling, timer configuration, etc.
Very suitable for capstone projects or advanced mechatronics courses, students can complete the complete software and hardware design from sensor reading, control algorithm implementation to motor drive.
The hardware cost is relatively low (no MATLAB/Simulink license required, open source toolchain can be used).
Limitations:
Students need to have a certain foundation in microcontroller programming (C/C++).
The feedback data refresh rate is affected by SPI speed and microcontroller performance, and may be slightly lower than the USB version.
The teaching resources provided are relatively limited compared to the USB version (although there are USB version course materials as references).
Typical application scenarios: Advanced embedded system courses, robotics technology innovation competitions, graduation projects.
3.3 Interface panel interchange operation
Two types of panels are connected to the host through the QFLEX 2 module, and no special tools are required to replace the panels. Simply unscrew the bottom plate screws to complete the replacement. Engineering tip: Before replacing the panel, be sure to disconnect the power supply and release the load on the motor shaft (especially when the swing rod is installed) to avoid personal injury caused by accidental rotation of the motor during operation.
The laboratory can be equipped with a small number of spare panels, and one set of hardware can serve multiple courses simultaneously.

Software configuration and common troubleshooting
This section focuses on configuration issues and solutions for USB versions in MATLAB/Simulink environments (as this is the most common deployment scenario).
4.1 Software installation process
Install MATLAB (recommended R2019b and above) and Simulink.
Install QUARC software (requires a valid license, usually provided with a trial or academic version with the device).
Connect the USB cable of QUBE Server 2 to the PC, and the system will automatically install the driver program.
Enter quartc in the MATLAB command line to open the QUARC main interface, and run quartc_diagnostic for connection testing.
If communication is normal, you can find the "Quanser QUBE" module library in the Simulink library browser, which includes modules such as motor models, sensor reading, LED control, etc.
4.2 Common faults and solutions
Fault 1: USB device not recognized ("Unknown Device")
Possible reasons:
Poor quality or length of USB cables exceeding 2 meters can cause signal attenuation.
The power supply to the USB port of the PC is insufficient (especially when using laptop battery power).
QFLEX 2 panel firmware exception.
Exclusion steps:
Replace with original USB cable or high-quality shielded cable, with a length not exceeding 1.5 meters.
Insert the USB into the rear port of the PC (directly connect to the motherboard) to avoid using an external USB hub.
Connect a power adapter to the PC to ensure stable USB power supply.
Try another PC to troubleshoot the device hardware. If still unable to recognize, contact the supplier for firmware reset.
Fault 2: QUARC real-time model compilation failed
Possible reasons:
The MATLAB path does not include the Quanser module library.
The compiler is not configured correctly (Microsoft Windows SDK or MinGW needs to be installed in a Windows environment).
An outdated module was used in the model.
Exclusion steps:
Run quarc_setup on the MATLAB command line to automatically configure the path and compiler.
Run mex setup to confirm that the C compiler is configured.
Open the example model that comes with QUARC (such as q_qube_position_comtrol. slx) and try compiling and running it. If the example is normal, it indicates that there is a problem with the user model; If the example also fails, reinstall QUARC.
Fault 3: Abnormal shaking or overcurrent during motor operation
Possible reasons:
Unstable control parameters (such as oscillation caused by excessive PID gain).
The encoder signal is affected by interference or mechanical coupling is loose.
The motor shaft is stuck (additional module not installed correctly).
Exclusion steps:
Immediately stop running and retest with a small proportional gain (e.g. Kp=0.1) to observe if the position response is stable.
Use QUARC's "Monitor&Tune" tool to view the encoder count values in real-time and confirm that the values continuously change without any jumps when manually rotating the motor shaft.
Check if the inertia disk or swing rod is locked. The quick connect interface should make a "click" sound.
If all of the above are normal but still shaking, please use a current sensor to read the actual current and determine whether it is caused by wear of the internal commutator of the motor or short circuit of the brush.
Fault 4: Embedded version SPI communication is unresponsive
Possible reasons:
SPI pin connection error (incorrect MOSI/MISO/SCK/CS correspondence).
The clock polarity and phase settings do not meet the requirements of QFLEX 2.
The SPI rate of the microcontroller is too high (QFLEX 2 supports up to 2 MHz).
Exclusion steps:
Strictly refer to the interface data manual provided by Quanser and check the wiring: usually CS → D10 (Arduino), SCK → D13, MOSI → D11, MISO → D12, power supply and GND are correctly connected.
Set SPI mode to mode 0 (CPOL=0, CPHA=0), with MSB transmitting first and clock speed set between 500 kHz and 1 MHz.
Use a logic analyzer or oscilloscope to monitor the SPI bus and confirm that QUBE has response data after each command byte.
It is recommended to run the Arduino sample code provided by Quanser first, confirm that the hardware is working properly, and then develop a custom program.
Modular Expansion and 3D Printing Interaction
A prominent feature of QUBE Servo 2 is its support for users to design and 3D print additional modules on their own. The original factory provides inertia discs and swing rods, but teachers can encourage students to design other loads, such as:
Eccentric mass block: Simulate unbalanced loads and test anti-interference ability.
Spring damping load: Printing specific shapes using flexible materials to generate nonlinear friction or elastic torque.
Fan blades: used for air resistance experiments to study the damping effect of velocity squared.
Technical interface specifications (based on implicit information in the original text):
The quick connect interface adopts a magnetic or snap on structure, with an outer diameter of about 15 mm and a D-shaped shaft hole in the center to match the motor shaft.
The maximum allowable mass of the module is approximately 50 g (exceeding it may affect the lifespan of the motor).
The recommended range of rotational inertia for the module is approximately 1 × 10 ⁻⁵ kg · m ² for the inertia disk and 2 × 10 ⁻⁵ kg · m ² for the swing rod.
Engineering suggestion: When designing new modules, CAD software should be used to ensure dynamic balance; Recommended printing materials are PLA or ABS, and it is not recommended to use metal (heavy). In student projects, they can be required to:
Design a novel load.
Measure its rotational inertia and friction model through system identification experiments.
Redesign the controller for this load and compare the performance differences.
Align teaching course resources with ABET
For USB version users, Quanser provides a complete set of digital media course resources, whose core value lies in:
Modular content: Teachers can choose experiments as needed instead of writing experiment guides from scratch. The content covers: system modeling (first-order, second-order), time-domain response, PID control, frequency response, state space control, digital control, etc.
Textbook Alignment Tool: Provides a mapping table that corresponds each course section to a chapter in mainstream textbooks such as Nise's "Control Systems Engineering" and Ogata's "Modern Control Engineering". This greatly reduces teachers' preparation time.
ABET certification support: Course resources clearly indicate the student learning outcomes covered by each experiment (such as "being able to design controllers that meet steady-state error and overshoot requirements"), which helps in writing certification reports.
Embedded version resources: Provide Arduino examples and interface data manuals. Although there is no complete ABET alignment course package, teachers can draw on the content framework of the USB version and let students write their own controller C code to achieve the same function, which is very valuable for cultivating embedded engineers.
Maintenance and calibration recommendations
Although QUBE Servo 2 is designed to be maintenance free, the following issues may still occur after long-term use:
7.1 Encoder zero drift or reading jump
Phenomenon: When the motor is stationary, the position reading drifts slowly or there is a ± 1 count jump.
Solution: The encoder itself is incremental, and zero drift is usually caused by electromagnetic interference or power ripple. You can try:
Use shielded USB cables and ensure good grounding.
Add software filtering (such as moving average or first-order low-pass filtering) to the control program.
Re calibrate the zero position: Place the motor at the mechanical limit or a known angle, and press the "Reset Encoder" button in the software.
7.2 Power amplifier overheating protection
Phenomenon: After a long period of high load operation (such as frequent forward and reverse swing of the pole), the motor suddenly stops and recovers after cooling.
Solution: The built-in amplifier has overheat protection. It is recommended to let the equipment idle for 2 minutes every 15 minutes during the laboratory operation cycle. Teaching experiments usually have a low load and are unlikely to trigger protection.
7.3 Mechanical wear of swing rod module
Phenomenon: Friction or jamming occurs when the pendulum rotates around the axis, which affects the control effect of the inverted pendulum.
Solution: Remove the swing rod module and drip a very small amount of plastic grease (such as silicone grease) onto the shaft. Avoid using oily lubricants (which may corrode plastics). If the wear is severe, you can contact Quanser to purchase replacement swing rod components (or 3D print them yourself).
7.4 Regular calibration checklist (recommended once per semester)
Project methodology
Zero voltage output calibration disconnects the motor enable, and the encoder reading stabilizes at zero; Send a 0V command, the motor should not rotate.
Verify the direction of the encoder by manually rotating the motor shaft in the forward direction, and observe that the position reading should increase.
Current sensor calibration uses external precision resistance to measure the actual current, compare the feedback value, and adjust the gain in the software if necessary.
The LED color verification program displays red, green, and blue in sequence to ensure that all three channels are functioning properly.
Advanced Applications and Graduation Design Cases
Here are some graduation project topics based on QUBE-Servo 2 (already implemented by foreign universities):
Wireless control based on Raspberry Pi: Using an embedded panel, run Python+GPIO driver on Raspberry Pi, achieve remote control through WiFi, and establish a web interface to display real-time curves.
Model Predictive Control (MPC) Implementation: Design a predictive controller using MATLAB's MPC Toolbox on the USB version and compare PID performance.
Fault detection and fault-tolerant control: Artificially simulate encoder pulse loss or current sensor offset, design an observer to estimate the state and maintain stable operation.
Virtual reality interaction: Build 3D models using Unity or Unreal engines, map the actual angles of QUBE to the virtual environment, and achieve gamified control experiments.
These projects can fully exercise the engineering practice ability of undergraduate students, and the equipment cost is low (about several thousand yuan per set, far lower than industrial grade servo platforms), suitable for batch configuration in innovation laboratories.
Procurement and laboratory deployment recommendations
Quantity planning: For a class of 20 people, it is recommended to equip 10 sets of equipment (two people per group). If funds are limited, 5 sets can also be configured and used in rotation.
Interface selection strategy: Most course content (system modeling, PID, frequency domain) is suitable for USB version. If an embedded system course is offered, an additional embedded panel can be purchased (without the need to purchase a complete machine) to achieve dual-use.
Software License: The educational license for MATLAB/Simulink already includes most of the toolboxes. QUARC requires a separate license, but the academic price is relatively reasonable. LabVIEW users need to confirm whether they have purchased the RCP module.
Spare parts list: It is recommended to purchase an additional 2 sets of inertia discs and swing rods (which are prone to loss or damage), as well as 5 USB cables and SPI cables.
Cost benefit analysis: Compared to purchasing a large rotary servo test bench (such as a brand with a cost exceeding $5000), the price of QUBE Servo 2 is significantly lower (referred to as "low cost" in the original text), and it integrates amplifiers, encoders, and data acquisition without the need to purchase additional accessories. By providing free course materials, teachers can save hundreds of hours of preparation time.
