What I am looking to do is control the speed of a 12vDC Motor in one direction, but I need stable and repeatable RPM Results. I have no problem getting it to work with just PWM but I realize that I will need to put a rotary encoder on the motor and somehow control it by monitoring that value and adjusting the PWM output if the motor ever see's load.
to start out with I just want to get to the point where I can just manually put a rpm value into a variable, or change that value through a potentiometer and have the motor go to the correct rpm that the value is asking for and attempt to hold it if I put load on the motor. I can work out from there. I'm not using a motor shield, or H-Bridge.. just a TIP120 transistor, like I said, only one direction, speed up and down. in the end the input will be coming from a hall sensor from another piece of equipment and the DC motor rpm will change depending on the shaft rotation from that device.
I have looked at the PID Library, and I'm sure this can be done without it, but I can't seem to find any examples without a tonne of extra's in the code that I tend to get lost in, and I honestly can't find anyone who is just doing simple one direction control.