Page 6 of 31

Re: Lexus GS450H VCU Support Thread

Posted: Sun Mar 22, 2020 10:54 pm
by Dilbert
I worked out that 47k should do the trick for mg1 and mg2, I’ve fitted them and updated the firmware.

Re: Lexus GS450H VCU Support Thread

Posted: Mon Mar 23, 2020 8:06 pm
by xp677
Great, how did they read? What is the firmware for them?

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 24, 2020 7:03 am
by Dilbert
This is the firmware I have written, I haven't had a chance to test it with the gearbox, so have just used fixed resistors plugged into the harness.

float vcc = 5.0;
float adc_step = 3.3/1023.0;
float Rtop = 47000.0;
float Ro = 47000;
float To = 25+273;
float B = 3500;

float readThermistor(int adc){


float raw = adc;
float voltage = raw*adc_step;

float Rt = (voltage * Rtop)/(vcc-voltage);

float temp = (1/(1.0/To + (1.0/B)*log(Rt/Ro)))-273;

return temp;
}

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 24, 2020 10:26 am
by xp677
That's great, many thanks.

How did you come up with the 47K value? I'm struggling with 8x thermistors in my project, all I have is their resistance at approx 15C. By looking at datasheets for various thermistors, and trying to work backwards from there, I came up with much different resistor values (249k for MG1 and 2 for example). Not sure where I went so wrong!

Are you able to do the same for the oil and trans sensors?

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 24, 2020 11:49 am
by Dilbert
I believe 47K is the nominal value of the thermistor for MG1 and MG2, based on what i observed @ 5C.

So i typically use a 47K pull up, but as we are pulling to 5V, when we have 25C we will get 2.5V into the ADC. As the temp rises we expect this voltage to fall.

I haven't looked at the oil temperature sensors yet.

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 24, 2020 6:38 pm
by Jack Bauer

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 24, 2020 9:50 pm
by Dilbert
Looks and sounds great!

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 24, 2020 9:53 pm
by Dilbert
xp677 wrote: Sun Mar 15, 2020 11:11 am
Dilbert wrote: Thu Mar 12, 2020 2:32 pm Is there an stl file or cad model available for this cover?
Not yet, still being prototyped. I've gone through 3 versions now, next one printing tomorrow, should be the final version (fingers crossed)
How did the print work out?

Re: Lexus GS450H VCU Support Thread

Posted: Wed Mar 25, 2020 4:37 am
by slow67
Great job again Damien!

Question, I noticed you still have it stuck in high gear. Have you confirmed the solenoid shift pattern for low gear? Is it both solenoids high instead of low? Also you may want to play with the pressure solenoid PWM (TransSP in the code). This should drop the line pressure during cruising, for less heat and more efficiency. From my experience with GM transmissions, the lower the duty cycle the higher the pressure (most likely the case here, as it isn't slipping). It also may wear out the pump being run at full pressure all the time. I know full pressure in GM Powerglide and TH400 transmissions will wear out a pump after about 10,000 miles of max line pressure (cruising miles, not racing).

Edit: It looks like pin PC18 isn't PWM capable, so I will have to use software PWM, but shouldn't be a big deal. FYI using the TransSP solenoid will only be needed for those who will be hooking a motor to the input shaft instead of locking it (and thus the mechanical pump will be spinning).

Re: Lexus GS450H VCU Support Thread

Posted: Wed Mar 25, 2020 8:52 pm
by Dilbert
Very impressive, I was wondering if there is any way to get a feel for how much voltage overhead the super yacht actually has?

For example, could similar performance be achieved at 320V etc.. I'm not sure if it is easy to measure, but maybe the dyno run would give an insight.

Re: Lexus GS450H VCU Support Thread

Posted: Wed Mar 25, 2020 10:39 pm
by xp677
Dilbert wrote: Tue Mar 24, 2020 9:53 pm
xp677 wrote: Sun Mar 15, 2020 11:11 am
Dilbert wrote: Thu Mar 12, 2020 2:32 pm Is there an stl file or cad model available for this cover?
Not yet, still being prototyped. I've gone through 3 versions now, next one printing tomorrow, should be the final version (fingers crossed)
How did the print work out?
Not bad, still a few areas to clearance on one part, I got it to fit with some grinding but went through the wall so need to rectify that.

The other part needs the o-ring cord recesses sorting - the supports are almost impossible to clean out. TBC.

Re: Lexus GS450H VCU Support Thread

Posted: Thu Mar 26, 2020 8:41 pm
by Kevin Sharpe
Dilbert wrote: Wed Mar 25, 2020 8:52 pm Very impressive, I was wondering if there is any way to get a feel for how much voltage overhead the super yacht actually has?
Even with the test battery dropping to 260V under load we experienced no drop off in performance when accelerating beyond 70mph. Damien has also undertaken some driving with a 230V battery (~180V under load?) and even with the torque limited to 33% the car was very spritely (see video below).

Our focus is now shifting to the long range pack installation (nominally 400V) and think it's time for other people to step up with GS450H builds that test the higher and lower battery voltage limits if they're interested 8-)


