Gate Valve Drive Electronics

A forum for discussion on the WMT River Control System hardware.
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Gate Valve Drive Electronics

Post by TerryJC »

Sitrep4:

The valve software is now working. In the end, it wasn't PWM that was needed. In fact that never really worked at all because I needed to set the PWM ratio to at least 60% to overcome the stiction and then the actuator went off at full chat and overshot as before. I thought about using a high PWM ratio to kick off the motor and then immediately winding it down once the motor was going, but there really isn't enough time to do that. The current circuit diagram has therefore reverted to V01.

In fact the problem was a combination of a bug in my Limits comparison routine and a fine tuning of the Limits themselves. If I set the Limits too fine, eg 1%, the motor hunts for ages before it settles. Too wide and the position can be quite a long way away from where we need it. In the end I settled for 10%. Once the position is within limits, the valve appears to stay exactly where it is, except for a couple of unexplained occasions where it suddenly hunted for a second or two after the position had been rock solid for several minutes or more. I need to investigate that.

Apart from that, I will need to work out how to change the valve position on the fly; the current code allows for only one position and a restart is needed to set a new position. (I think a bit of multi-threading is needed there to allow new values to be injected into the running loop, but I may be able to achieve the requirement more simply by having a standalone monitor routine that calls the motor hold routine only when the valve drifts out of position or a new position is called for.)

I will then need to integrate what I have into Hamish's code. He gave me some pointers some weeks ago, but I may have to ask for his help if I can't sort it out.

I'll keep you posted.
Terry
Penri
Posts: 1284
Joined: 18/05/2017, 21:28

Re: Gate Valve Drive Electronics

Post by Penri »

Good morning,

On Friday you wrote:
It seems to me that we have a number of choices:
We could use these jumpers as they are and coil up the excess cabling. We would probably need a tag strip of miniature chocolate block somewhere to cater for the resistors and commoned power supply lines.
As above but with an extra piece of Veroboard instead of tag strip.
We could cut the jumpers to length and use in-line splices and heat shrink to join the two ends together or to the resistors to achieve the required length. We can common up the power lines using a multiway splice.
Something I haven't thought of. :)
Whatever we do, wiring is going to be quite time consuming, especially when we think that we have all of the Gate Valves and Sensor Pis to wire. One suggestion could be to draw up a Cable Loom Assy for each higher level assembly and build them on a production line process, like we used to do at work. In that case I would suggest that Method 3 above would be the best approach, since Methods 1 and 2.going to end up with lots of excess wire everywhere.
My view, for the gate valve, is to make up a cable loom assembly; in the end that's probably going to end up easier plus more maintainable and robust.

I did a trial fit of the cardboard mounting plate on a valve assembly, I'll send photographs shortly. This exercise has shown me that there's a fair bit of room to extend the mounting plate downwards to give us room for terminations, other components and the Ethernet dongle. This coming week can we get together and play around with electronic modules' positioning to find an "optimum" placement? I've then make up a plate on which we can try out a complete assembly. When that's done we can decide whether we should encase it in a bought out box or create a 3D printed enclosure.

For overall weather protection we'll need to slip a cover over the entire assembly, possibly a large soft drinks bottle / milk carton.


Penri
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Gate Valve Drive Electronics

Post by TerryJC »

Penri,

I intend to come to the WMT on Tuesday morning and will bring a box of bits with me. If we are going to play around with the actual modules, I'll bring my static workstation mat and a couple of wrist straps; I know electronic devices are a lot more robust that they used to be, but I prefer to be cautious. We'll need to find somewhere to work where we can plug the mat's three pin earth connector into a mains socket.

On a slightly different subject, I've been looking at how to integrate the code that I have now got working into Hamish's stuff. As I said, earlier, I need to get multithreading working and also make my code object-orientated in order to be similar to the style and approach that Hamish has used to date. Hamish gave me some example code, but in order to understand it, I've been studying some online tutorials. Currently I'm about halfway through this exercise, so I hope to be able to report some decent progress by Tuesday.

See you then.
Terry
Penri
Posts: 1284
Joined: 18/05/2017, 21:28

