Update on progress
1/ The eBay supplier has acknowledged that the wrong valve was sent (CR02) and will send another (CR05) - Now I just have to receive it
2/ In the meantime, I've been examining the CR02 and the L298N driver board
I had trouble initially with the driver boards (I have 2) - thought I'd blown them on a number of occasions..
I tried them with first with an old transformer type 12v regulator which worked with the motor but wouldn't work when hooked to the driver boards
Then tried a switch mode 12v unit - same result
When I checked the open circuit output voltage it was only showing 6.5v for both regulators !?!
I googled and found a number of posts relating to low output voltage on these items and I was just about to hit the keyboard on eBay to say they were u/s when I tried out a larger multi V reg on 15v - Bingo - open circuit 15v showing on both boards - weird!!.
I hooked up the motor and away it went on 15v - Step 1 complete.
I thought I'd attach a buck converter before the driver board for 2 reasons..
a/ I didn't want to blow the 5v regulator on the board
b/ the speed of the DC motor is governed by the drive voltage so I wanted to select the output voltage on the driver board
I plugged it all in and set the driver board output voltage to 12.5v while the motor was running - the corresponding input voltage was about 13.5v - so only 1v lost through the board. - Step 2 complete
I wrote a sketch to cycle through speed ranges and found that the controller and motor combination won't work below about half speed - Full speed (255) open/close is about 4 secs - step 3 complete
By much trial and error I determined that the ball travels through 12 degrees from fully closed to 'just-closed'. This gave me a ball diameter of 24mm for a 15mm bore. This left 78 degrees of travel from 'just-closed' to fully open. - Step 4 complete
More trial and error and I had established a best low speed of 145 and a corresponding step time to achieve 1 degree movement increments. - Major step 5 complete.
Tried various dance routines and noticed that when moving forward and backwards the same amounts, the ball stopped in different locations. More investigation led me to conclude that the forward gears have a different ratio to the reverse!!. Minor glitch overcome by changing the closesteptime.
Also noticed that the braking function will not work on this valve motor - obviously the controller interferes with it - won't accept HIGHs on both leads. More checking required on this.
Because of inertia on 'coast' - stopping of large step angles was not precise - ie - 9 lots of 10 degrees overran the 90 degrees total. The solution was to repeatedly step @ 1 degree intervals with a small pause in between. - Step 6 completed
Moved on from the test sketch and wrote one with interupts for Open and Close - stepping @ 1 degree intervals - works fine - The precision of steps is limited to integer values so it's a matter of juggling motor speed with steptimes to get the best fit.
Step 7 complete with the caveat that I'm not sure of the life of the relay in the motor using this approach - time will tell. I could also halve the steptimes and jump in 1/2 degree steps but that's more load on the motor relay. (It sounds like a mechanical relay).
So what happens now with the sketch:
1/ Power up, the valve does a full speed open and close, pauses, changes to low speed and then opens to the 12 degree 'Just-Closed' mark. (note that with the CR02, there are no limit switches but a current sensing circuit, so to get a full open/close I just drive the motor long enough each way to ensure it's done, the circuit cuts the power at both ends)
2/ Interrupt waits for an open/close signal
In use, the degree control could be replaced by a small variable time step as the required opening will be governed by a PID routine and the inertia etc probably won't matter as the logic control will involve movements damped by the PID logic.
Anyway- that's future stuff - suffice to say that at this point the CR02 is a working option.
Next some maths to find out some proportional step openings and see how practical it would be to step by aperture proportion. Probably won't correspond to proportional flow anyway as the pressure drop will vary. Again in the end, with PID control we don't care what opening is chosen as long as the temp control can be achieved - too imprecise however and the PID might 'hunt' too much.
That's enough for now (some may say way too much
)
I attach the sketch for those who are interested.
Cheers
Eb