Precharge and Contactor Control  [SOLVED]

Introduction and miscellaneous that we haven't created categories for, yet
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Precharge and Contactor Control

Post by E46Driver »

Hi everyone. I am using a Leaf Gen 2 board, but I thought this might be more of a general question, so I dropped this in the General category. Firmware that shipped with the board was 5.14 and I have not changed it.

I am using the below pictured opto-isolated relay board between my contactors and the Openinverter Leaf adapter board. I was concerned about the continuous power draw from the contactor and did not want to damage the Openinverter outputs.

Contactors are both TE 2098190-1 with economizers. Precharge relay is a Panasonic AEV52012. Precharge resistor is TE 100 ohm chassis mount HSC100100RJ.

I've noticed a strange behaviour during bench testing and now while testing with low voltage (40V) in the car. When I turn on the ignition switch that powers the inverter and relay board ---- the positive contactor "pulses" on/off for a split second. Then the precharge relay turns on and the system waits until I apply the start signal. After which the precharge relay turns off and the positive contactor engages. So the overall function seems normal - except for that "pulse" when switched on. I also verified the pulse with a scope and no relay board - so its definitely something with the Openinverter control.

Why does the positive contactor "pulse" ? Is there a floating pin somewhere on my Openinverter board? I already tried a 5K pullup resistor on that pin, but it didn't work. I can't imagine the inverter capacitors liking the sudden jolt of 310V. Not to mention the contacts inside the contactor - which I've already read about people having those get welded shut! Do I need to test some kind of RC delay ciruit? Has anyone else seen this?

Comments/suggestions?
Attachments
Precharge.png
Relay Board.jpg
arber333
Posts: 3411
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 97 times
Been thanked: 297 times
Contact:

Re: Precharge and Contactor Control

Post by arber333 »

Yea all the time with my mazda inverter... check your uln2003 chip, maybe you can use its diode to keep relays from chattering.
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

Thanks for the quick reply arber333. That is very interesting. I do not have any chatter - just a single pulse. And only when ignition initially turned on. Very strange. I will keep trying to solve this before I wire full voltage.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Precharge and Contactor Control

Post by 900 »

E46Driver wrote: Tue Jun 07, 2022 10:18 pm I am using the below pictured opto-isolated relay board between my contactors and the Openinverter Leaf adapter board.
Hi, are those relays latching or can they be made latching? 😊
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

Hi 900, they are not latching. Are you thinking the response time of a latching relay is slower, so the signal "pulse" coming from the control board might not affect them? Or what other advantage would that have? Please elaborate.

My first reaction is that a latching relay would be an extremely bad idea. Any problem or issue with the control signals could leave the contactors permanently closed since the relay would be latched. Currently, simply cutting power will disconnect the contactors (unless, of course THEY fail and have welded contacts).
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Precharge and Contactor Control

Post by 900 »

E46Driver wrote: Wed Jun 08, 2022 1:52 pm My first reaction is that a latching relay would be an extremely bad idea. Any problem or issue with the control signals could leave the contactors permanently closed since the relay would be latched. Currently, simply cutting power will disconnect the contactors (unless, of course THEY fail and have welded contacts).
I am no expert by any means but use of latching relays was proposed by Arber. It depends on how you're going to drive the relays I guess, latching relay needs a single pulse and it remains closed until you cut the power to it. In my understanding losing power to contactors mid drive would kill the inverter so it's kind of a safety feature and latching relays would disengage when you remove power to them too. You can make a latching relay from a normal DPDT relay by looping ground to one of the normally open pins to the ground pin of the coil.
arber333
Posts: 3411
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 97 times
Been thanked: 297 times
Contact:

Re: Precharge and Contactor Control

Post by arber333 »

