Quarc Library Simulink 〈iOS〉

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

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:

  • Real-time control: Quarc allows users to deploy control systems in real-time, enabling the development of advanced control systems that can interact with physical systems.
  • Simulink integration: Quarc is fully integrated with Simulink, allowing users to design, simulate, and deploy control systems using Simulink's graphical modeling and simulation environment.
  • State-space modeling: Quarc provides a range of blocks and tools for state-space modeling, enabling users to create complex control systems.
  • PID control: Quarc provides a range of PID control blocks, allowing users to design and deploy PID controllers.
  • Support for Quanser hardware: Quarc provides support for Quanser's range of hardware products, including data acquisition boards and control systems.

Benefits of Using Quarc Library

The Quarc library offers a range of benefits to users, including:

  • Faster development: Quarc's integration with Simulink enables users to design, simulate, and deploy control systems quickly and efficiently.
  • Improved accuracy: Quarc's real-time control capabilities enable users to deploy control systems that can interact with physical systems, improving the accuracy of simulations.
  • Increased productivity: Quarc's range of blocks and tools enables users to create complex control systems quickly and easily, increasing productivity.
  • Reduced costs: Quarc's integration with Simulink and Quanser hardware reduces the costs associated with developing and deploying control systems.

Applications of Quarc Library

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

  • Control systems: Quarc can be used to design and deploy advanced control systems, including state-space models and PID controllers.
  • Robotics: Quarc can be used to develop control systems for robotics applications, including robotic arms and autonomous vehicles.
  • Aerospace: Quarc can be used to develop control systems for aerospace applications, including aircraft and spacecraft.
  • Industrial automation: Quarc can be used to develop control systems for industrial automation applications, including process control and manufacturing systems.

Getting Started with Quarc Library

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

  1. Install Quarc library: The Quarc library can be installed from the Quanser website.
  2. Launch Simulink: Once the Quarc library is installed, launch Simulink.
  3. Load Quarc library: Load the Quarc library into Simulink using the Simulink library browser.
  4. Create a new model: Create a new model in Simulink using the Quarc library blocks.
  5. Configure the model: Configure the model to suit your specific application.

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

  • What is Quarc library?: The Quarc library is a software framework that enables users to design, simulate, and deploy control systems using Simulink.
  • What are the key features of Quarc library?: The key features of the Quarc library include real-time control, Simulink integration, state-space modeling, PID control, and support for Quanser hardware.
  • What are the benefits of using Quarc library?: The benefits of using the Quarc library include faster development, improved accuracy, increased productivity, and reduced costs.
  • What are the applications of Quarc library?: The Quarc library has a wide range of applications in control systems, robotics, aerospace, and industrial automation.

Additional Resources

  • Quanser website: The Quanser website provides a range of resources, including documentation, tutorials, and support.
  • Simulink documentation: The Simulink documentation provides a comprehensive guide to using Simulink, including the Quarc library.
  • Quarc library user manual: The Quarc library user manual provides a detailed guide to using the Quarc library.

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.

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

  1. Open Simulink: You start by opening Simulink and creating a new model.
  2. Add Quarc Library: You add the Quarc library to your Simulink model by searching for "Quarc" in the Simulink Library Browser.
  3. Select Quarter Car Model: You select the Quarter Car model from the Quarc library and add it to your model.
  4. Configure the Model: You configure the Quarter Car model by setting parameters such as the vehicle's mass, suspension stiffness, and damping coefficients.
  5. 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.
  6. 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:

  • 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.

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:

  1. Control Systems: Quarc provides a variety of control system blocks, such as PID controllers, state-space controllers, and model predictive control (MPC) blocks.
  2. Estimation and Filtering: The library includes blocks for state estimation, parameter estimation, and signal filtering, such as Kalman filter and Luenberger observer blocks.
  3. Signal Processing: Quarc offers a range of signal processing blocks, including filtering, convolution, and Fourier transform blocks.
  4. Nonlinear Systems: The library provides blocks for modeling and simulating nonlinear systems, such as backlash, hysteresis, and saturation blocks.
  5. 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: quarc library simulink

  1. Rapid Prototyping: Quarc enables users to quickly design, simulate, and test control systems, reducing development time and effort.
  2. 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.
  3. Flexibility: Quarc supports a wide range of applications, from simple control systems to complex mechatronics and robotics systems.
  4. 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:

  1. Control Systems: Quarc is used in various control systems applications, such as robotics, autonomous vehicles, and process control.
  2. Mechatronics: The library is used in mechatronics applications, such as motion control, vibration control, and robotics.
  3. Signal Processing: Quarc is used in signal processing applications, such as audio processing, image processing, and biomedical signal processing.
  4. 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:

  1. Download and Install: Download and install the Quarc library from the Quanser website.
  2. Familiarize with Simulink: Familiarize themselves with Simulink and its interface.
  3. Explore Quarc Blocks: Explore the Quarc library and its blocks, and review the documentation and tutorials.
  4. 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.

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

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 The QUARC Real-Time Control software from Quanser is


