Gate Valve CPU load

A forum for discussion on the software for the WMT River Control System
Post Reply
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Gate Valve CPU load

Post by hamishmb »

Terry,

I have recently observed that the gate valve code causes very high CPU usage in my VMs after a position is requested. I suspect this is simply because there is no valve to move, and the simulation doesn't include moving the valve so it probably just gets stuck trying to move it.

However, for the sake of caution and sanity, have you experienced high CPU load with the code on either the master branch or the use-database branch after the gate valve moves? (both use exactly the same code here)

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

Re: Gate Valve CPU load

Post by TerryJC »

Hamish,

I can't say that I've ever monitored it, but it only takes about 1 second or so to move the valve from 0% to 100% or vice versa, so I've never even considered it. The CPU will be working pretty hard during that time because it is reading the A/D and calculating the position in a freely running loop. Notwithstanding very small delays in the I2C Bus, etc, it will try to go as fast as it can. Once the demanded position has been achieved, the loop is confined by a 1 second delay between readings.

Do you think we need to check the CPU Load during position changes?
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Gate Valve CPU load

Post by hamishmb »

That's fair. Yes, during position changes it's going as fast as it can, so load will be high, but I was asking something slightly different:

In my case it's just that as soon as any non-zero position is asked for, load is 100% and never goes back down, even if 0% open is requested again. Just wanted to check this doesn't happen on the real hardware.

During position changes load will be very high, but these pis essentially only have one job, so I don't think it's a problem :)
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Gate Valve CPU load

Post by TerryJC »

The most recent set of logs for V4 Gate Valve show typical CPU usage at between 7 and 13%. I did find several records of usage at up to 100% but these subsided in a few seconds.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Gate Valve CPU load

Post by hamishmb »

Okay, looks like a non-issue then. Cheers! :)
Hamish
Post Reply