[DRIVING] VX220 with Tesla SDU

Tell us about the project you do with the open inverter
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: VX220 with Tesla SDU

Post by catphish »

espriev wrote: Sun Feb 05, 2023 2:11 am Is that pin 15 of the 20 way molex "brake light switch"?
Yes.
espriev wrote: Sun Feb 05, 2023 2:11 am I thought that was going to the brake light to illuminate it when regen hits, is there a signal for this?
No. Openinverter supports this feature, but the SDU has no pin for it.
espriev wrote: Sun Feb 05, 2023 2:11 am Is there a power down sequence? This possibility you mention of destroying the drive unit by turning it off at the wrong point is one of those "blow up the entire thing" things I hope to wrap my head around, it is turning off the "ignition" (+12 VDC to pin 13) while the motor is spinning that is the dangerous condition? As I understand it turning the system on is +12 to the relays and pin 13, then press "start" (pin 9 to +12). To turn off disconnect +12 to everything (after direction is "off" as in neither forward or reverse is selected? must that be the same to turn on?)
Lots of stupid questions, I know, but if it keep me from blowing it up...
Quite simply, it is dangerous to open the contactors while the motor is spinning or current is flowing through the motor. Normally your key switch will simultaneously open the contactors and remove power from the inverter (pin 13). That's absolutely fine, just don't do it when the car is moving, and ideally put it in neutral first to make 100% sure the inverter is not active.

