Quarc Library Simulink

The QUARC Library for Simulink, developed by Quanser, is a comprehensive suite of real-time control software that bridges the gap between theoretical Simulink models and physical hardware implementation. It serves as a rapid control prototyping (RCP) and hardware-in-the-loop (HIL) environment, allowing users to generate real-time code directly from Simulink diagrams without writing a single line of manual code. Core Functionality and Architecture

QUARC operates on a host-target relationship, where the user designs controllers in the Simulink Development Environment (SDE) on a host PC and deploys them to a local or remote real-time target.

Real-Time Code Generation: Converts graphical Simulink models into optimized C-code that runs deterministically on platforms like Windows and Linux.

External Mode Support: Enables online parameter tuning and real-time data monitoring directly within the Simulink interface while the model is executing on the target hardware.

Dynamic Reconfiguration: Allows users to replace a running model with a new one without interrupting the hardware's execution. Key Blocksets in the QUARC Library

The QUARC Targets Library expands standard Simulink capabilities with specialized blocks:

Hardware-In-the-Loop (HIL) API: Provides a unified interface to access data acquisition (DAQ) cards from Quanser, National Instruments, and other third-party manufacturers.

Stream API: A protocol-independent communication framework supporting TCP/IP, UDP, serial, shared memory, and SPI.

Multimedia and Vision: Specialized blocks for interfacing with FLIR and PGR cameras, performing image processing, and handling video compression.

Advanced Robotics: Includes kinematic solvers and blocks for controlling specific robots like the Quanser QArm, Denso, and Kinova arms. Applications in Education and Research

QUARC is widely utilized across academic and industrial sectors due to its "academically appropriate abstraction," which allows students to focus on control theory rather than low-level coding.

Teaching Labs: Integrated into Quanser lab workstations to teach linear systems, rotary motion, and mechatronics.

Autonomous Systems: Powering research in multi-agent robotics using the QBot 2, QCars, and QDrones.

High-Performance Prototyping: Used in large-scale projects, such as the Challenging Environment Assessment Lab (CEAL), for complex motion platform control. Getting Started and Troubleshooting

To use the library, ensure that QUARC Real-Time Control software is installed after MATLAB. If blocks are missing with a quarc_library error, you can run quarc_setup in the MATLAB Command Window to refresh the paths. For existing models, use the Upgrade blocks utility under the QUARC menu to resolve broken links from older versions. Quanser Lab Workstation Support from Simulink - MathWorks

The QUARC Real-Time Control software from Quanser is a rapid control prototyping system that integrates deeply with Simulink. It is primarily used to bridge the gap between simulation and real-world hardware implementation. Core Capabilities

Seamless Integration: QUARC acts as an extension of Simulink, allowing you to run models in real-time on various targets—including 32-bit and 64-bit Windows and various embedded platforms—directly from the Simulink Development Environment.

No Manual Coding: It generates real-time C/C++ code automatically from your Simulink diagrams, eliminating the need to write manual code for digital signal processing or hardware drivers.

External Mode Support: You can tune parameters on-the-fly while the model is running on a remote target and view real-time data streaming back to the MATLAB workspace or Simulink Scopes.

Hardware Support: It includes a dedicated library of Hardware-in-the-Loop (HIL) blocks for data acquisition cards, communication protocols (TCP/IP, UDP, Serial), and specific Quanser hardware like the QArm or QDrone 2. Library Highlights

The QUARC Targets Library adds specialized blocks to your Simulink Library Browser including:

Communication Blocks: Based on Universal Resource Identifiers (URIs), allowing you to swap protocols (e.g., from Serial to TCP/IP) by changing a single parameter.

Interactive Inputs: Blocks to use host system peripherals like a mouse, keyboard, or joystick as inputs for real-time models.

Advanced Plotting: Includes the XY Figure block, which offers better performance and multi-curve plotting compared to standard Simulink blocks. User Perspective & Limitations

The QUARC library is a suite of tools developed by Quanser that integrates with MATLAB and Simulink to enable rapid control prototyping and real-time hardware-in-the-loop (HIL) simulations. It allows users to generate real-time C code directly from Simulink models and run it on various hardware targets without manual programming. Key Papers and Documentation

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 library simulink

