I have gone through several PID implementations and its tuning tutorials, documents and all. The Best tuning tutorial was PID-without-a-PhD.pdf . But has not been of much help. I can say it works some.

I am working on a Magnetic Levitation project. Please go through the link (Barry's Maglev) for an example. I am able to levitate the magnet keeping an aluminium plate below. Current progress: Video.

I want to perform it without the aluminium plate.

My question is how to start with graph plotting and all. I've seen and been attracted towards the graph only. Say take the **PID-without-a-PhD.pdf** file and just look at the plotted graphs. How to get that? which open tool to start with?

I have tried building and working on some self made graph plotting tool. The plotting against time is not satisfying, and hence the gain determination.

[If there are any self explanatory auto-tune algorithm available! : this is not my question now.]

I want to restart fresh with hard systematic approach. Any help will be god like helpful. I don't want to go with trail-n-error method. As that didn't help.

I am using AtMega2560, a coil, a stack of 2 neodymium magnet, a nicely working H-Bridge.

….Update1….

Also a hall sensor for feedback.

……..

….Update2….

Now I have its transfer function with me. I am studying LTI Transient-Response Analysis using Python. The issue is I have a **matrix** of transfer functions. I might be wrong because what is called what, I don't know exactly. Will learn it soon.

……..

## Best Answer

Generally in industry this would be done with Matlab. If you're trying it on your own you have a few different options as far as numerical calculation/graph plotting software is concerned. First among them is SciLab - a program very like Matlab but open source and free. There are a couple of toolboxes that may or may not provide useful functions for designing and analyzing control systems: Control Design Tool (very popular it seems) and ADS CoLiSyS (much less popular).

Otherwise you could try NumPy or SciPy which have some numerical/graphing capabilities but no control system toolboxes.

Edit: As for tuning a PID controller using a well-known method... you may be out of luck. You can try methods like Ziegler-Nichols but since you're working with an unstable system (the ball will fall without feedback control) you can't do what the method recommends (ie, 'turn off' integral and derivative gains to tune proportional alone, then assign integral and derivative gains as a multiple of proportional gain). However, if you can create a controller that simply stabilizes the ball at a set point (a disturbance rejection controller - the disturbance being gravity) then you can add in your PID controller in series and tune it that way once the system is stable. But it seems your overall goal is to make a controller that will simply stabilize the ball and not, for instance, make it follow a square wave or sinusoid input. So that may not be a worthwhile approach. Keep in mind that what you're doing is by no means basic controls and simplistic approaches don't necessarily apply. Good luck.