900 wrote: Wed Jun 08, 2022 2:12 pm
E46Driver wrote: Wed Jun 08, 2022 1:52 pm My first reaction is that a latching relay would be an extremely bad idea. Any problem or issue with the control signals could leave the contactors permanently closed since the relay would be latched. Currently, simply cutting power will disconnect the contactors (unless, of course THEY fail and have welded contacts).
I am no expert by any means but use of latching relays was proposed by Arber. It depends on how you're going to drive the relays I guess, latching relay needs a single pulse and it remains closed until you cut the power to it. In my understanding losing power to contactors mid drive would kill the inverter so it's kind of a safety feature and latching relays would disengage when you remove power to them too. You can make a latching relay from a normal DPDT relay by looping ground to one of the normally open pins to the ground pin of the coil.
To chime in here...
You could make those relays latching. You would just need to connect two relays according to drawing i made in the other thread. Be aware those relays are SPDT!
But i would again advise against it. If you consider they use transistors and optoelectronics which could be another point of failure in hot enviroment. Those are good for giving single pulse but prolonged ON use could weaken them...

I would advise use of similar relays with casing... You can use 12Vdc coil, but i would advise 24Vac coil. It works the same, but it dies not heat up like 12V does.
Two relays should be sufficient with one being precharge and other DC contactor relay. Last one turned into latching circuit.
https://www.newark.com/phoenix-contact/ ... din%20rail
https://www.amazon.com/Relay-Mount-4-Ch ... B07WYD15RY
https://export.rsdelivers.com/product/f ... nt/4572773
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Precharge and Contactor Control

Post by 900 »

arber333 wrote: Wed Jun 08, 2022 2:44 pm I would advise use of similar relays with casing...
So this little automotive 12V relay that I was going to turn into a latching relay and drive main contactor is no go then?
Attachments
20220608_181855.jpg
User avatar
johu
Site Admin
Posts: 6259
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 236 times
Been thanked: 1286 times
Contact:

Re: Precharge and Contactor Control

Post by johu »

I had similar behaviour when driving high impedance loads from the uln2003. In my case it was a P-channel mosfet and completely different software (stm32-car). Directly on power on I got like 0.5s pulse, after that everything operates normally. Except the contactor was then welded... when driving a relay coil directly, all is well. Needs research.
Can someone scope the chain? STM32 pin, uln pin, I'm out of lab for a while
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3411
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 97 times
Been thanked: 297 times
Contact:

Re: Precharge and Contactor Control

Post by arber333 »

900 wrote: Wed Jun 08, 2022 3:22 pm
arber333 wrote: Wed Jun 08, 2022 2:44 pm I would advise use of similar relays with casing...
So this little automotive 12V relay that I was going to turn into a latching relay and drive main contactor is no go then?
I put my answer back to DUE thread...
https://openinverter.org/forum/viewtopi ... 242#p41242
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

johu wrote: Thu Jun 09, 2022 4:12 am I had similar behaviour when driving high impedance loads from the uln2003. In my case it was a P-channel mosfet and completely different software (stm32-car). Directly on power on I got like 0.5s pulse, after that everything operates normally. Except the contactor was then welded... when driving a relay coil directly, all is well. Needs research.
Can someone scope the chain? STM32 pin, uln pin, I'm out of lab for a while
I am lucky to be testing with low voltage. Not surprised this led to a welded contactor if you had full pack voltage. It will be a couple of days before I can get back into the shop and dig out my digital scope. I feel like its a glitch with one of the chips - specifically under certain startup conditions. Perhaps something like a high impedance load as you suggest. Will continue to research and report back. Thanks for the responses and ideas, guys!
User avatar
joromy
Posts: 371
Joined: Fri Jun 28, 2019 12:56 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Precharge and Contactor Control

Post by joromy »

johu wrote: Thu Jun 09, 2022 4:12 am Can someone scope the chain? STM32 pin, uln pin, I'm out of lab for a while
I got the same problem with high impedance load.
Could be "crosstalk" but not sure?
A 10k pulldown worked for me.
Also very important to have 12V all time on COM of the ULN chip!!!

Measurements:
OUT_DCSW PC13 coming 3.3V 500mS pulse at powerup.
Reduced to 530mV with a 10k pulldown! (HIGH = 3.26V)
Thomas A. Edison “I have not failed. I've just found 10,000 ways that won't work"
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

Hey joromy, thats interesting. I tried both a 10K pulldown and pullup - but neither worked for me. However, I did that AFTER the ULN chip. Did you install an extra pulldown directly on pin13 BEFORE the ULN???

I have some Arduino development experience, but I am not familiar with the STM32 environment. One item I found in some research is regarding the actual point in the program flow where a pin is declared an output. These 2 articles suggest declaring the pin state BEFORE changing it to an output. I need to scope the pin as per johu's suggestion to see if its an actual signal problem.
https://community.st.com/s/question/0D5 ... er-startup
https://www.reddit.com/r/ECE/comments/8 ... i_want_it/

This phenomenon does not seem to be a problem with the precharge though. I see from the schematic its controlled from PB1 while DCSW is PC13. So is there a difference in their declaration? I will try make some sense of the source files - need more research.
User avatar
joromy
Posts: 371
Joined: Fri Jun 28, 2019 12:56 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Precharge and Contactor Control

Post by joromy »

E46Driver wrote: Mon Jun 13, 2022 3:11 am Hey joromy, thats interesting. I tried both a 10K pulldown and pullup - but neither worked for me. However, I did that AFTER the ULN chip.
You must put pulldown on the STM chip!!
And it's not pin13 is pin2.
Thomas A. Edison “I have not failed. I've just found 10,000 ways that won't work"
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

You must put pulldown on the STM chip!!
And it's not pin13 is pin2.
Got it - physical pin 2. GPIO PC13.



Is STM driving MOSFET directly? If so, 10K pulldown directly on pin 2 should solve this. I will try.

But doesn't STM have internal pulldown 30K already?

image.png
image.png (23.25 KiB) Viewed 27920 times
remy_martian
Posts: 47
Joined: Fri Mar 22, 2019 7:44 pm

Re: Precharge and Contactor Control

Post by remy_martian »

I think you need an antikickback diode on the Panasonic's coil. Cathode to + and anode to -. Rule of thumb is at least 6x the applied fed voltage as its rating.

The kick from it is likely messing up the economizer circuits of its little friends.
Friends don't let software friends do hardware design
User avatar
joromy
Posts: 371
Joined: Fri Jun 28, 2019 12:56 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Precharge and Contactor Control

Post by joromy »

E46Driver wrote: Mon Jun 13, 2022 2:17 pm But doesn't STM have internal pulldown 30K already?
Yes, don't know if that is enabled, but this is a mystery?
Thomas A. Edison “I have not failed. I've just found 10,000 ways that won't work"
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

remy_martian wrote: Tue Jun 14, 2022 6:12 am I think you need an antikickback diode on the Panasonic's coil. Cathode to + and anode to -. Rule of thumb is at least 6x the applied fed voltage as its rating.

The kick from it is likely messing up the economizer circuits of its little friends.
The pulse occurs before the precharge is engaged, so I don't think thats the cause. However, a flyback diode is a very good suggestion on any relay. And particularly in this case considering the potential for interference with the economizer.
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

Some scope shots with only the Leaf board powered. No other connections

1. Power up - Pin 2 on STM32
Pin2 Power Up.jpg
2. Power up - DCSW_OUT
OUT_DCSW_10ms.jpg
And faster time scale
OUT_DCSW_1ms.jpg
OK, for the most part, these look normal.

With the little relay board now connected. It is on the same 12V/Gnd connection as the Leaf board. PRE_OUT and DCSW_OUT are connected to the relay board.
1. Power up - Pin 2 on STM32 was the same as above
2. Power up - DCSW_OUT
OUT_DCSW Relay_500us.jpg
But now look at it with a negative trigger:
OUT_DCSW Relay_NEG_1ms.jpg
So what I came to realize is this:
  • Power is applied to the Leaf board and the relay board simultaneously.
  • OUT_DCSW is grounded before the STM32 boots up
  • The relay board responds almost instantly to the 12V power
  • The opto on the relay board sees the ground from OUT_DCSW for a split second before the STM32 finishes booting
  • The relay clicks on for approximately 2ms during the boot process - thus pulsing the main contactor
  • STM32 finishes booting and sets OUT_DCSW high, thus turning off the relay and corresponding contactor
So it would appear I need a delayed power circuit for my relay board. The logic control from the STM32 must be fully booted and running before the relays are allowed to switch state. Its possible this is all caused by the little relay board. When I manually connect power to the relay board AFTER the STM32 boots and turns on the precharge relay, everything works fine. And I think if the DCSW_OUT was connected directly to a 5V coil of a stand-alone relay, it might not respond fast enough to have this little glitch.
arber333
Posts: 3411
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 97 times
Been thanked: 297 times
Contact:

Re: Precharge and Contactor Control

Post by arber333 »

Hm... i think you could put one pullup resistor on each relay channel that would keep it off untill high enough signal would appear. Try experimenting with resistor values. I bet 1k pullup will do the job.

Or you can simply use 24Vac relay in a din housing.
User avatar
johu
Site Admin
Posts: 6259
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 236 times
Been thanked: 1286 times
Contact:

Re: Precharge and Contactor Control

Post by johu »

Thanks for scoping.

Do you have the newer Leaf board with Mini mainboard? Then you could add some significant capacity between gate and source of the corresponding mosfet. On the V3 mainboard version you could do the same modification as DC switch is also on a mosfet. Not sure about the value, maybe 10uF
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

arber333 wrote: Fri Jun 17, 2022 6:20 pm Hm... i think you could put one pullup resistor on each relay channel that would keep it off untill high enough signal would appear. Try experimenting with resistor values. I bet 1k pullup will do the job.

Or you can simply use 24Vac relay in a din housing.
I tried 10K and 5K. Never went as low as 1K.

Read your other post regarding the 24Vac - that might be a good way, especially if it doesn't overheat.
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

johu wrote: Sat Jun 18, 2022 9:36 am Thanks for scoping.

Do you have the newer Leaf board with Mini mainboard? Then you could add some significant capacity between gate and source of the corresponding mosfet. On the V3 mainboard version you could do the same modification as DC switch is also on a mosfet. Not sure about the value, maybe 10uF
I have the V3 board, not the mini.

Everything I've read about MOSFETS suggests keeping gate capacitance to a minimum and using high current drivers for high speed switching. Normally, this is in high power PWM applications. Which is not our case here - so perhaps it could work. But then I thought it would be good to have a current limiting resistor to prevent frying the gate. And then maybe a diode to prevent back-feeding to the STM pin. And then another high value bleed down resistor to drain the cap. So suddenly, there are alot of components to delay the gate drive.

I settled on this relay board for now. No mods to any control boards. And its easy to vary the delay timing in case I run into problems during the cold winter months. I'll see how it goes once I have everything wired and connected to HV. Currently I am finishing the mods to the Leaf inverter case so that I can fit it into the previous location occupied by my Soliton.
image.png
User avatar
Renegate2020
Posts: 52
Joined: Tue Dec 01, 2020 6:20 am
Location: Odessa UA
Has thanked: 1 time
Contact:

Re: Precharge and Contactor Control  [SOLVED]

Post by Renegate2020 »

I had a similar problem. I went the easy way - I bought a relay with a delay timer on Ali Express and installed it on the control output of the main contactor. Set a delay of 1 second. Now, when an impulse arrives, the relay simply does not turn on due to a delay.
User avatar
E46Driver
Posts: 33
Joined: Fri Sep 17, 2021 3:51 am
Location: Alberta
Has thanked: 2 times
Been thanked: 5 times

Re: Precharge and Contactor Control

Post by E46Driver »

Renegate2020 wrote: Thu Jun 23, 2022 7:18 pm I had a similar problem. I went the easy way - I bought a relay with a delay timer on Ali Express and installed it on the control output of the main contactor. Set a delay of 1 second. Now, when an impulse arrives, the relay simply does not turn on due to a delay.
Good to know! How long has your setup been running that way?
Post Reply