How to build PID controller with Arduino UNO?

9 views (last 30 days)
I want to control a DC motor with PID controller by using Arduino UNO board and simulink. i write the code as pic attached, and i found the when the ref. value was 0 the motor run and physically it's wrong. PIN 0 Reference value : from variable voltage source 0~5 VDC PIN 1 Feedback : from speed sensor 0~5 VDC PIN 5 output : to motor drive
please any help or example to how i use pid in smulink with arduino.

Answers (2)

Madhu Govindarajan
Madhu Govindarajan on 20 Oct 2015
Here is a link that shows how to do PID control on DC motors using Simulink - http://www.mathworks.com/help/supportpkg/arduino/examples/drive-with-pid-control.html
If you think the motor is running when the input is zero, can you confirm that the input is actually zero by connecting an oscilloscope to the pin?

Adrian Fleck
Adrian Fleck on 4 Nov 2019
But how is it possible to control an proces without simulink and an pid contoler (with code) ?

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!