Re: Gate Valve Drive Electronics

Post by Penri »

... and here are the photographs
Attachments
IMG_2604.jpeg
IMG_2604.jpeg (1.6 MiB) Viewed 1303 times
IMG_2598.jpeg
IMG_2598.jpeg (1.25 MiB) Viewed 1303 times
IMG_2596.jpeg
IMG_2596.jpeg (1.22 MiB) Viewed 1303 times
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Gate Valve Drive Electronics

Post by TerryJC »

Sitrep 5:

In the light of our discussions on Tuesday morning, I have now produced a new Version of the Actuator Motor Drive circuit. Electrically, it is virtually identical to V02, but the circuit now includes the DC-DC Converter Module, the Terminal Block to carry the wiring to and from the Actuator, colour coded wiring and an indication of how we would handle multiple connections to a single wire (eg 0 V).

On Tuesday, I proposed that multiple terminations should be done in the cable assy, but I've thought twice about that now as it will make the cable branches less flexible. Instead, I've taken advantage of the fact that the screw Terminal Block will be mounted on a strip of Veroboard. I then assumed that we wouldn't want to try to put two wires into a single screw terminal, so added Veropins to the Veroboard to provide the necessary expansion. I also assumed that we wouldn't want to solder more than two or more wires to a single Veropin, which led to one pin being needed for the +3.3 V and two for the 0 V. (the diagram shows a schematic representation of the circuit and in reality the pins would simply be soldered to the same track as the TB pin.) For the DC-DC Converter, Veropins are needed anyway, which solves the problem of distributing the 12 V -ve and -ve lines.

The only fly in the ointment is that I've assumed that we would construct the cable assy from cut-down jumper wires, with the additional DuPont contacts being used to make-off the shortened ends. However, that only gives us 10 colours, so we either have to find some more wires with different colours or find a way to sleeve the duplicate wires to identify them. (I appreciate that there are only about 20 wires in the cable, some of which are commoned up,but having a positive ID does make fault-finding easier for someone who wasn't privy to development. We could use wires stripped out of Cat 5 cable, but I'm not sure how they would perform mechanically in the long term and they would be more difficult to lay out in the main assy.
Attachments
Actuator_Motor_Drive_Circuit_(LM298D_Board)_V03.odg
(150.92 KiB) Downloaded 78 times
Terry
Penri
Posts: 1284
Joined: 18/05/2017, 21:28

Re: Gate Valve Drive Electronics

Post by Penri »

Circuit looks very logical.

Do we need another 3 colours?

I have all the parts with the exception of the Dupont headers, which I'm told are on their way, probably on a slow boat from China!

I've revised the base board model and plan to cut out and drill a prototype in the next day or two.
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Gate Valve Drive Electronics

Post by TerryJC »

Yes. Three should do, but more would be better. I have some other suitable wire but the colours are simply a subset of the jumper colours.
Terry
Penri
Posts: 1284
Joined: 18/05/2017, 21:28

Re: Gate Valve Drive Electronics

Post by Penri »

Photos of valve with prototype base board (polycarbonate) fitted and DC-DC converter, motor drive and Vero termination strip boards mounted, all on nylon standoffs with nylon screws (M3). Actuator wires randomly pinched into termination strip.
Attachments
IMG_2631.jpeg
IMG_2631.jpeg (1.6 MiB) Viewed 1295 times
IMG_2630.jpeg
IMG_2630.jpeg (1.54 MiB) Viewed 1295 times
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Gate Valve Drive Electronics

Post by TerryJC »

It's looking pretty good! Can I have it to fit the rest of the electronic modules and lay out the cables?

I can then test it with my standalone software and have a test piece to integrate with Hamish's framework.
Terry
Penri
Posts: 1284
Joined: 18/05/2017, 21:28

Re: Gate Valve Drive Electronics

Post by Penri »

Yes of course. I don't have "header pins" to fit or the header sockets to make up the cable assembly yet.

There may be a clash between the Ethernet dongle and the terminal strip but longer standoffs will cure that.

I can be at WMT tomorrow at around 10:00 with it and a kit of nylon fixings.
Post Reply