Motor to drive flow meter

Questions about using encoders with the Roboclaw product line
gusep
Posts: 8
Joined: Sun Mar 18, 2018 4:41 am

Motor to drive flow meter

Post by gusep » Sun Mar 18, 2018 5:05 am

I have a hydraulic small gear oil pump driven by a DC motor with encoder utilizing Roboclaw 2 x 15A
Basically if you drive a gear pump with no differential pressure across the pump it becomes a very accurate long lasting flow meter. Encoder pulse freq output being fuel flow rate. High turn down ratio.
Pressure sensor is a piston in glass tube with a LED and photo diode to measure position.

S1 connected to a fixed 1.00Volt as set point
Analog absolute encoder connection for feed back pot BUT it is not connected to motor. It is the photo diode. 0.7 to 4 Volt. Divided down to max 2 V. But a very high gain analog output. Very sensitive to pressure difference.
The idea being that integral should keep the motor speed always tracking the flow rate
I have previously been suggested to use position control.

I have a test system on bench. My problem is that the moment the voltage error reverses the motor stops suddenly. As if the integral is "Cleared"
Is this the case and do you have any suggestions

User avatar
Basicmicro Support
Posts: 1201
Joined: Thu Feb 26, 2015 9:45 pm

Re: Motor to drive flow meter

Post by Basicmicro Support » Mon Mar 19, 2018 11:48 am

1. For this application velocity mode may be a better choice.

2. The integral is not zeroed except when a setpid command is used(velocity integral for the velocity setpid and position integral for the position setpid) or when open loop commands are used on the particular motor.

gusep
Posts: 8
Joined: Sun Mar 18, 2018 4:41 am

Re: Motor to drive flow meter

Post by gusep » Tue Mar 20, 2018 3:34 am

I have done a little more thinking
The photo diode voltage is buffered, attenuated, level shifted and sent to an integrator.
Limited from 1V to 2 V OR 0V to 1V Need to make sure Motor never goes reverse
So if the pressure difference is +ve over set level, the integrator voltage rises at a rate determined by photo diode output voltage and if the photo diode is less than set level, integrator drops. This integrator voltage is connected to S1 input and controls Motor RPM. Calculate to make sure that the max rate is less than motor dynamic acceleration rate with pump connected.
Velocity Mode is perfect. Test tonight.

User avatar
Basicmicro Support
Posts: 1201
Joined: Thu Feb 26, 2015 9:45 pm

Re: Motor to drive flow meter

Post by Basicmicro Support » Tue Mar 20, 2018 10:01 am

Let me know the results. Thanks.

gusep
Posts: 8
Joined: Sun Mar 18, 2018 4:41 am

Re: Motor to drive flow meter

Post by gusep » Wed Mar 21, 2018 4:25 am

Completed integrator circuit but not connected yet.
I am having trouble making the motor run smoothly at below 60RPM
1000 line encoder. Just used the A+ and B+ Cannot use the A- and B-
S1 connected to 50k pot and 75k series resistor
P = 50 I = 1 D = 0 Tried smaller but no better.
Maybe the S1 voltage is moving slightly. Need to look with 4 channel scope tomorrow
On a positive note in real life the gear pump fuel flow can help stabilize the RPM
DCM series brush motor 24V DCM50205

User avatar
Basicmicro Support
Posts: 1201
Joined: Thu Feb 26, 2015 9:45 pm

Re: Motor to drive flow meter

Post by Basicmicro Support » Wed Mar 21, 2018 9:46 am

You can convert differential encoder signals into single endded ones with a comparator. If noise appears to be a problem I would recommend that otherwise you should be ok just running the + side of each encoder channel.

I've never used such a high resistance pot. This may allow significant noise into the signal on S1. This may or may not affect your control. I would run tests using Ion Studio with Packet Serial commands first to confirm the feedback system is working and then move to using the analog input to control the setpoint.

