Another update:
One step forward - one back as i wrestled with the CR05 valve. I also blew up 2 Nanos in the process (too many dangly jumpers and I plugged the wrong holes in the proto board) so did some re-writing for a Micro only to find that it doesn't like the interrupt library so I gave up on that - Fortunately new Nanos arrived the next day so I was back to it...
This valve is higher geared than the CR02 unit so open and close times are about 3 secs, and it won't accept PWM speed control (must be the motor controller type) - the CR02 unit was fine with this.
However on the plus side, the open/close ratios are basically the same - very minor differences in times probably due to backlash
This unit also has no obvious relay which is positive for longevity.
BUT - I also tore my hair out as per wiifm because in reverse, the interrupt would fire randomly and shut the whole sketch down (I had test print routines running but outside the interrupt routines)
Even though wiifm had this problem, it took some considerable time for me to eliminate other possibilities and reach the same conclusion - For a while i was convinced it was either a voltage issue or the valve sticking (it died in revs just before stopping - it literally groaned to a halt - quite weird). A simple test sketch without interrupts proved the valve OK and I simply (but belatedly) removed the interrupts from the limit switches and it fixed it - the pin readings of the switches are fine so no more problems in this regard.
I have retained blocking functions for the valve movements as the unit is a slave device - and after initial setup, I'm not expecting constant lengthy movements to be necessary.
The CR05 is still the best for this job because the presence of the limit switches, although problematic for interrupts, allows calibration timing to be carried out - this is important because the speed of these devices is wholly dependent on the power supply voltage - so the timings can be checked and the step times reset on each startup
Because the ball openings are not linear, I delved into theoretical valve flow and came up with a flow equation which allows desired flows to be input and the ball will rotate to the corresponding position - It's not tested and may not be highly accurate but it's a better method than turning to an angle. I also laboriously calculated the physical aperture areas across the range of openings and compared those to the theoretical results - they were in the ballpark but the flow is more constrained at low openings than is represented by simple aperture calcs because the flow turns through quite steep angles thereby increasing head loss.
The required flow will ultimately be controlled** by the PID routine but it can be over-ridden manually if desired.
So I have the Nano sketch just about ready apart from tacking on the PID, and I have a transmission sketch on a Mega to be transplanted to the Distillator
The transmission test sketch allows flow percentages (0 to 100) to be entered via the serial monitor, or 'disengaged' by entering 255. On disengagement, manual stepping open and shut can be done by both the master and the slave. The slave sends back both the calculated flow and the ball angle to the Master.
My box arrived today also - and I've done a ShiFu
- the box is so big I can fit the whole ball valve AND my Bike in it - so I'll have to resort to a balsa or cardboard mockup before ordering another one.
Switches are ordered, brass fittings in hand - getting closer.
** I have a recirculating coolant supply and I have some doubt that the PID routine will cope with it as the 'base' conditions will change as the water heats up, so the P and the I will be affected and the D will be confused - time will tell.