Arduino DUE VCU with analog and CAN control

arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Mon Jun 13, 2022 10:37 am Also what about these relays? Would they be suitable?
Yes, if you strip the plastic there is normal DPDT relay inside. And added benefit is you can easily mount it on a DIN rail.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Sun Jun 12, 2022 9:01 pm
arber333 wrote: Thu Jun 09, 2022 5:00 am My circuit for latching...
Dont forget you need to signal pulse 12V to this relay into a contact which will then be latched to 12V.
Meanwhile why I still don't have a 24vac relay I wanted to try this 12vdc automotive one. I wired everything according to your drawing just that I swapped polarity because I'm using Due with your shield to latch it by ULN2003. I connected HV+ contactor to permanent 12v and I'm supplying ground via relay by pin 87b. 87 is looped to ground of the coil. Now when due supplies ground to the coil the relay latches and turns on the contactor. The problem is I cannot unlatch it by removing +12v from the relay coil. The HV+ contactor stays on! What am I not seeing here? Where does the HV+ contactor get the ground from after I remove 12v from the relay coil?
That was exactly my point with DUE circuit. If you use my DUE board with 12V relay it should be used to only provide short 12V pulse to latch the relay.
12V steady supply should come from the key switch. So DUE would still be on but if you remove 12V from the key relay would drop out.

In Mazda conversion i even went farther. I used 12V signal from the START (last) position of the key, which is intermittent as you know. This was wired through the internal DC relay inside inverter. Its purpose was to provide clear path to start the DC contactor only in the case precharge would be performed. So when conditions are fulfilled latching relay recieves a pulse and locks the DC contactor in. To unlock it i turn the key back and thus remove 12V power from relay.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Mon Jun 13, 2022 1:45 pm That was exactly my point with DUE circuit. If you use my DUE board with 12V relay it should be used to only provide short 12V pulse to latch the relay.
12V steady supply should come from the key switch. So DUE would still be on but if you remove 12V from the key relay would drop out.
I didn't put a relay on your shield yet, I was using ULN2003 output to supply ground to the relay. Due only supplies a short pulse and relay (the one that you drew schematic for) latches. However when I remove power from the relay and also the due, the HV+ contactor stays on (it has permanent 12v wired to it and relay is supplying ground). Maybe a secondary latching circuit is developing somewhere? Anyway I think I will just use a DPDT relay instead. 😊
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Wed Jun 08, 2022 6:39 am If you want to use DUE to start latching relay that would be OK. So use 12V signal from DUE relay to latch your contactors.
Maybe I missunderstood how you're suggesting to do it. How would I take 12V signal from Due relay? I wired coil ground of my latching relay straight to ULN2003 outputs. It worked a few times now I have ground always on on some of ULN2003 pins when Due is off. This means the ULN2003 outputs failed? How do you drive ULN2003 outputs just by driving respected Due outputs HIGH? Maybe I made a mistake in my coding too as I noticed I had kept ULN2003 output HIGH all the time but then I fixed it. Could this have damaged the ULN?

EDIT: I have found that ULN2003 chip is 'leaking' ground through it's outputs. One of the pins (the relay one) is always connected to ground even if Due is off. The rest are leaking a little bit - not enough to turn on a contactor (can hear it trying to move a little) but enough to keep a contactor closed once the due drives ULN2003 pin LOW. Is that bad coding, maybe I need to define all of the ULN pins or change output to input if I want it totally off? Or ULN2003 is fauly? I was intending to drive precharge contactor and a latching relay for HV+ contactor directly. What are your thoughts?
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Sat Jun 18, 2022 1:06 pm
arber333 wrote: Wed Jun 08, 2022 6:39 am If you want to use DUE to start latching relay that would be OK. So use 12V signal from DUE relay to latch your contactors.
Maybe I missunderstood how you're suggesting to do it. How would I take 12V signal from Due relay? I wired coil ground of my latching relay straight to ULN2003 outputs. It worked a few times now I have ground always on on some of ULN2003 pins when Due is off. This means the ULN2003 outputs failed? How do you drive ULN2003 outputs just by driving respected Due outputs HIGH? Maybe I made a mistake in my coding too as I noticed I had kept ULN2003 output HIGH all the time but then I fixed it. Could this have damaged the ULN?