Re: Lexus GS450H VCU Support Thread

Posted: Thu Mar 26, 2020 9:20 pm
by Dilbert
That’s very interesting, I’ve been debating the whole Toyota use of the higher voltages for the hybrids. There must be some efficiency gain to be had at higher speeds in the hybrid configuration, higher voltages and lower currents. Also I know from the gen 3 Prius when power is required the engine really spins up.

Re: Lexus GS450H VCU Support Thread

Posted: Thu Mar 26, 2020 10:53 pm
by xp677
In hybrid use, MG1 especially has a high rpm. That's likely part of the reason for the higher voltage.

As much of the electrical power in the hybrid system is going between MG1 and 2, keeping currents to a minimum will minimize losses.

I failed my EMD module at uni, but it probably also affects wire size for the motor windings, allowing for a more compact motor.

Re: Lexus GS450H VCU Support Thread

Posted: Fri Mar 27, 2020 12:02 am
by Kevin Sharpe
People love to speculate but lets bring this thread back on topic and focus on Lexus GS450H VCU Support :)

Re: Lexus GS450H VCU Support Thread

Posted: Sat Mar 28, 2020 4:23 pm
by xp677
I'm currently revisiting my original code, not much to add, but one useful thing to add is to have the code recheck the inverter state (MTH byte 1). This has a number of states, the important ones are:

0b00000000 which is "not ready"
0b00001101 which is "boot"
0b00001100 which is "ready"

There are also various error codes available, bits 1 - 4 indicate the presence of the 4 motor current sensors.

Anyway, the importance of rechecking the state byte is to allow us a chance to re-send the setup data should the inverter go back to it's "not ready" state (in event of a power cycle, etc). I noticed this while testing - if I had my controller connected to a laptop for serial communication, then power cycling the car would not reinitialize the inverter, as the controller was kept awake by the USB port power.

For the VCU code which Damien has since made his own, the appropriate change is to change the line:

Code: Select all

if(!htm_sent&&inv_status==0){for(int i=0;i<80;i++)Serial1.write(htm_data[i]);}
to:

Code: Select all

if(!htm_sent&&inv_status==0){for(int i=0;i<80;i++)Serial1.write(htm_data[i]);if(mth_data[1]==0)inv_status=1;}
This way, when the inverter comes back online after power loss, the presence of a 0 in mth_stat[1] will reset the status flag, forcing another round of setup attempts.

My own code for this has forked a bit further, it now includes error code parsing for the various states which can then be sent over CAN, serial, whatever. But this is the main change which I think may benefit others. Implementing my other changes would need a more major code-rewrite, which may break other parts of Damiens code.

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 31, 2020 1:13 am
by slow67
Question........ I can't get MG1 to spin (forwards or backwards) independantly . MG2 spins just fine. Any Ideas? Position feedback works just fine. I hooked up MG1 to MG2's resolver and phase connections, it spun just fine.

I guess more specifically, is there any other diag information we can get from the mth/htm data?

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 31, 2020 6:54 pm
by xp677
You can get individual rpm and rotor position from the MTH data, I believe I had that integrated in the code that Damien used.

MG1 Speed (mth_data[6] | mth_data[7] << 8)
MG1 Speed (mth_data[31] | mth_data[32] << 8)

MG1 Position (mth_data[12] | mth_data[13] << 8)
MG2 Position (mth_data[37] | mth_data[38] << 8)

I was able to spin any combination of motors independently without issue. Maybe check your resolver wiring? Remember that MG1 spins in reverse so needs negative torque for "forwards".

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 31, 2020 10:16 pm
by slow67
xp677 wrote: Tue Mar 31, 2020 6:54 pm You can get individual rpm and rotor position from the MTH data, I believe I had that integrated in the code that Damien used.