Workflow Summary: How It Works

  1. Design: Create a control algorithm using Simulink blocks and the Quarc library (e.g., HIL Initialize, HIL Read Encoder, HIL Write Analog).
  2. Simulate: Verify the logic using standard Simulink simulation tools.
  3. Build: Click the "Build" button. Quarc automatically generates C code (via the Real-Time Workshop), cross-compiles it, and downloads it to the target hardware or prepares it to run on the local Windows machine.
  4. Run & Tune: Start the model. Use the Soft Scope to monitor signals and change gains in real-time to tune the physical response.

Overall Assessment

QuArc is a strong choice for teams doing serious embedded control development with Simulink who value production-ready code, traceability for certification, and reusable architectural patterns. It requires upfront investment in training and toolchain management but delivers measurable gains in code quality, verification, and scalability for medium-to-large projects.

Related search suggestions: "suggestions":["suggestion":"QuArc Simulink tutorial examples","score":0.85,"suggestion":"QuArc code generation best practices","score":0.78,"suggestion":"Simulink libraries comparison for embedded control","score":0.72]

QUARC is a rapid control prototyping (RCP) software developed by Quanser that integrates directly into Simulink. It allows engineers and researchers to run Simulink models on real-time targets—such as Windows, Linux, or embedded hardware—without manual C/C++ coding. Core Functions & Capabilities

QUARC essentially transforms Simulink into a real-time development environment through several key features:

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.

Target Management: You can develop a model on your host PC and deploy it to a remote target (like a Quanser Qube or a Raspberry Pi) via a single click using the "Monitor and Tune" feature.

Hardware Interfacing: The library includes specialized blocks for I/O, including Data Acquisition (DAQ) boards, cameras, and communication protocols (SPI, I2C, PWM).

Code Generation: It leverages Simulink Coder to automatically generate, compile, and download real-time code to the target processor. Key Library Blocks

The QUARC library is organized into categories to streamline the development of control systems: Description Common Blocks Data Acquisition Interfaces with physical hardware sensors and actuators. HIL Read/Write, Analog Input, Encoder Input. Communications Handles data exchange between different models or devices. Stream Call, Stream Send/Receive, TCP/IP, UDP. Multimedia For vision-based control and image processing. Video Capture, Display Image, RGB to Gray. Devices Specific support for high-level hardware. Game Controller, Wiimote, Specialized Robot drivers. Advantages for Developers

"One-Click" Deployment: Eliminates the need to write custom drivers or handle complex compilation toolchains manually.

Live Parameter Tuning: Change gains, setpoints, or logic in the Simulink model while it is running on the hardware, and see the results instantly without stopping the process.

Cross-Platform Support: Develop once and deploy to various operating systems (Windows, Linux, QNX) by simply changing the target configuration.

Extensive Documentation: Quanser provides a comprehensive Online Help system integrated directly into the MATLAB help browser. Typical Workflow

Design: Create your controller using standard Simulink blocks.

Interface: Replace "Simulated Plant" blocks with QUARC HIL (Hardware-In-the-loop) blocks to connect to real sensors.

Configure: Select the QUARC target (e.g., quarc_win64) in the Model Configuration Parameters.

Build & Run: Click the "Build" button to generate code and "Connect" to start real-time execution.

QUARC is widely considered the "gold standard" for real-time control prototyping within the MATLAB/Simulink environment, particularly in academic and high-end research settings.

The general consensus from users and researchers is that it is a powerful, reliable tool that bridges the gap between theoretical modeling and physical hardware, though its high performance comes with specific hardware requirements and potential performance trade-offs in certain modes. Core Strengths

Quanser Real-Time Control (Software) アルテックス | IPROS

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.

Stream Blocks

The Stream blocks in Quarc allow a Simulink model running on the target hardware to communicate with a "Host" application running on a PC. Real-time control : Quarc allows users to deploy

  • Host Interface: You can create a "Gauge" or "Scope" interface in Simulink on your laptop that reads data in real-time from the robot via TCP/IP.
  • Parameter Tuning: Users can change PID gains or reference signals in the Simulink model on the host PC, and Quarc updates the parameters on the target hardware instantly without recompiling the code.

5.1 Duplicate vs. Alias Block System

A powerful feature is the Duplicate/Alias system. When you need to access the same hardware channel in multiple places, QUARC allows you to create "Alias" blocks instead of duplicating heavy hardware drivers. This avoids double-initialization errors and keeps diagrams clean.