valve controller

08 Jun 2012

Hi.

I need to develop a controller for a group of 48 valves (Turn on off in a sequence). The resolution is 5 ms. The faster cycle is 350ms.

I´m planning to use a group of 6 port expanders 8 output each via ISP or I2C.

Is it possible to change the timing (ON OFF) via ethernet on the fly. I mean, change the ON OFF timing while the valves are working, without retarding the trigger of the valves?

Thanks for your help.

13 Jun 2012

Hi Gabriel,

What type of valves are you using? I ask because 5mS resolution is possibly too fast for many valves, small solenoid valves such as made by Lee will be OK, but many 'standard' valves are quite slow. Also you need to provide back emf protection for the drivers and that will need to fast as well. Not answering your question I know, but worth considering....

13 Jun 2012

The available I2C ports on the mbed support the 400kbit/s datarate. They still work at around 500kbit/s. Depending on the portexpander type that you use, it costs about 20bits/byte outputdata. Updating all 6 portexpanders takes 120 bittimes (0.24 ms). You should be OK as far as resolution is concerned. However, the standard mbed libs for I2C are blocking and you loose some processing time. You may also need to run at lower speeds depending on the capacitive load on the I2C bus (number of devices, wire distance). SPI comms work in a similar way, faster bitrates but no addressing, so you need separate CS lines to each expander. You can simplify that by just daisy-chaining them or using plain shiftregisters like a 74595.

The portupdating process could be linked to a ticker (5 ms rate) that sends the next 6 databytes from the active half of a double buffer. The mainloop checks for new data received via ethernet, updates the inactive half of the double buffer and switches the two buffers at the appropriate moment.