Tobruk Posted May 18, 2020 Share Posted May 18, 2020 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 More sharing options...
Saturnus Posted May 18, 2020 Share Posted May 18, 2020 Maybe easier with a pixel pack? Link to comment Share on other sites More sharing options...
yoakenashi Posted May 19, 2020 Share Posted May 19, 2020 @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. 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 More sharing options...
Recommended Posts
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.