Giter Site home page Giter Site logo

pid_for_dc_motor's Introduction

PID Controller for DC motors

A project to study the characteristics of a DC motor, determine the PID controller settings based on the model, and control the motor using a previously designed controller.

Used hardware

  • uC: STM32F303k8
  • Motor: Pololu 2204
  • Encoder: Pololu 4761
  • Driver: TB6612FNG

PID

  • sampling time: 10ms

Step response of the motor

To measure the step response, set the STEP_RESPONSE constant to 1 in the Core/Src/main.c file and upload program to stm32. On the pc, run the port.cpp program, which will receive and write the data to a file.

PID settings

The previously saved step response file should be completed with a column containing the step PWM value, it should look like this:

0 0
1020 33.3333
1020 133.333
1020 200
1020 233.333
1020 250
1020 266.667
1020 283.333
1020 283.333
1020 300
....

then run the engine.m script in Matlab, which will determine the PID settings based on the data in the file.

PID controller

In the Core/Src/main.c file, change the value of the STEP_RESPONSE constant to 0, enter the controller settings calculated by matlab. Now your motor is controlled by the PID!

pid_for_dc_motor's People

Contributors

partykusz avatar

Watchers

 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.