Close

PID gains auto-tunning

A project log for Smart Motor Driver for Robotics

This motor driver is able to control a motor using PID by I2C. Taking precise control of a motor have never been so easy.

danny-frDanny FR 10/04/2018 at 03:380 Comments

Today I am going to talk about something that is included on the Arduino library for SAMI. It is a little program that allow to obtain automatically the gains required for the PID control algorithm for both speed and distance controllers. 

It is based on the Ziegler-Nichols method, it is not too accurate but will do the job for most applications. Fine human tuning may be necessary in some cases. After all the fun is in experiment and watch the different reactions of the system with different values. 

This time I didn't do the job alone, the calibration code uses jack01 autotuner library and is already modified to work straight forward with SAMI for easy setup. However you must download his library separately to respect his amazing work with this Arduino Library.

Let's say no more and watch it in action:

Remember, this example and other useful ones about how to use SAMI are available in my Arduino Library. You can install it directly with the Arduino IDE Library manager, just serch "SAMI" and install the one that says my name on it ;)

Discussions