GithubHelp home page GithubHelp logo

ros2outdoor / motor-control Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drexel-f1tenth/motor-control

0.0 0.0 0.0 3.02 MB

Motor Control Unit and ROS Node

License: BSD 2-Clause "Simplified" License

Makefile 6.00% C++ 84.04% Python 8.78% Shell 1.18%

motor-control's Introduction

motor-control

Motor Control Unit and ROS Node

Compiling & Flashing the MCU

  • If you do not already have the dependencies installed: make deps
  • make flash

You can also run the MCU node independently with make run.

PID tuning

The PID is currently disabled via the constant expressions at the top of mcu.ino. It is recommended that the PID parameters be carefully re-tuned based on the surface you intend to run the car on.

The PID algorithm is easy to implement in software, however there is some additional cost from the time taken to tune the three (P, I, and D) terms for the controller to respond correctly for our particular system. Tuning the parameters for the controller was done on an automated test bed where a control signal was transmitted to the motor control unit with a desired velocity and plots were automatically generated for visual analysis of the measured vs desired response. The tuning methodology used is enumerated below:

  1. Proportional gain determines how responsive the controller is to changes in error between the desired and measured output. Higher gain may lead to instability and lower gain reduces steady-state error. The proportional term is increased until the measured response quickly reaches a steady state below the desired value.
  2. Integral gain may accelerate the approach toward the desired value. However, a high gain may cause significant overshoot or oscillation without approaching a steady state. The integral term is increased until the response overshoots and then oscillates about the desired value while quickly reaching a steady state.
  3. Derivative gain reduces overshoot and oscillation prior to reaching steady state. However, higher gain will also increase the settling time needed to reach the steady state. The derivative term is increased until an acceptable balance is reached between a reduction of overshoot and the increase in rise time and settling time prior to reaching steady-state.

Feel free to use the test scripts in test/ to check the tuning. It is recommended that you do most of the tuning with the car suspended, then dial in the final parameters with the car running moving on the desired road surface.

motor-control's People

Contributors

theodus avatar jpalko-okoro avatar

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.