EDIT: I have found that ULN2003 chip is 'leaking' ground through it's outputs. One of the pins (the relay one) is always connected to ground even if Due is off. The rest are leaking a little bit - not enough to turn on a contactor (can hear it trying to move a little) but enough to keep a contactor closed once the due drives ULN2003 pin LOW. Is that bad coding, maybe I need to define all of the ULN pins or change output to input if I want it totally off? Or ULN2003 is fauly? I was intending to drive precharge contactor and a latching relay for HV+ contactor directly. What are your thoughts?
Uh... i dont think ULN2003 pin leaks to GND. It does have one common GND connection and one 12V connection. rest are NPN transistor inputs/outputs. You want to check if i designed a pulldown into one of the tracks. That would be to protect the pin from direct 12V signal from outside.
You could have overloaded ULN if you connected more load than 0.5A. But i dont think normal relay can pull so much.
But if you have a faulty ULN chip i suggest you replace it. It is not hard as it is a wide SO design.
For the time being you can use different pin to signal.

Try to draw a schematic so you can follow your logic when in action.
Like i said, DUE can be on permanent 12V power, but latching relay must not. However you choose to wire it you must have an option to remove power from relay when you turn the key off. You can use a single relay or three if you want.
I just take the power from the second key position, 12V for the fans and windows not the first position for radio and accessories which will dimm when you turn key to start position. This could be the precharge command to "enable" DUE input. Then when i apply START to another input pin of the DUE it can in turn provide 12V (via DUE relay) or GND to turn on your latching relay. When you dont want to latch contactor anymore you remove 12V power by the turn of the key.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Sat Jun 18, 2022 2:41 pm But if you have a faulty ULN chip i suggest you replace it.
Hi, I have replaced the ULN2003 chip and the situation has improved but I still have some issues. I decided to use the relay on your shield to drive the precharge contactor instead of connecting directly to ULN2003. It works, but for some reason every time I power the Due I hear that relay click but it does not seem to turn on the contacts. Why that might be? If it clicks it obviously is seeing some ground where it shouldn't. Or does it need a pulldown resistor somewhere?
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Sat Jun 18, 2022 2:41 pm Uh... i dont think ULN2003 pin leaks to GND.
Never thought controlling contactor is so difficult, been battling with this for a week now.. I think there is an issue with this ULN2003 chip - I've replaced it with brand new one it still seems to be leaking. If I wire my Due with your shield into my contactor box and then connect my 24VAC latching relay coils negative lead to the ULN2003 output pin that I programmed to drive it and when that pin is not being turned on - the 24VAC relay gives a tiny nudge - you can hear it and also see it, not enough power to latch it when testing on a bench, but in a car it turns on upon putting ignition on! And it turns on main contactor as soon as I put ignition on before precharge!

EDIT: Seems that one of the outputs of the ULN2003 chip has failed. So I reprogrammed to another output and it works again but it also doesn't. I have been powering my Due only with ignition - I don't keep it always on - don't need to at the moment. And it turns out upon power up Due shows around 130mV on the ULN2003 input pin for a second, this is enough to turn on the 24VAC latching relay and the main contactor at the same time. Same thing is happening with the little 12V relay on the shield upon powering the Due. Any way to prevent that? Surely a hundred miliamps should not trigger ULN2003 to open path to ground on it's output pin? Would a pulldown resistor fix the issue and where would I put it? Didn't you have similar issues when you had car shutting down on you in the middle of the drive? These sort of issues would also be worth fixing on your next gen shield.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Thu Jun 23, 2022 5:41 pm
arber333 wrote: Sat Jun 18, 2022 2:41 pm Uh... i dont think ULN2003 pin leaks to GND.
Never thought controlling contactor is so difficult, been battling with this for a week now.. I think there is an issue with this ULN2003 chip - I've replaced it with brand new one it still seems to be leaking. If I wire my Due with your shield into my contactor box and then connect my 24VAC latching relay coils negative lead to the ULN2003 output pin that I programmed to drive it and when that pin is not being turned on - the 24VAC relay gives a tiny nudge - you can hear it and also see it, not enough power to latch it when testing on a bench, but in a car it turns on upon putting ignition on! And it turns on main contactor as soon as I put ignition on before precharge!