MATLAB Simulink QUARC Primer: An authoritative guide from Quanser that introduces the basic functions of MATLAB, Simulink, and QUARC for first-time users.

QBOT: An educational mobile robot controlled in MATLAB/Simulink environment: This paper discusses the Quanser Mobile Robot Control Framework (QMRCF), which utilizes QUARC to accelerate mobile robot development and HIL testing. Core Capabilities of the QUARC Library QUARC Real-Time Control Software - Quanser


Standard Simulink excels at "offline" simulation. You provide inputs, run the model over a time span, and analyze outputs. QUARC enhances this by introducing real-time execution. When you use QUARC blocks, you can "Build" and "Run" your Simulink diagram directly on a target machine (Windows or Linux) with strict timing constraints (e.g., a 1 kHz control loop).

The library leverages Quanser’s extensive hardware ecosystem (such as the Q-PID, Q-Bot, and AERO platforms) but also supports generic data acquisition hardware (National Instruments, Measurement Computing, etc.) through industry-standard protocols.

Quarc is built for connected systems, featuring a robust suite of communication protocols essential for modern robotics.

The Quarc library for Simulink streamlines converting Simulink control designs into real-time hardware implementations by providing hardware-specific I/O blocks, real-time orchestration, and deployment tools. Following fixed-step design, hardware abstraction, and incremental testing ensures reliable, deterministic control on supported targets.

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

The Results

After running the simulation, you can analyze the results to see how the suspension system performs. You can plot variables such as:

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:

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.

Introduction to Quarc Library in Simulink

Simulink, a graphical modeling and simulation environment, is widely used in the development of control systems, signal processing, and communication systems. One of the key features of Simulink is its ability to integrate with various libraries and tools, allowing users to leverage the strengths of different platforms. The Quarc library, developed by Quanser, is one such library that seamlessly integrates with Simulink to provide a comprehensive platform for designing, testing, and deploying advanced control systems.

What is Quarc Library?

The Quarc library is a software framework that enables users to design, simulate, and deploy control systems using Simulink. Quarc provides a set of tools and blocks that can be used to create complex control systems, including state-space models, transfer functions, and PID controllers. The library is designed to work seamlessly with Simulink, allowing users to take advantage of Simulink's graphical modeling and simulation capabilities.

Key Features of Quarc Library

The Quarc library offers a range of features that make it an ideal choice for control systems development. Some of the key features of the Quarc library include:

Benefits of Using Quarc Library

The Quarc library offers a range of benefits to users, including: The QUARC Library for Simulink , developed by

Applications of Quarc Library

The Quarc library has a wide range of applications in the development of control systems, including:

Getting Started with Quarc Library

Getting started with the Quarc library is easy. Here are the steps to follow:

Conclusion

The Quarc library is a powerful tool for designing, simulating, and deploying advanced control systems using Simulink. With its range of blocks and tools, Quarc enables users to create complex control systems quickly and easily. The library's integration with Simulink and Quanser hardware makes it an ideal choice for control systems development. Whether you're working on control systems, robotics, aerospace, or industrial automation applications, the Quarc library is definitely worth considering.

FAQs

Additional Resources

By following this article, you should now have a good understanding of the Quarc library and its applications in control systems development using Simulink. Whether you're a seasoned developer or just starting out, the Quarc library is definitely worth considering for your next project.

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:

Benefits of Using Quarc Library

The Quarc library offers several benefits, including:

Applications of Quarc Library

The Quarc library has a wide range of applications, including:

Getting Started with Quarc Library

To get started with the Quarc library, users can:

By following these steps, users can effectively utilize the Quarc library to design, simulate, and deploy advanced control systems, mechatronics, and robotics applications.

In the context of Quanser's QUARC real-time control software for Simulink, "preparing a piece" (or setting up a project) generally refers to the workflow of configuring a Simulink model to communicate with real-time hardware. 1. Configure Model for QUARC