Ideally, the shutdown sequence would be:
* Stop the car (we don't want the motor generating power)
* Put inverter into neutral (neither FWD not REV selected, this fully disables the inverter)
* Open the contactors
* Power down the inverter

However, I do the last 2 steps simultaneously, as I believe most people do. I've also turned the key off with the car in drive tens of times by accident without issue, but this *could* be a problem if you have certain features enabled like ampmin or hill hold.
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: VX220 with Tesla SDU

Post by EV_Builder »

Does this mean that electric cars can't be towed? Never realized that...
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
johu
Site Admin
Posts: 5769
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1011 times
Contact:

Re: VX220 with Tesla SDU

Post by johu »

They can be towed. A spinning rotor by itself isn't an issue. It's just if you open the connection to battery while the inverter is still switching that you may overvolt your transistors. Most especially when it happens during regen.

It also seems a bit of a speciality of the Tesla inverter. In my Polo I always opened the contactor on over current and I turned off and restarted into the running motor via key switch many times with no issue. It was 500V DC bus with 1200V IGBTs, so lots of margin.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
espriev
Posts: 44
Joined: Mon Jan 02, 2023 5:32 pm

Re: VX220 with Tesla SDU

Post by espriev »

Would it require a CAN interface to fire a relay in order to get an automatic Brake Light ON when regen is enabled?
Hmm, I wonder if there is a dedicated function CAN relay switching box available...
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: VX220 with Tesla SDU

Post by catphish »

EV_Builder wrote: Sun Feb 05, 2023 2:08 pm Does this mean that electric cars can't be towed? Never realized that...
Induction motors don't have any magnetic field unless you put current into them first. So a car with such a motor, like the Tesla model S, definitely can be towed. If the motor is completely demagnetized and you don't put any power into it, it's totally inert, you can spin it mechanically and no power will come out.

Permanent magnet motors are more tricky, because if you spin them, voltage *will* come out, and if you spin them fast enough, that voltage can get quite high. I assume OEM EVs have a way to disconnect them so that this isn't a problem though.

The following is pure speculation by me:

The problem with the Model S drive units comes when current *is* already flowing in the motor. If the contactors are opened, this current that's already flowing can't stop instantly (because of inductance, this flowing current stores a lot of energy in a magnetic field) and always has to go somewhere. The inverter will always allow that current to flow back into the DC bus capacitors even if it's off, but it's my understanding that the DC bus capacitors in the SDU are quite small, and if lots of current if flowing in the motor, when that energy returns to the capacitors, they will charge higher than the voltage the inverter can handle, and boom. If the motor is spinning at the time (which is very likely in this scenario), the mechanical energy being fed into the motor will worsen this effect, potentially pushing even more voltage into the capacitors.
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: VX220 with Tesla SDU

Post by catphish »

espriev wrote: Sun Feb 05, 2023 3:48 pm Would it require a CAN interface to fire a relay in order to get an automatic Brake Light ON when regen is enabled?
Hmm, I wonder if there is a dedicated function CAN relay switching box available...
I have no idea how you'd do this without designing separate hardware. An external device could certainly look at values like potnom to determine when to turn on the brake lights, but as far as I know, you'd have to design this yourself.
User avatar
johu
Site Admin
Posts: 5769
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1011 times
Contact:

Re: VX220 with Tesla SDU

Post by johu »

Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
espriev
Posts: 44
Joined: Mon Jan 02, 2023 5:32 pm

Re: VX220 with Tesla SDU

Post by espriev »

Yes!
The CANNY boards seem perfect
cannylogic.com
espriev
Posts: 44
Joined: Mon Jan 02, 2023 5:32 pm

Re: VX220 with Tesla SDU

Post by espriev »

Am I correct that the BRAKE SIGNAL (pin 10) is the Regen control input? Does it operate opposite of the THROTTLE signal (as in +5V = no regen & +5v = full throttle)?
What does the BRAKE LIGHT SWITCH (pin 15) do? Is it just informing the O/I board that the brake pedal has been pressed?
Does this going high enable regen as well?
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: VX220 with Tesla SDU

Post by catphish »

espriev wrote: Tue Feb 07, 2023 5:16 pm Am I correct that the BRAKE SIGNAL (pin 10) is the Regen control input? Does it operate opposite of the THROTTLE signal (as in +5V = no regen & +5v = full throttle)?
What does the BRAKE LIGHT SWITCH (pin 15) do? Is it just informing the O/I board that the brake pedal has been pressed?
Does this going high enable regen as well?
I've just had a look at the source code and the answer to this question isn't as simple as I'd hoped, but I'll try to go through and explain the details of how these two inputs interact.

The story begins with BRAKE LIGHT SWITCH (pin 15):
0v = Maximum allowed regen is set to the value of "offthrotregen"
12V = Maximum allowed regen is set to the value of "brakeregen"

Next, we look at BRAKE SIGNAL (pin 10), this input scales the regen down according to its analog input:
0v = Maximum regen reduced to zero
1.65v = Maximum regen reduced by 50%
3.3V+ = Max regen unaffected, ie 100% regen is allowed
BRAKE SIGNAL NOT ENABLED = Max regen unaffected, ie 100% regen is allowed

Next, we go back to BRAKE LIGHT SWITCH (pin 15):
0V = Skip to next step and look at the throttle pedal
12V = Ignore throttle pedal (assume it's 0V) and apply all regen (as selected and scaled in previous steps)

Finally, we look at the *throttle* pedal:
0V = 100% of the regen calculated in previous steps
3.3V+ = 100% acceleration
Values in between can be anything from 100% regen to 100% acceleration. The curve is controlled by "regentravel".

So... to sumarize, when you press the BRAKE LIGHT SWITCH, you get "brakeregen", and then you don't, you get "offthrotregen". Both are scaled by BRAKE SIGNAL if you have it, and BRAKE LIGHT SWITCH causes the throttle input to be ignored.

It's worth noting that this whole process makes a lot of sense if you imagine that BRAKE SIGNAL is a pressure sensor on the brake line and BRAKE LIGHT SWITCH is a microswitch on the brake pedal.
User avatar
andybpowell
Posts: 290
Joined: Thu Sep 02, 2021 8:04 pm
Location: Southend,essex,uk
Has thanked: 192 times
Been thanked: 224 times
Contact:

Re: VX220 with Tesla SDU

Post by andybpowell »

Any news /updates from the DVLA yet ?
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: VX220 with Tesla SDU

Post by catphish »

andybpowell wrote: Sat Feb 11, 2023 8:41 pm Any news /updates from the DVLA yet ?
I informed the DVLA of my conversion. They inspected it in August to confirm there were no chassis modifications. Because the car is post-2001 they didn't make any changes to the V5. So all a bit of a waste of time, but at least 100% legal.
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: VX220 with Tesla SDU

Post by catphish »

The last 3 weeks I've been rather consumed with testing improvements to the induction motor firmware and this car has been the guinea pig! With my new current control firmware, things are much smoother and more responsive, and I'm very happy with the way it drives, but no regen for now.

Last week I also bought a duplicate OEM gauge cluster:
327964901_1116956238982272_4062298424620025898_n.jpg
My plan is to try to modify it to display motor current in place of RPM, and display voltages and temperatures on the LCD. I didn't want to risk breaking my existing cluster, as it currently displays MPH correctly, which is rather important :)
User avatar
andybpowell
Posts: 290
Joined: Thu Sep 02, 2021 8:04 pm
Location: Southend,essex,uk
Has thanked: 192 times
Been thanked: 224 times
Contact:

Re: VX220 with Tesla SDU

Post by andybpowell »

I was considering a similar thing there are some round tft displays available but limited sizes and lacking any real information I think I'll hold off for now
:)
jonbowes
Posts: 4
Joined: Wed Apr 05, 2023 12:59 pm
Been thanked: 4 times

Re: VX220 with Tesla SDU

Post by jonbowes »

Hello catphish,

Like the project looking a lot like the one I have just started with Lotus Elise S1...

I was wondering if you thought about putting battery cells in the petrol tank bay between seats and motor. And if you didn't why not? I am thinking I will replace the tank with batteries in that space. I don't consider that as a chassis mod as the sheer plate will be left as-is, that is structural part of chassis.

I am also considering moving part of the non-structural bulkhead between engine bay and passenger compartment forward towards the back of the seats above the fuel tank bay to give more space for batteries. This part isn't metal in the Elise as far as I can tell, will need to remove some heat shielding to be certain. The chassis only goes up to the top of the fuel tank bay then the roll bar kicks in to give structure above that point.

My other thought is that I am planning on keeping the clutch pedal. I plan on using this as a graduated regen pedal. When released no or little regen graduated to high regen at fully depressed position. Almost a regen brake pedal next to the physical brake pedal to use with left foot in co-ordination with the accelerator pedal. Thoughts? Am I mad?

Cheers

Jon
User avatar
catphish
Posts: 955
Joined: Fri Oct 08, 2021 11:02 pm
Location: Dorset, UK
Has thanked: 94 times
Been thanked: 179 times

Re: VX220 with Tesla SDU

Post by catphish »

jonbowes wrote: Wed May 10, 2023 5:53 pm I was wondering if you thought about putting battery cells in the petrol tank bay between seats and motor. And if you didn't why not? I am thinking I will replace the tank with batteries in that space. I don't consider that as a chassis mod as the sheer plate will be left as-is, that is structural part of chassis.
I would have liked to put the cells in the fuel tank space. It's 100% the best place in terms of weight distribution. The reason I didn't is simply because the space is an awkward triangular shape. I had some batteries in mind that I wanted to use for the conversion and they didn't fit in the space, so I had to abandon the idea. A custom pack made into the shape of the original fuel tank would be the ideal, but that was too much effort and risk for my project. Also be sure to consider what mounting points will be available to hold the considerable weight of the pack down there. It would be great if you can do it!
jonbowes wrote: Wed May 10, 2023 5:53 pm I am also considering moving part of the non-structural bulkhead between engine bay and passenger compartment forward towards the back of the seats above the fuel tank bay to give more space for batteries. This part isn't metal in the Elise as far as I can tell, will need to remove some heat shielding to be certain. The chassis only goes up to the top of the fuel tank bay then the roll bar kicks in to give structure above that point.
If I remember it's just aluminium sheet there. I was aiming to avoid such a substantially destructive change to my car, but if you're serious about mounting the batteries low down, this sounds like a reasonable option.
jonbowes wrote: Wed May 10, 2023 5:53 pm My other thought is that I am planning on keeping the clutch pedal. I plan on using this as a graduated regen pedal. When released no or little regen graduated to high regen at fully depressed position. Almost a regen brake pedal next to the physical brake pedal to use with left foot in co-ordination with the accelerator pedal. Thoughts? Am I mad?
Firstly, I'm not a fan of regen overall, in part because I never got it to work well with openinverter, and ultimately removed it from my fork because it just didn't feel right and wasn't worth the hassle of trying to make it work properly. Secondly, I would absolutely not create a regen pedal, only because to me it feels dangerous to have a brake pedal that *isn't* the brake pedal. Muscle memory could be fatal there, but that's up to you to experiment with :)
jonbowes
Posts: 4
Joined: Wed Apr 05, 2023 12:59 pm
Been thanked: 4 times

Re: VX220 with Tesla SDU

Post by jonbowes »

Hi catphish,

Thanks for the input.

I was worried you had some show stopper reason for not using the fuel tank bay, good to hear that isn't so. Aiming for larger pack so will need all the space I can muster.

I had the same reservations regarding regen pedal, also considered reversing it so it worked more like a clutch with lowest/zero regen in fully depressed position graduated to full regen when released. Note regen is still controlled by the accelerator pedal (one foot driving style) the regen pedal ONLY sets the regen strength which can be mapped as required when in one foot driving mode. I think the muscle memory might be less of a problem with some time learning the controls and without gears to change would you try and use the left most pedal like a clutch? Definitely will approach this subject with care.

My control logic will use a 3D map of motor RPM, accelerator pedal position and regen pedal position to derive torque demand. I think I will do some controlled experimentation when I get it together.

Cheers

Jon
Post Reply