MG1 Speed (mth_data[6] | mth_data[7] << 8)
MG1 Speed (mth_data[31] | mth_data[32] << 8)

MG1 Position (mth_data[12] | mth_data[13] << 8)
MG2 Position (mth_data[37] | mth_data[38] << 8)

I was able to spin any combination of motors independently without issue. Maybe check your resolver wiring? Remember that MG1 spins in reverse so needs negative torque for "forwards".
I was doubting resolver wiring, as position feedback reports perfectly. Later tonight or tomorrow Ill debug to make sure my variables are making it to the array. I zeroed out mg2_torque, and the ThrottleVal and mg1_torque was not making it spin either direction. Being junkyard parts I’m thinking that it may be hardware, but I want to troubleshoot further before returning the inverter.

Re: Lexus GS450H VCU Support Thread

Posted: Tue Mar 31, 2020 10:56 pm
by xp677
If position feedback is working correctly, then the code should spin the motor just fine. I'd double check you don't have something silly like sine and cosine swapped somewhere, this would give accurate feedback in the opposite direction.

If you're confident that the wiring is correct then I believe you. Unfortunately I can't offer any more info on the matter, but feel free to ask questions.

Re: Lexus GS450H VCU Support Thread

Posted: Thu Apr 02, 2020 6:44 pm
by slow67
xp677 wrote: Tue Mar 31, 2020 10:56 pm If position feedback is working correctly, then the code should spin the motor just fine. I'd double check you don't have something silly like sine and cosine swapped somewhere, this would give accurate feedback in the opposite direction.

If you're confident that the wiring is correct then I believe you. Unfortunately I can't offer any more info on the matter, but feel free to ask questions.

Thanks. Position feedback is working perfectly. MG1 never even tries to spin. I had the resolver plugs switched once, and MG2 just jumped around momentarily. I confirmed I'm writing ThrottleVal to htm 5&6, 11&12, 26&27, 32&33. And 4x ThrottleVal to htm 75&76. Just for giggles I wrote 0 to 75&76 with no change. I'm guessing this inverter is junk :?

Re: Lexus GS450H VCU Support Thread

Posted: Thu Apr 02, 2020 8:13 pm
by xp677
You're writing to [0] as well? I guess so since MG2 works:

htm_data[0] = (byte)((mth_data[31] | mth_data[32] << 8) + (mth_data[6] | mth_data[7] << 8)) /113;

Also note that you have to write negative torque to 5,6,11 and 12 for forward rotation. No idea if this motor works in reverse, I've never tried it, it may be locked out by the inverters logic.

Have you tried MG1's power and resolver into MG2's outlet? Have you metered the windings of MG1 and it's resolver?

The power stage of this unit is very well protected!

Verify that your mth data byte 1 is "12".

Re: Lexus GS450H VCU Support Thread

Posted: Thu Apr 02, 2020 8:46 pm
by slow67
xp677 wrote: Thu Apr 02, 2020 8:13 pm You're writing to [0] as well? I guess so since MG2 works:

htm_data[0] = (byte)((mth_data[31] | mth_data[32] << 8) + (mth_data[6] | mth_data[7] << 8)) /113;

Also note that you have to write negative torque to 5,6,11 and 12 for forward rotation. No idea if this motor works in reverse, I've never tried it, it may be locked out by the inverters logic.

Have you tried MG1's power and resolver into MG2's outlet? Have you metered the windings of MG1 and it's resolver?

The power stage of this unit is very well protected!

Verify that your mth data byte 1 is "12".
Ill check reverse again, but currently I have mg1/2 swapped so I can watch the output shaft. Ill check htm[0] to make sure Im writing the speedsum.

Re: Lexus GS450H VCU Support Thread

Posted: Thu Apr 02, 2020 10:21 pm
by xp677
Spinning MG1 only will spin the input shaft if neither are locked. If you lock the input shaft then spin only MG1 then I have no idea how that will react.

Re: Lexus GS450H VCU Support Thread

Posted: Thu Apr 02, 2020 11:26 pm
by slow67
Ok yes I'm sending htm_data[0] as well. It's sending (mg2_speed + mg1_speed)/113 (then convert to LSB).