Giter VIP home page Giter VIP logo

minjerk's Introduction

Minimum Jerk

View Model and code for a minimum-jerk controller on File Exchange Open in MATLAB Online

Gitpod

This example shows how to model systems with Simulink to then generate C/C++ code out of it that can be conveniently interfaced with YARP.

Here's below a picture of the model whose code we want to obtain.

Briefly, we have a simple scheme of a well known Reference Model Control approach where the plant is supposed to be a pure integrator but in reality it's not.

Therefore, if we run the simulation with the parameter's value CompensatorState.Off, we get the following responses.

Clearly, the plant output (red) does not follow the desired trajectory (green) accurately enough when the system is provided with the stepwise input (blue).

To tackle the unknown discrepancies, a PI compensator can be designed, which is constantly fed by the error between the response of the actual plant and the response of the reference plant (i.e. the pure integrator in this case).

If we enable the compensator by setting the parameter's value equal to CompensatorState.On, we get the nicer tracking visible below.

Finally, a third possibility is also given corresponding to the parameter's value equal to CompensatorState.Auto. In this case the PI compensator will automatically switch on/off according to some internal thresholds the user can have access to.

Once done with the simulation, the model can be compiled through the Simulink Coder to generate the equivalent C++ code already available in auto_src directory.

The auto-generated code has a clear interface composed of input and output structures and variables so as the structure and variable devoted for the handling of the parameters. It's thus straightforward to integrate it in a YARP project to control in velocity a joint of the simulator (which should behave like an integrator).

The scope.xml file can be used along with the yarpscope tool in order to visualize the behavior of the overall system.

minjerk's People

Contributors

pattacini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

minjerk's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.