Using PID to control the DC Motor's velocity!

I am trying to control velocity of DC motor by using Arduino PID system.

As PWM values are analogue, the Arduino system sends integers between 0-255 to adjust current
appropriate for the speed that we are aiming for…?

Thus, I measured the motor’s min/max (pulse/sec) values with PWM min(0)/ max (255) values under no-load test, and mapped the values at a fixed rate.

As a single analogue PWM value produces mapping pulse/sec value with an error range of 100-200, I believe that a test to find PID’s gain values will produce a graph indicative of vibration.

However, what should I do to obtain gain values that removes vibration via PID control system, and produces regular set values…?

I have attached an image of (pulse/sec) values measured through PWM values under no-load test.

The analog outputs of the ardiuno do not modify the pulse-per-sec to get variable numbers, they modify the pulse [u]width[/u]. Hence, PWM: pulse width modulation.

Umm.. I understand. Then what should I do to obtain gain values that removes vibration via PID control system? And I don't know the way to find profit PID's gain values.. Can you explain..? :sob: :sob:

I got the result value via the test.

duty (0~255) mapped rpm (0~207)

Set the rpm value what I aim for…

And I control to maintain the set rpm value by PID.

Then how to apply the analogwrite ???

PID has Input, Setpoint, and Output.

“Input” is the current speed of the motor. (How do you measure the speed of your motor?)
“Setpoint” is the desired speed of the motor, in the same units of measure as “Input”.
“Output” is the control signal. The default range is 0 to 255 so it can be used directly with analogWrite().