EDIT: Seems that one of the outputs of the ULN2003 chip has failed. So I reprogrammed to another output and it works again but it also doesn't. I have been powering my Due only with ignition - I don't keep it always on - don't need to at the moment. And it turns out upon power up Due shows around 130mV on the ULN2003 input pin for a second, this is enough to turn on the 24VAC latching relay and the main contactor at the same time. Same thing is happening with the little 12V relay on the shield upon powering the Due. Any way to prevent that? Surely a hundred miliamps should not trigger ULN2003 to open path to ground on it's output pin? Would a pulldown resistor fix the issue and where would I put it? Didn't you have similar issues when you had car shutting down on you in the middle of the drive? These sort of issues would also be worth fixing on your next gen shield.
True! There seems to be something with Arduino DUE output pins. Some of them will pull up on start. I keep my DUE allways ON so i dont feel that much. Maybe you could add pulldown resistors like 10Kto negate disturbance on start?
That strange power out happens at random chance either at 60km/h or 130km/h. It is the reason i am researching other chips than DUE. But i will have to convert the code and i am a bit reluctant to do this since my pug "allmost works" the whole time.
Next iteration i am working on is with ESP32 chip. It is the only chip that i can reliably get here. Like the world suddenly ran out of SAM3x, Cortex and stm32 chips.

When researching this i came across some pwm pin designation on ESP32 and warning that they are active on startup. What if this is what happens? I will test ULN chip also on my DUE. I have a scope and i can capture screen...
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Thu Jun 23, 2022 8:53 pm Maybe you could add pulldown resistors like 10Kto negate disturbance on start?
I read a bit online about arduinos apparently a pulldown resistor on output pins is a must. So I've added 2x 10k resistors on the 2 Due output pins that drive my contactor relays and that seems to have mostly solved the problem of relays closing upon Due bootup. This is when I power up and power down the system cleanly with ignition. But if I say want to power down by removing wires with a little sparking I can see 24VAC relay chattering upon remowing wires. Transcient voltages? How could I also prevent that? Could I put a resistor on the relay itself? Just want to make sure my system is going to work under all circumstances and not weld my contactors.

I also have another problem with that Due. Previously when I only used it to send CAN messages it seemed to do this flawlesly. Now shield starts sending CAN only when I power it a second time. I have built a new shield and I skipped a lot of components. Could I have missed some of the resistors? Resistances on can lines are perfect 60 Ohms. I didn't solder any of R15, R16, R17, Jumper2 etc are these needed for CAN opperation? Other thing I can think of maybe CAN transcievers are kind of not working correctly.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Fri Jun 24, 2022 10:59 am
arber333 wrote: Thu Jun 23, 2022 8:53 pm Maybe you could add pulldown resistors like 10Kto negate disturbance on start?
I read a bit online about arduinos apparently a pulldown resistor on output pins is a must. So I've added 2x 10k resistors on the 2 Due output pins that drive my contactor relays and that seems to have mostly solved the problem of relays closing upon Due bootup. This is when I power up and power down the system cleanly with ignition. But if I say want to power down by removing wires with a little sparking I can see 24VAC relay chattering upon remowing wires. Transcient voltages? How could I also prevent that? Could I put a resistor on the relay itself? Just want to make sure my system is going to work under all circumstances and not weld my contactors.

I also have another problem with that Due. Previously when I only used it to send CAN messages it seemed to do this flawlesly. Now shield starts sending CAN only when I power it a second time. I have built a new shield and I skipped a lot of components. Could I have missed some of the resistors? Resistances on can lines are perfect 60 Ohms. I didn't solder any of R15, R16, R17, Jumper2 etc are these needed for CAN opperation? Other thing I can think of maybe CAN transcievers are kind of not working correctly.
Ok, glad you have solved the problem. I am thinking of fitting a resistor ladder to a Rev 4.2 of DUE board design.

For the second problem i can say i use DUE CAN bus in combination with another signal. For charging i use PP pin (gnd) which pulls down on one pin and signals EVSE has been connected. For drive i use Enable signal (12V via resistor divider) which starts the DCDC signal.
However there should also be another CAN signal which is connected to timer and preset to run at 30ms. I use this for 0x285 signal of Outlander components. It is just a continuous signal "i am alive".
Check the code if you put in some conditional that would cause CAN to pause...
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Fri Jun 24, 2022 1:26 pm Ok, glad you have solved the problem.
I thought I had solved it but the ULN2003 chip keeps failing for some reason.. So terribly unreliable. It works a few times and then fails. Now I have actual HV voltage there and when I turn ignition on ULN2003 output pin is open to ground the one that drives the little relay on your shield and which drives precharge resistor. It shows continuity to ground the ULN2003 pin that drives my latching relay too but so far latching relay does not turn on upon ignition - that still works properly and latches when I request it.
What can be happening with those ULN2003 chips? Do you have any ideas how to prevent it? Or can you think of any other more reliable solution bypassing the ULN2003 chip with your shield?
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Mon Jun 27, 2022 7:06 pm
I thought I had solved it but the ULN2003 chip keeps failing for some reason.. So terribly unreliable. It works a few times and then fails. Now I have actual HV voltage there and when I turn ignition on ULN2003 output pin is open to ground the one that drives the little relay on your shield and which drives precharge resistor. It shows continuity to ground the ULN2003 pin that drives my latching relay too but so far latching relay does not turn on upon ignition - that still works properly and latches when I request it.
What can be happening with those ULN2003 chips? Do you have any ideas how to prevent it? Or can you think of any other more reliable solution bypassing the ULN2003 chip with your shield?
ULN is darlington transistor array. That is allways leaking somewhat i think. But using 10K pulldowns on each line should resolve this...
Hm... you could add flyback diode across relay coil. Maybe the shock of discharging coil causes some damage to ULN chip.
Or you could connect two ULN pins (input and output) in parallel? But then you would need to cut the trace to the second DUE pin.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Mon Jun 27, 2022 7:18 pm ULN is darlington transistor array. That is allways leaking somewhat i think. But using 10K pulldowns on each line should resolve this...
I already have 2x 10k pulldowns on ULN2003 input pins(due pins). Should I also add a couple pulldowns to the ULN2003 output pins too?
arber333 wrote: Mon Jun 27, 2022 7:18 pm Hm... you could add flyback diode across relay coil. Maybe the shock of discharging coil causes some damage to ULN chip.
Or you could connect two ULN pins (input and output) in parallel? But then you would need to cut the trace to the second DUE pin.
Could you elaborate on this please? What type of diode and where exactly to put it? My main contactor latching relay is 24VAC and it might have a diode inside? So I may use one of those for precharge contacrtor too just won't make it latching.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Mon Jun 27, 2022 7:18 pm ULN is darlington transistor array. That is allways leaking somewhat i think. But using 10K pulldowns on each line should resolve this...
Hm... you could add flyback diode across relay coil. Maybe the shock of discharging coil causes some damage to ULN chip.
Or you could connect two ULN pins (input and output) in parallel? But then you would need to cut the trace to the second DUE pin.
I totally don't get it! I took it out from the car and brough it back on the bench with no HV wired and when I power it up there is no open to the ground on the ULN2003 pins anymore. Could the EMI radiation be messing things up here? How could I counter it?
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Tue Jun 28, 2022 8:39 am
I totally don't get it! I took it out from the car and brough it back on the bench with no HV wired and when I power it up there is no open to the ground on the ULN2003 pins anymore. Could the EMI radiation be messing things up here? How could I counter it?
Hm... can you disconnect pin 9 of ULN2003? I think it is top left pin which is connected to 12V. Maybe there is something amiss on 12V line.
This is common output for freewheeling diodes of each pin. In my DUE board i built in a resistor pad which can be unsoldered to disconnect 12V from the chip.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Tue Jun 28, 2022 8:59 am Hm... can you disconnect pin 9 of ULN2003? I think it is top left pin which is connected to 12V. Maybe there is something amiss on 12V line.
This is common output for freewheeling diodes of each pin. In my DUE board i built in a resistor pad which can be unsoldered to disconnect 12V from the chip.
I haven't got a C3 or C2 soldered to your shield, could this be an issue? What do these do? What values could I use?
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Tue Jun 28, 2022 9:50 am
I haven't got a C3 or C2 soldered to your shield, could this be an issue? What do these do? What values could I use?
In short, yes i think you need more capacitance to absorb voltage drops from transistor switching. Your 3V3 regulator on due could be starving when you try to switch ULN.
Either 100uf 16V elcap for C2 or 33uF tantalum for C3.
I suggest you go by 100uF elcap first to test. Then add 1uF ceramic to C3 to have some transient decoupling capacitance.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Tue Jun 28, 2022 10:39 am In short, yes i think you need more capacitance to absorb voltage drops from transistor switching. Your 3V3 regulator on due could be starving when you try to switch ULN.
Either 100uf 16V elcap for C2 or 33uF tantalum for C3.
I suggest you go by 100uF elcap first to test. Then add 1uF ceramic to C3 to have some transient decoupling capacitance.
I did a bit more testing and it looks to me that my multimeter just goes crazy in the presence of high voltage dc. When I try to measure continuity accross contactors it just freezes or shows continuity even after I totally remove power from precharge contactor.. It's only a cheap Uni-T. Seems like my circuit operates correctly just the multimeter is giving bogus readings..
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Tue Jun 28, 2022 12:01 pm
I did a bit more testing and it looks to me that my multimeter just goes crazy in the presence of high voltage dc. When I try to measure continuity accross contactors it just freezes or shows continuity even after I totally remove power from precharge contactor.. It's only a cheap Uni-T. Seems like my circuit operates correctly just the multimeter is giving bogus readings..
Dont use multimeter, use a scope to see if there is some pulse on the output side. In this case you should see 12V on the output pins of ULN when OFF. Of course you need 12V connected via relay. When ULN is ON it should pull this to GND. It could be that diodes inside ULN messed with your multimeter.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Mon Mar 21, 2022 6:10 am One glitch i discovered with DUE...
Its internal pullup resistors are a joke. I have noticed that during driving sometimes a PP sense pin i use with internal resistor drops from 3V3 and it signals as if EVSE would be plugged in. <...>
Immediate solution for me was to add external 10K resistor to +3V3 plain. This resolved the glitch and i havent had any incident since.
Is that still true Arber? This resistor mod reliably solved the problem because in your later post you expressed concern about this again. Asking as I want to use the shield and Due to also run a Tesla charger. In fact I have already tested it and it works in manual mode. CP and PP are still not populated. How do I need to populate the CP and PP components? Just populate all of them? Also the relay? Thanks 😊
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

