Jump to content

Displaying the current stage number in automation?


Recommended Posts

image.thumb.png.7900c519e6a7d05f3703e4f583041d03.png

Could someone help me with the signal counter to display the current power stage of my system? As you can see there are four stages.

In terms of its behaviour, I think I have it figured out, but I'm having trouble transferring this into automation. What I was thinking is sending X green ticks depending on how many bits are green (four, three, two or just one, respectively for stage 4, 3, 2, 1), and resetting the counter if there's a negative/positive edge for either of the battery (stage has changed), and send the ticks corresponding to the stage again, so it would count them once more.

Link to comment
Share on other sites

@Tobruk

Signal switches represent the battery stages.

Buffers and filters set to 0.2 seconds each followed by XOR to identify rising and falling edge of each stage.

The rising/falling edge pulse resets the counter.

The pulse then drives buffers of 0.4 seconds each. NOT a pulse AND a buffered pulse creates another falling edge signal. The subsequent filter ensures we have some space between our falling edge pulses. Essentially this mess creates a set of 4 pulses, each 0.2 seconds in length and spaced 0.2 seconds apart.

AND each of those subsequent "stage pulses" with the stage itself. If a stage is present, then the counter will increase.

Tested and works. It takes 1.8 seconds to count up to the current stage. I cannot guarantee this will work correctly if the stage changes within this 1.8 seconds.

20200518203238_1.thumb.jpg.a40e9860e69d41fba4a92e686bcfafde.jpg

You may be able to speed this up; I do not know. There are probably also ways to simplify. I would be interested to see if anyone has any suggestions for improvement.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...