Low RPM can be tricky. If the motor is coggy(turn the motor manually, does it "stick" at certain angles, if so its coggy). On the other hand if the motor is relatively smooth then not running at low RPMs well could indicate PID values need to be adjusted.

The motor is ratedf for 3400 rpm. Are you using a gear head to reduce the speed? Is the 60rpm with or without a gearhead/reduction? In the case where you are direct driving from the motor(no reduction), 60rpm isnt just low rpm, it is extremely low RPM.

gusep
Posts: 8
Joined: Sun Mar 18, 2018 4:41 am

Re: Motor to drive flow meter

Post by gusep » Fri Mar 23, 2018 4:54 am

Scoped the encoder signals 0 to 4 Volts. No noise
Used the simple serial and tried minimum speed. 50RPM. Not smooth
Changed different PWM control. No difference
Changed all PID settings. No improvements
Motor voltage 15.8Volts.
I have a full size NC mill and it can go ever so slow if required. Yes different beast.
I was counting on being able to rotate very slowly. Need to fit a gear reduction or different motor or small gear pump
Thank you for you help

gusep
Posts: 8
Joined: Sun Mar 18, 2018 4:41 am

Re: Motor to drive flow meter

Post by gusep » Fri Mar 23, 2018 4:59 am

Actually came across this video on very slow control of DC motor
https://www.youtube.com/watch?v=H36oAtkAb7w
Requires some different code on RoboClaw

User avatar
Basicmicro Support
Posts: 1201
Joined: Thu Feb 26, 2015 9:45 pm

Re: Motor to drive flow meter

Post by Basicmicro Support » Fri Mar 23, 2018 11:31 am

1. I've run motors with the method he is using. A good description would be a discontinuous pulse drive. Basically you send a pulse which is garunteed to move the motor X amount. With a long enough delay that it will stop before the next pulse comes in. Repat to cause what appears to be continuous motion. This can work very well in certain situations. We use to offer this capability as dithering. We removed that functionality when we determined you can reproduce this with proper PID settings. However there is a trade off. As load increase the slowest point of smooth motion increases as well.

2. The cogging effect Im talking about is significant and easily noticable. If you rotate the motor by hand with no power the cogging causes it to stick or move into specific angles as you turn it around. This is much more extreme on some motors than others(eg neodimum magnet based motors usually have a significant amount). How the motor is wound also effects how much cogging it may have. The worse this is the faster the motor will ahve to speen to be smooth. This motor looks like a low cost off the shelf kind you could get from Radio Shack when they were open. Those motors have effectively zero cogginh(eg you can spin them with ease) so this drive method can run them very slow(with little load).

3. Your mill is unlikely to be direct drive unless its a stepper or brushless motor which are a complete different beasts. At a minimum it will have a belt reduction but more likely has a gear head on it if it is a DC motor. Or it is designed to run at low speeds. Note a mill with a ball screw on it has a high effective reduction as well.

If you would like to work with me on tuning your PID for the low speed movement just call in.

gusep
Posts: 8
Joined: Sun Mar 18, 2018 4:41 am

Re: Motor to drive flow meter

Post by gusep » Sat Mar 24, 2018 5:03 am

Tonight I worked on PID. Using simple serial
18 RPM with almost no stopping. Reasonably stiff to speed/load. Just not good enough. Will place a planetary gear speed reduction of 2 > 3 :1 OR a smaller gear pump
I am trying to achieve a 1000 turn down ratio of flow.
Included in my Integral circuit is a divide by N as the 1000 line encoder is too fast for my Engine management system digital speed channels.
I am building a 60's mechanical fuel injection race engine for a customer. I will map with electronic with accurate fuel flow logged at all engine speed loads. Then on my mechanical fuel rig match the flow figures recorded to a Stylus lift value. Through a excel spread sheet and trigonometry create a point cloud and import to Solidworks. Then convert to G codes to use my NC mill.
Let you know results

Post Reply