evMacGyver wrote: Mon Jan 31, 2022 4:08 pm
Toms code on SimpBMS or at least TeslaBMSV2 does work quite nice for CP duty detection, just see the interrupt code. You need to change calculation polarity as shield board uses NPN or NFET for grounding IO pin. Additional optocoupler decade of 35ms needs to be removed.

Due pin D19 was routed to EEPROM /WC, same D19/RX1 is used for USART1 receive. I decided to pull EEPROM /WC pin up from PCB and ground pin by wire.
Hi, are you able to share how change calculation polarity and remove that optocoupler decade? I have no idea. I am using this shield in my Tesla gen3 charger, it works but only manually supplying AC voltage. Have not yet populated the CP or PP components.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Fri Jul 08, 2022 12:06 pm Is that still true Arber? This resistor mod reliably solved the problem because in your later post you expressed concern about this again. Asking as I want to use the shield and Due to also run a Tesla charger. In fact I have already tested it and it works in manual mode. CP and PP are still not populated. How do I need to populate the CP and PP components? Just populate all of them? Also the relay? Thanks 😊
Sorry, missed that post.
Yes my DUE works dilligently at the back. I tried to apply a watchdog to my code for brownout detection but that was not good. Sometimes PWM and CAN gets stuck in a loop...
You need that eeprom chip and its writeprotect pin!

