Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   PID Loop Simulator/Teaching Tool (http://www.chiefdelphi.com/forums/showthread.php?t=130801)

Jared 13-10-2014 19:34

PID Loop Simulator/Teaching Tool
 
I've made a simple PID simulator to help teach and explain how PID loops, and how to properly tune the gains for different systems. It is a nice way to introduce PID loops to newer programmers. The model behaves surprisingly realistically, and the output vs. time graphs look almost identical to graphs from robots.

The program simulates a CIM motor driving a 1 meter long arm with a 150:1 reduction. The mass on the end of the arm can be adjusted, and gravity can be toggled on and off, so you could simulate something not affected by gravity, like a turret. The simulation takes into account an accurate motor curve (where motor torque is a function of motor speed and applied voltage), and the angular momentum of the arm.

You can download the simulator from here:
https://drive.google.com/file/d/0Bzf...ew?usp=sharing

Or look at the source code here:
https://github.com/dicarlo236/PID-De...rc/controldemo


David Brinza 14-10-2014 03:04

Re: PID Loop Simulator/Teaching Tool
 
Nice demo! Our students will get a crack at it this weekend.

BTW, I notice the sim crashes if the Mass is accidentally set to "0" while running and needs to be closed/restarted to work again (it cannot be reset). Other than that little quirk, you've got a slick tool for teaching PID principles.


All times are GMT -5. The time now is 23:13.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi