thiagoralves Show full post »
HKTarzan
For clarity and labels:
ZERO CPU.jpg  Motherboard.jpg 
Quote 0 0
vorrias
HKtarzan, you did actually the design I suggested four hours ago stated ...

"...Of course that idea may conflict with the length of the bus connector connecting the first I/O module. That must have linger pins to accommodate the extra height of the zero. (HKtarzan you can make hopus-copus there)..."

Can you put the internal bus and 40 pin connector the other way around? And probably make internal bus connector longer to plug correctly to I/Os
ZERO will have male pins attached

Quote 0 0
thiagoralves
HKTarzan wrote:

Next major question:
Any ideas on implementing the power fail to the ZERO on an implementation level???

Any body up to the task on the software side??


Leave that to me. I appreciate hjbleier's contribution with the Python script, but OpenPLC runtime already handles a lot of real-time tasks. It would be a no brainer to add an extra interrupt to look for power loss. I know that "real-time" and "interrupts" on Linux are not completely real, but I believe that OpenPLC runtime got close to what it should look like. In fact, my lab tests showed that OpenPLC running on a Pi had less jitter than a Siemens 1214C PLC. So I think we're pretty good.

For how long do you think a supercap can hold the Pi up? Maybe it won't be long enough to ensure a proper full shutdown, but it might be enough to stop all disk activity, which is what we are worried about. I'll do some research about how to quickly stop disk activity on Linux. If it loses power with no disk activity, then we don't need to shut it down.
Quote 0 0
HKTarzan

Thiago,

Good to know! ðŸ‘ Any of the GPIO pins will work for you?

As for the backup.... I've been pondering about the issue and solutions...
One is a super cap, but from what I've seen it seems as if we will need something sizable....
Vorias posted earlier for a Li Ion battery - but they are huge...
A Coin 3.6V cell on the 3.3V may be an option...
And - I was even considering just a plain mini USB plug on the front panel and use a standard 5V power bank....

Quote 0 0
vorrias
HKTarzan wrote:

Vorias posted earlier for a Li Ion battery - but they are huge...
A Coin 3.6V cell on the 3.3V may be an option.


If that is not regargable will drain very soon but LIPO batteries can be small and will do the trick. But we need a LIPO charger on board. Not a big issue. Like these in small drones. The whole circuit can be cheep build
Quote 0 0
thiagoralves
HKTarzan wrote:

A Coin 3.6V cell on the 3.3V may be an option...
And - I was even considering just a plain mini USB plug on the front panel and use a standard 5V power bank....


I don't think a coin cell can provide enough current for the Pi to run. Usually a Pi requires up to 300mA on the 3.3V rail depending on CPU activity, disk access, etc. Maybe a rechargeable 9V battery would work better. Those batteries can provide quite some current on the output. Ideally, the battery would be constantly charging while the PLC is on, and then once the power goes down, the battery takes over and initiates the shut down routine. With a 9V battery I'm pretty sure we can have even a few hours before it depletes, so we can totally afford to have a complete shutdown routine.

Quick research:
https://www.reddit.com/r/raspberry_pi/comments/56ng7a/how_long_would_a_9v_battery_power_a_pi0/

For a quick shutdown routine, we might even be able to use one of those:
https://www.adafruit.com/product/2750
I don't know if it is strong enough to power a Pi, but it is small and sexy =)
Quote 0 0
thiagoralves
Based on this ( https://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-power ) it seems that the Pi Zero consumes very little current when idle. Maybe the small LiPo battery from adafruit should be enough to power our Pi while it shuts down. We just need to make sure on the circuit that the battery is powering ONLY the Pi, and nothing else!
Quote 0 0
LeissKG
Based on this ( https://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-power ) it seems that the Pi Zero consumes very little current when idle. Maybe the small LiPo battery from adafruit should be enough to power our Pi while it shuts down. We just need to make sure on the circuit that the battery is powering ONLY the Pi, and nothing else!

According to a youtube video of Andreas Spiess

you need about two 10-15F caps in series for a save shutdown of a Pi Zero ( 300mA used ). If Supercaps work like Capacitors a 5F 6V like a VEC_6R0_505_QG
https://www.vina.co.kr/eng/product/hy-cap2-product.html
is all we need. That would be much better than a battery, but we would need to switch of all other loads.

Klaus Leiss
Quote 0 0
thiagoralves
This is awesome Klaus! I also think supercaps are much better than batteries, as they don't need any extra circuit to charge, no chemicals involved (think about heat on industrial environment) and are charged quickly. My only concern was how long the caps would hold power for the Pi to shutdown. It seems that these two caps in series can hold it for several seconds, which is definitely enough for the Pi to shutdown. Plus, his Pi took a very loooong time to realize that it was without power. We can do it much quicker with OpenPLC's real-time abilities and gain a few extra seconds.
Quote 0 0
vorrias
Based on this ( https://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-power ) it seems that the Pi Zero consumes very little current when idle. Maybe the small LiPo battery from adafruit should be enough to power our Pi while it shuts down. We just need to make sure on the circuit that the battery is powering ONLY the Pi, and nothing else!


Yes thiago I agree on that and just state it before here sever hours ago:

"...If that is not rechargeable will drain very soon but LIPO batteries can be small and will do the trick. But we need a LIPO charger on board. Not a big issue. Like these in small drones. The whole circuit can be cheep build.."

You may missed it.
Supercaps are sexy yes... but you need a lot of space for that kind of job (something we do not have here). Best practice is small LIPO battery with charger. As I post before ESP32 by WEMOS LOLIN32 has similar circuity

This "guy with Swish accent" is one of my favorites on you tube. Excellent video
Quote 0 0
vorrias
But Thiago if you still fancy the supercap idea (I also find it interesting and sexy) and 10 seconds are enough to do the job I think we can find space.
In my previews post here  https://openplc.discussion.community/post/openplcneo-9292586?pid=1305176887
I was talking the dimensions the PLC Box must have and what are the "industrial standards" if I may say.
As you can see making the box a multiple of 17.5 mm (a sigle pole braker) I was proposing a box 3x17.5 mm as the three phase circuit braker is.
On the other side the din rail box for Raspberry PI 3 that I have is 4x17.5mm. That means we can use that extra space to acommodate the supercaps if we use that dimention. Our final design will have the zero, the motherboard, one extraboard and space left for the 2 supercaps at the far left.
We can connect the supercaps with a cable and a connector to main board
Do you like that?
Quote 0 0
vorrias

Hi guys
I posted my first attempt to convert "OUTPUT open collector V1.0" to KiCAD V5. here:
https://openplc.discussion.community/post/digital-output-module-do001-8-x-open-collector-9670162?&trail=30
I am preparing some other staff as well

Quote 0 0
vorrias
@HKtarzan Hi.
1 - Can you tel me please if sheet with ATmega32U4-AU is the same for INPUT 1.0, INPUT 1.1, and OUTPUT 1.0?
The reason is that if the same I will use Klaus MPU sheet in Kicad. It is more cleaned up than mine.
At the end our kicad schematics must have the same annotation as yours so to use your PCB routing
2 - When you do the annotation what is the mode you use? I mean what sort order.
That is the kicad attached
Thanks 
Vasilis
Quote 0 0
HKTarzan

Vorrias,

The ATMega32U4-AU sheet of all 3 above schematic sheets are the same. It was done with using the same building block in mind
Annotation - manual....

Quote 0 0
vorrias
Thank you @HKtarzan
That is good news
In that case I will delete my MPU Kicad sheet and use Klaus sheet. I will annotate it manual to fit your annotation so Klaus can use the same for his Input 1.01 version.
So time will left for both of us to spend it in designing others things.
Vasilis
Quote 0 0