PID for DC Motor Speed

I want to use a PI algorith for controlling a DC motor speed. I have dowloaded the PID code in Playground and I am wondering which option is best
a) Use all code and just set Kd to zero to disable the D function.
b) Try to modify the code to delete the D parts.
c) Try to write and develop my own PI code - I am a C/Sketch novice.

Any ideas?
Thanks.

Zero out Kd
make sure it works.
if it bothers you that there are un-used sections, then delete the portions you find bothersome.

if you are a novice, I doubt you will run into problems with program size any time soon.

I agree :slight_smile:

option c) is also worth some merit in terms of learning ...

There are some basic C examples online to use as conceptual backbones.

Your profile suggests you are an electronics engineer - one day I'd like to implement state feedback on the arduino, you could give that a crack too !