Looking for some wise guidance please.
My project is to control the speed of a PM DC Motor, using UNO for PI closed loop control.
The Uno board has to measure an incoming speed demand signal comprising a stream of pulses. The motor feedback comprises a similar stream of pulses representing motor speed. Frequency is about 5Hz to 280Hz.
I am measuring the time period of each signal and subtracting the two to use for the error signal which will be processed using the PI transfer function. The output of the PI will drive the motor via PWM.
I now have working code that measures the time period of the two signals (very pleased with success of my first Arduino code!). But my concern is that using time period is the reciprocal of frequency, so, if I am explaining this correctly, the error 'gain' will vary depending where on the reciprocal curve the speed is. I am concerned that non-linearity may cause errors or instability in the control system.
If I convert each time period to frequency, then the error signal 'gain' will be linear irrespective of speed. The only downside of this seems to be the long processor time to do division on each time signal, thus slowing the control loop.
Have I got my thoughts right, and do you think I should go the frequency route to keep it linear or will the simpler time period method work OK. ?