I have inherited an unfinished project where the Roboclaw 2x7 controller is to be used to control airflow in a test fixture. I have attached the fan motor to the first channel of the controller and have used IonStudio to vary the speed of the fan using the controls on the PWM Settings screen. With open loop control everything seems to work as expected.
In my application I have an anemometer that measures the airflow created by the fan and that provides two outputs to indicate airflow direction and speed. The speed indicator is simply a square wave that varies frequency based on air speed. The direction pin is high for one direction and low for the other. The direction pin remains high or low for a given airflow direction.
When I connect the anemometer to the 2x7 I see the M1 Encoder count increase while the fan runs and remain steady when the fan is off. However, the M1 Speed indicator doesn't seem to work properly. When the fan is at rest the speed indicator settles to zero but when the fan runs the speed indicator constantly changes. The value changes so rapidly that it is impossible to detect a pattern. The numbers seem to range from 0 to ~60 or so - it's difficult to tell.
I know that this is a different application from the standard robot control projects but it seems like the PID controller should be able to do what I need. I would like to be able to set a target velocity (as measured by the anemometer) and have the controller vary the fan speed to achieve that target. I will only have airflow in one direction and I am not concerned with the encoder position - only the velocity.
Based on what I see I suspect that the problem is that the anemometer isn't truly a quadrature encoder since the direction pin remains either high or low for a given airflow. What are my chances that I can make the 2x7 work in this application?