I dont know about tesla gen3 charger, but my gen 2 requires CP signal directly. No other components on the line because it faults the evse reading.
I use PP signal to start my charging process and accessories, coolant pump...
So you if you need to populate you need:
CP
Diode and resistors 2k7 and 1k3. Then relay that pulls latter to gnd. I added transistor and supportive resistors so i would be able to read evse duty. Never needed that, you can omit it.
PP
It is pulled to gnd so you can just add one 10k resistor to 3V3 from the line.
BMS
This can be a positive 12V aux signal or pulled down GND.
In first case i provided resistor divider to scale down 14V
In second you need 10K pullup to 3V3.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Sun Jul 24, 2022 6:13 am Sorry, missed that post.
Yes my DUE works dilligently at the back. I tried to apply a watchdog to my code for brownout detection but that was not good. Sometimes PWM and CAN gets stuck in a loop...
You need that eeprom chip and its writeprotect pin!
Yes, Due and your shield is now controlling my precharge and main contactor, after I added 10k pulldowns to ULN2003 input pins and flyback diode to the relay it works well so far, happy with that. Never noticed any brownout (my car would fault out) but my code is rather simple and not very long.
arber333 wrote: Sun Jul 24, 2022 6:13 am I dont know about tesla gen3 charger, but my gen 2 requires CP signal directly. No other components on the line because it faults the evse reading.
I use PP signal to start my charging process and accessories, coolant pump...
Yes I want to connect PP and CP wires from a Type2 socket directly to your shield. It's my first time doing it so not yet sure how it works. Tesla gen2 and gen3 chargers are almost identical control wise. I've added 3 extra relays to ULN2003 outputs, each serve as enable and activate signals to each charger module. Charger works with mains power manually applied. Now I want to be able to use EVSE and charge ar public charging points.
arber333 wrote: Sun Jul 24, 2022 6:13 am CP
Diode and resistors 2k7 and 1k3. Then relay that pulls latter to gnd. I added transistor and supportive resistors so i would be able to read evse duty. Never needed that, you can omit it.
Do you mean the charger can read EVSE duty without the transistor and supportive resistors? Else how would the charger know how many amps it is allowed to draw? I want to use CP circuit on your shield with the arduino version of Tesla charger code that Tom wrote.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Arduino DUE VCU with analog and CAN control

Post by arber333 »

900 wrote: Sun Jul 24, 2022 9:12 am
Do you mean the charger can read EVSE duty without the transistor and supportive resistors? Else how would the charger know how many amps it is allowed to draw? I want to use CP circuit on your shield with the arduino version of Tesla charger code that Tom wrote.
Yes you need to connect cp pin and pp pin to correct LV pin of the charger and it will be able to provide as much power as evse would allow. I know the pinout for gen2, but i do not know gen3...
My intention now is just that. Replacing eltek chargers with single Tesla gen2 and connect it directly to charging port. DUE VCU i will use only to run pumps and relays and other support stuff...
Of course if you do that you cant use cp pin with due circuit. But it is still benificial to observe pp pin state as you can use its change of state to start some charging process within due. Just be careful not to connect 12v directly to DUE chip.
900
Posts: 55
Joined: Fri Jun 25, 2021 11:10 am

Re: Arduino DUE VCU with analog and CAN control

Post by 900 »

arber333 wrote: Sun Jul 24, 2022 11:57 am Yes you need to connect cp pin and pp pin to correct LV pin of the charger and it will be able to provide as much power as evse would allow. I know the pinout for gen2, but i do not know gen3...
My intention now is just that. Replacing eltek chargers with single Tesla gen2 and connect it directly to charging port. DUE VCU i will use only to run pumps and relays and other support stuff...
Of course if you do that you cant use cp pin with due circuit. But it is still benificial to observe pp pin state as you can use its change of state to start some charging process within due. Just be careful not to connect 12v directly to DUE chip.
Do you mean you will be connecting CP and PP to Damien's Tesla charger replacement board with STM32 chip? Before the STM32 version there was a version with SAM chip (same as on Due). So I am using the code written for that board but instead of that board I am using arduino due + your shield. So I need to make CP circuitry on your shield work with that version of the code. Why can't I use CP pin with the circuit on your shield?
Post Reply