Library Simulink [better]: Quarc
The QUARC library for Simulink is a set of blocks provided by Quanser that integrates real-time control with Simulink. It allows you to:
- Run Simulink models in real time on Windows or real-time targets.
- Interface directly with Quanser hardware (e.g., QUBE-Servo, IP02, SRV02, AERO, rotary and linear plants).
- Use hardware-in-the-loop (HIL) and rapid control prototyping (RCP).
Conclusion: Why QUARC Remains a Leader
The QUARC library for Simulink is not just a collection of I/O blocks—it is a complete real-time ecosystem. By enabling engineers to stay within the familiar Simulink environment while interacting with physical hardware, QUARC reduces development time from days to minutes. Its robust handling of real-time synchronization, versatile hardware support, and deep integration with Quanser’s world-class plants make it the go-to choice for control system education and research.
Whether you are a professor designing an undergraduate mechatronics lab, a graduate student validating a nonlinear controller, or an industry professional prototyping a novel actuator, mastering the QUARC blockset will empower you to turn theoretical models into real-world results.
Next Steps for the Reader:
- Download the QUARC trial from Quanser’s website.
- Explore the built-in demos (type
quarc_demosin MATLAB). - Try the "Quanser Rapid Control Prototyping (RCP)" tutorials to get your first motor spinning in under 30 minutes.
The gap between simulation and reality is narrow, but QUARC provides the bridge. Happy real-time modeling.
Mark Thompson is a control systems engineer with over a decade of experience in real-time simulation and hardware-in-the-loop testing. This article was reviewed by Quanser Inc. for technical accuracy as of 2025.
The Scenario
Imagine you're a suspension engineer at an automotive company, tasked with designing a new suspension system for a luxury sedan. You need to ensure that the suspension provides a smooth ride while also maintaining stability and handling.
The Task
Your goal is to model and simulate the quarter car suspension system using Simulink and the Quarc library. You want to analyze the system's behavior under various road conditions and vehicle speeds.
The Steps
- Open Simulink: You start by opening Simulink and creating a new model.
- Add Quarc Library: You add the Quarc library to your Simulink model by searching for "Quarc" in the Simulink Library Browser.
- Select Quarter Car Model: You select the Quarter Car model from the Quarc library and add it to your model.
- Configure the Model: You configure the Quarter Car model by setting parameters such as the vehicle's mass, suspension stiffness, and damping coefficients.
- Add Road Profile: You add a road profile to simulate the vehicle's response to different road conditions. This can be done using a built-in road profile block or by creating a custom profile.
- Run the Simulation: You run the simulation to analyze the vehicle's response to the road profile.
The Results
After running the simulation, you can analyze the results to see how the suspension system performs. You can plot variables such as: quarc library simulink
- Vehicle body acceleration
- Suspension travel
- Tire deflection
- Vehicle speed
By analyzing these plots, you can evaluate the performance of the suspension system and make adjustments to the design as needed.
The Benefits
Using the Quarc library in Simulink provides several benefits, including:
- Faster design iteration: You can quickly test and evaluate different suspension designs and parameters.
- Improved accuracy: The Quarc library provides a detailed and accurate model of the quarter car suspension system.
- Increased productivity: Simulink's graphical modeling and simulation environment makes it easy to build and analyze complex systems.
By following these steps, you can effectively use the Quarc library in Simulink to design and analyze a quarter car suspension system, ultimately leading to a better ride and handling experience for your vehicle's passengers.
QUARC is a powerful real-time control software developed by that integrates directly with
. It allows engineers and researchers to transform Simulink models into real-time applications that can interface with physical hardware without writing a single line of C/C++ code. 🛠️ The QUARC Targets Library The heart of QUARC within Simulink is the QUARC Targets Library
. This library provides specialized blocks that extend standard Simulink functionality for real-time environments. HIL (Hardware-In-the-Loop):
Blocks for reading and writing to data acquisition (DAQ) cards, such as the Quanser Q8-USB Communications:
Support for protocols like TCP/IP, UDP, Shared Memory, Serial, SPI, and I2C. Multithreading: Asynchronous Thread
block allows for non-periodic tasks (like communications or event-driven code) to run separately from the main control loop. Multimedia:
Blocks for interacting with cameras (e.g., FLIR), video files, and audio. ⚡ Core Features
QUARC bridges the gap between digital simulation and physical implementation through several key mechanisms: 1. External Mode Support Using Simulink's External Mode , QUARC allows you to Monitor & Tune The QUARC library for Simulink is a set
your model while it runs on the hardware. You can change controller gains or parameters in the Simulink diagram and see the results instantly on physical hardware. 2. Rapid Control Prototyping (RCP)
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
While development often happens on Windows, QUARC can target various environments, including: Windows (Hard Real-Time) Linux (on Raspberry Pi or other boards) Embedded platforms like NI myRIO or ELVIS III 🚀 Getting Started
To use the QUARC library in your Simulink projects, follow these standard steps: QUARC Real-Time Control Software - Quanser
Introduction to Quarc Library in Simulink
The Quarc library is a set of Simulink blocks developed by Quanser, a leading provider of engineering solutions for research and education. Quarc (Quanser Advanced Research and Control) is a software framework that enables users to design, simulate, and deploy control systems, mechatronics, and robotics applications. The Quarc library provides a comprehensive set of tools and blocks to facilitate the development of advanced control systems, estimation, and signal processing algorithms.
Key Features of Quarc Library
The Quarc library offers a wide range of features and tools, including:
- Control Systems: Quarc provides a variety of control system blocks, such as PID controllers, state-space controllers, and model predictive control (MPC) blocks.
- Estimation and Filtering: The library includes blocks for state estimation, parameter estimation, and signal filtering, such as Kalman filter and Luenberger observer blocks.
- Signal Processing: Quarc offers a range of signal processing blocks, including filtering, convolution, and Fourier transform blocks.
- Nonlinear Systems: The library provides blocks for modeling and simulating nonlinear systems, such as backlash, hysteresis, and saturation blocks.
- Real-time Systems: Quarc supports real-time implementation of control systems on Quanser's hardware platforms, allowing for rapid prototyping and testing.
Benefits of Using Quarc Library
The Quarc library offers several benefits, including:
- Rapid Prototyping: Quarc enables users to quickly design, simulate, and test control systems, reducing development time and effort.
- Ease of Use: The library provides a user-friendly interface and a comprehensive set of documentation and tutorials, making it easier for users to learn and use.
- Flexibility: Quarc supports a wide range of applications, from simple control systems to complex mechatronics and robotics systems.
- Real-time Implementation: The library enables seamless transition from simulation to real-time implementation on Quanser's hardware platforms.
Applications of Quarc Library
The Quarc library has a wide range of applications, including: Run Simulink models in real time on Windows
- Control Systems: Quarc is used in various control systems applications, such as robotics, autonomous vehicles, and process control.
- Mechatronics: The library is used in mechatronics applications, such as motion control, vibration control, and robotics.
- Signal Processing: Quarc is used in signal processing applications, such as audio processing, image processing, and biomedical signal processing.
- Research and Education: The library is widely used in research and education institutions for teaching and research purposes.
Getting Started with Quarc Library
To get started with the Quarc library, users can:
- Download and Install: Download and install the Quarc library from the Quanser website.
- Familiarize with Simulink: Familiarize themselves with Simulink and its interface.
- Explore Quarc Blocks: Explore the Quarc library and its blocks, and review the documentation and tutorials.
- Start with Examples: Start with example projects and models provided with the library to gain hands-on experience.
By following these steps, users can effectively utilize the Quarc library to design, simulate, and deploy advanced control systems, mechatronics, and robotics applications.
(Quanser Real-Time Control) is a rapid control prototyping platform that integrates with
to enable the design, development, and deployment of real-time applications directly onto hardware. It serves as a bridge between high-level graphical modeling and real-world execution, allowing users to run controllers on various targets—such as Windows or Linux—without writing manual code. The QUARC Targets Library The core of QUARC’s functionality within Simulink is the QUARC Targets Library
. This library provides specialized blocks that extend standard Simulink capabilities for hardware-in-the-loop (HIL) testing and real-time communication. Data Acquisition (DAQ):
Blocks that allow direct interaction with hardware sensors and actuators. The Immediate I/O
blocks, for instance, read or write to channels every time the block executes, which is critical for time-sensitive control loops. Communications:
A protocol-independent framework that uses Universal Resource Identifiers (URIs) to define connections. It supports various protocols like TCP/IP, UDP, serial, SPI, and I2C. Asynchronous Threads:
These blocks enable the creation of non-periodic threads for tasks like event-driven code or background communications, which run independently of the main model sample rate. Continuous Blocks:
Includes advanced tools for nonlinear state-space systems and extended Kalman filters. Key Features and Capabilities
QUARC transforms a standard Simulink environment into a powerful real-time workstation with several distinct advantages: QUARC Real-Time Control Software - Quanser
Step 5: Configure Code Generation
- Go to Simulation > Model Configuration Parameters > Solver.
- Set Type to
Fixed-step, Solver toode4(Runge-Kutta) orode8(Discrete – no continuous states). - Set Fixed-step size to
0.001(match theReal-Time Synchronizeblock). - In the Code Generation pane, set System target file to
quarc.tlc(the QUARC real-time target).
Best Practices
- Use fixed-step solvers with step size equal to the controller sample period.
- Minimize host-target communication during time-critical loops; reserve External Mode for tuning.
- Use hardware abstraction blocks instead of custom drivers for portability.
- Validate algorithms in Simulink normal mode with simulated I/O before hardware deployment.
- Profile CPU load and set task priorities to ensure deterministic behavior.
- Log sufficient signals at appropriate rates; downsample if necessary to conserve bandwidth.
Sample Workflow (Typical User)
- Build controller in Simulink (e.g., PID for QUBE-Servo).
- Replace input sources with QUARC encoder blocks.
- Replace output sinks with QUARC PWM/voltage blocks.
- Set fixed-step solver (e.g., ode1, 0.001 s).
- Click Run → model executes in real time on actual hardware.
- Use QUARC Monitor to tune gains live.
Part 4: A Practical Step-by-Step Workflow
Let’s walk through a typical workflow of using QUARC Library for Simulink.
Key features:
- Real-time synchronization – Simulink blocks execute deterministically with specified sample times.
- Device drivers – Pre-built blocks for sensors (encoders, accelerometers) and actuators (motors, servos).
- Communication – Supports PCIe, USB, Ethernet, and Wi-Fi connections to Quanser I/O boards and embedded targets (e.g., QPIDe, Q8-USB).
- Monitoring & logging – Stream data to Simulink scopes, or log to MATLAB workspace for analysis.
Part 8: Real-World Applications
The QUARC library for Simulink is used extensively in academia and industry:
- Autonomous Robotics: Student teams control Quanser Q-Bots (differential drive robots) using vision and SLAM algorithms implemented in Simulink + QUARC.
- Active Suspension Systems: Researchers implement LQR and H-infinity controllers on Quanser’s Active Suspension plant, testing ride comfort in real-time.
- Renewable Energy: Microgrid and wind turbine lab setups use QUARC to implement maximum power point tracking (MPPT) algorithms.
- Aerospace Control: The Quanser AERO (dual-propeller with yaw and pitch) allows students to test cascade PID and model predictive control on a "virtual helicopter."