Hi everyone. I intend to control the position of a DC motor and I have built the H-bridge. Now what I want to do is implement a P-controller in a PIC 16F877 so that the larger the error, the higher the duty cycle of the PWM signal. This means that the motor will turn faster if it is far away from the correct position and will slow down as the error approaches zero. But I was wondering what would happen to the torque of the motor as the duty cycle varies. Shouldn't the torque be more when the motor is going at a slower speed (i.e. lower duty cycle)? But a lower duty cycle means that the voltage seen by the motor is less. Doesn't that mean that the current drawn by it will be less since the motor's armature resistance is the same at all times? Please explain.