Before you can run any "piece" of code on hardware, you must configure the Simulink model to use the QUARC real-time target. Open Configuration Parameters: Press Ctrl+E in Simulink.

Set the Solver: Under the Solver pane, set the "Type" to Fixed-step and the "Solver" to a discrete solver (e.g., discrete (no continuous states)).

Select the QUARC Target: In the Code Generation pane, set the "System target file" to a QUARC target, such as quarc_win64.tlc for 64-bit Windows or the specific target for your hardware.

Enable External Mode: Go to the Interface sub-pane and ensure "External mode" is selected to allow real-time tuning and monitoring. 2. Access the QUARC Library Standard Simulink excels at "offline" simulation

The QUARC Targets Library contains blocks specifically designed for hardware interfacing, such as reading sensors or writing to motors.

Open the Library Browser (click the icon or type slLibraryBrowser in MATLAB). Navigate to QUARC Targets to find hardware-specific blocks.

Quick Tip: You can quickly open specific sub-libraries by typing commands like qc_open_library('quarc_library/Sinks') in the MATLAB Command Window. 3. Essential Hardware Blocks

To make your "piece" functional with hardware, you typically need these blocks:

HIL Initialize: The "master" block. Drag this from QUARC Targets > Data Acquisition > Generic > Configuration. Double-click it to select your specific Quanser board (e.g., Q8-USB).

HIL Read/Write: Found under Generic > Immediate I/O, these blocks allow you to read encoders (sensors) and write voltages (actuators).

HIL Timebase: Used to ensure the model runs at a precise hardware clock rate. 4. Build and Run Once your model is assembled:

Connect to Target: Click the Monitor & Tune (or "Connect") button in the Simulink toolbar.

Build: Click the Build button (or Ctrl+B) to generate and compile the C-code for your real-time target.

Run: Click the Start button. You can now tune gain parameters in real-time or view data on Simulink scopes while the hardware moves.

For a deep dive into specific hardware setups, you can refer to the QUARC Library Guide or the Quanser Lab Workstation Support page on MathWorks. HIL Write :: QUARC Targets Library - Quanser

Understanding the QUARC Targets Library for Simulink QUARC Real-Time Control Software is a powerful tool by that transforms

models into real-time applications without requiring manual code writing. While Simulink is typically used for simulation, the QUARC Targets Library

adds specialized blocksets that allow these models to interact directly with hardware in real-time. Core Components of the QUARC Library

The QUARC library introduces several unique blocksets designed for high-performance control and communication: Hardware-in-the-Loop (HIL) Blocks

: These allow you to interface with data acquisition (DAQ) cards. A key feature is the ability to swap out the physical hardware for a model by changing a single parameter in the block. Communications Blockset

: This set enables models to talk to each other or external devices using protocols like TCP/IP, UDP, Serial, or Shared Memory. It uses Universal Resource Identifiers (URIs)

to define protocols, making it easy to switch communication methods by simply updating a string. Asynchronous Thread Blocks

: Unlike standard Simulink models that are strictly periodic, QUARC allows you to create non-periodic threads

that run asynchronously for tasks like event-driven code or background communications. Advanced Plotting : Includes the XY Figure block

, which outperforms standard Simulink graphs and can be used to drive axes within a custom MATLAB GUI. Key Features and Workflow QUARC Real-Time Control Software - Quanser

QUARCTM is the most efficient way to design, develop, deploy and validate real-time applications on hardware using Simulink®. QUARC Targets Library - Unleashing the Power of QUARC


Bridging the Gap Between Simulation and Real-Time Hardware

In the world of control systems and robotics, the transition from a Simulink simulation to a working physical prototype is often fraught with complexity. This is where the Quarc Library (by Quanser) becomes an indispensable tool.

Quarc is a high-performance add-on for Simulink that transforms it from a design tool into a rapid control prototyping environment. It allows engineers to run Simulink models directly on real-time hardware without writing low-level C code.

Below is a breakdown of the key features that make the Quarc Library a standard in academic and industrial research.


Quarc excels in Hardware-In-the-Loop (HIL) simulation and Rapid Control Prototyping (RCP) through its IPC blocks.