No items found.
May 9, 2024

Machine Learning Control and HIL Testing with Collimator and JAX

Machine Learning Control and HIL Testing with Collimator and JAX

In this blog post we present a four-part video series hosted by Jared, an engineer on the Collimator team, who guides viewers through advanced techniques for controlling the Quanser Qube rotary pendulum using the Collimator platform. Each part of the series focuses on different aspects of controller design, from basic linear control strategies to sophisticated machine learning-based approaches, showcasing the versatility and power of the Collimator software for modeling, simulation, and control design. The neural network controller in particular illustrates how easy it is to develop and test modern AI-based systems in Collimator, a process that is typically complicated and time consuming, even for experts.

Part 1: Introduction to the System and Basic Control

Jared introduces the Quanser Qube rotary pendulum, discussing its mechanical setup and the theoretical underpinnings necessary for control, such as the equations of motion. He demonstrates how to use the Collimator app to interact with both the hardware and an idealized model of the system, highlighting the platform's ease of integrating hardware and software to streamline the simulation process.

Part 2: Linear Control Strategies

The second video dives into linear control strategies, specifically the design and implementation of a Linear Quadratic Regulator (LQR) for disturbance rejection. Jared uses Collimator's Python API and integration with external libraries, like Python Control Systems Library, to enhance the control design process. This part emphasizes the practical application of theory to hardware and the benefits of graphical block diagram construction within Collimator.

Part 3: Nonlinear Control and Energy Shaping

In this installment, Jared tackles the nonlinear control challenge of swinging the pendulum to its upright position using energy shaping control. He develops a heuristic control law inspired by the simple pendulum's dynamics. Then we learn how to implement a hybrid approach that switches between non-linear and linear control, demonstrating Collimator's capabilities in quickly iterating and testing control strategies on virtual, and then physical, hardware. This video illustrates the platform's flexibility in accommodating both simple and complex control logic through user-friendly block diagram and Python interfaces.

Part 4: Advanced Control Techniques (ML)

The final video explores cutting-edge control techniques, including trajectory optimization and neural network-based feedback control. Jared outlines the process of setting up trajectory optimization problems within Collimator and the challenges of applying such optimized trajectories in real-world applications. He then shifts to a more innovative approach by developing a neural network controller trained via reinforcement learning. The process is enhanced by Collimator's differentiable simulation capabilities derived from JAX. This part notably highlights how Collimator facilitates the integration of machine learning with traditional control methods to create robust, hybrid control architectures.

Benefits of Using the Collimator Platform

There are many benefits to using Collimator for controls engineering, including:

  • Versatile Modeling Tools: The platform supports a wide range of control design approaches, from simple PID controllers to complex machine learning algorithms, accommodating various user needs and system complexities.
  • Integration of Hardware and Software: Collimator seamlessly integrates physical hardware interaction with simulation, allowing for real-time testing and adjustment of control strategies.
  • Graphical and Script-Based Interaction: Users can construct models and control systems using intuitive block diagrams or direct script coding, offering flexibility in design approach.
  • Advanced Optimization and Machine Learning Capabilities: Collimator supports advanced techniques like trajectory optimization and neural network training, leveraging its differentiable simulation environment to efficiently compute gradients and optimize control parameters.
  • Educational and Practical Application: The platform serves as both an educational tool for learning control system design and a practical tool for developing sophisticated control strategies in research and industry.

In addition to these, within the context of optimization of controls and control algorithms, one of the primary benefits to using Collimator is efficiency. Not only can you implement and test a variety of control strategies quickly, but you can also efficiently optimize your controller thanks to the integration of common libraries, support for highly parallel computation, and the auto differentiation capability that JAX provides.

Frequently Asked Questions

See Collimator in action