Quarc Library: Simulink
The QUARC library for Simulink is a set of blocks provided by Quanser that integrates real-time control with Simulink. It allows you to:
Step 2: Open Simulink and Add QUARC Blocks
- Type
quarcin MATLAB prompt to open the library browser. - Drag
HIL Initializeinto a new model. Configure it to match your board type (e.g., Quanser Q2-USB). - Drag
HIL Read Encoder– set channel 0. - Drag
HIL Write PWM– set channel 0.
Hardware-in-the-Loop Architecture with MATLAB/Simulink and QuaRC: This research paper explores the use of QUARC for rapid prototyping of CMAC neural network controllers, specifically for a ball-and-beam system.
QUARC automates the generation, compilation, and deployment of code. With one click, your model is converted into real-time code and downloaded to the QUARC Target Manager 3. Cross-Platform Deployment quarc library simulink
Applications of Quarc Library
5. Advanced Communication Blocks
Quarc is built for connected systems, featuring a robust suite of communication protocols essential for modern robotics. The QUARC library for Simulink is a set
Summary
The Quarc Library effectively turns Simulink into a real-time operating system interface. By abstracting the low-level complexities of hardware drivers, memory management, and thread scheduling, it allows engineers to focus entirely on control logic and system behavior.
Real-Time Execution: It enables Simulink models to run at deterministic rates (up to several kHz) on hardware, ensuring precise control timing for robotics and mechatronics. Type quarc in MATLAB prompt to open the library browser
Part 6: QUARC vs. Other Real-Time Tools
| Feature | QUARC | Simulink Real-Time (SLRT) | Homegrown C-code | | :--- | :--- | :--- | :--- | | Target OS | Windows (with real-time patch), Linux | Dedicated target PC (DOS-like) | Any, but high dev time | | Hardware Support | Quanser, NI, Measurement Computing, Advantech, etc. | Speedgoat, some NI | Full control, but driver writing needed | | Ease of Use | Drag-and-drop blocks | Moderate (requires Speedgoat) | Very difficult | | Educational Focus | Strong (excellent documentation for control labs) | Industrial/Research | N/A | | Cost | Moderate (academic licenses available) | High | Low (but high effort) |