Lexus GS450H VCU Support Thread

Topics concerning the Toyota and Lexus inverter drop in boards
Locked
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Lexus GS450H VCU Support Thread

Post by Jack Bauer »

Funny thing is both of these features (regen and shifting) have been implemented by users of the vcu but not shared back with the community. Really makes me wonder just why the F I'm still at this ...
I'm going to need a hacksaw
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

Jack Bauer wrote: Mon May 10, 2021 7:05 am Funny thing is both of these features (regen and shifting) have been implemented by users of the vcu but not shared back with the community. Really makes me wonder just why the F I'm still at this ...
Oh! No shit? I had no idea that this was the case. That is really disheartening to hear. I hope those members who've sorted these important features out will step up and make these features available as contributions to the open-source project. Otherwise, yeah. What is the F'n point?!
Bryson
Posts: 179
Joined: Sat Jan 25, 2020 6:22 am
Location: California
Has thanked: 1 time
Been thanked: 4 times

Re: Lexus GS450H VCU Support Thread

Post by Bryson »

I just got my bench setup running with the intent of working on both of those before I swap out my existing drivetrain.

If anyone reading this is one of those folks who has some code as a starting point that you’re just too busy to post publicly, you can share with me directly, and I will publish for you. Worth a shot. :)
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

Bryson wrote: Mon May 10, 2021 3:08 pm I just got my bench setup running.... you can share with me directly.
Hey, this is not good. Please don't encourage privatization and siloing in an open-source ecosystem and community.

To any individuals who are making progress on the codebase of the GS450H Platform. Please work in a branch and commit your work to the repository. Once you've committed your work, please issue a Merge request so your code contributions can go through a peer-code review and be merged into the main branch of the repository. This is how open-source is supposed to work. If you are not familiar with GIT and how to commit and make pull / merge requests, then please hit me up. I will be happy to jump on a call and give you a crash course in how it all works!
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Lexus GS450H VCU Support Thread

Post by Dilbert »

Jack Bauer wrote: Mon May 10, 2021 7:05 am Funny thing is both of these features (regen and shifting) have been implemented by users of the vcu but not shared back with the community. Really makes me wonder just why the F I'm still at this ...
Yes i believe one of the users tested what i posted for the regen.

I would like to see a nice simple regen setup added to the base firmware and will do anything i can to help out in the process.

I would also like to see what can be done to simplify the configuration for new users, in a similar way to the sine firmware for the inverters, something basic that will get people up and running. I myself have struggled getting a motor to turn, so it would be nice to have a default basic set that would get it working with a couple of digital ins and throttle pot.

I think part of the problem is that people are developing for their own individual use cases, by adding on additional complexity etc... Where we need people to pool resources and make it as generic as possible. There should then be a structured way for people to layer on additional functionality to the base firmware for new vehicles etc....
MattsAwesomeStuff
Posts: 874
Joined: Fri Apr 26, 2019 5:40 pm
Has thanked: 280 times
Been thanked: 165 times

Re: Lexus GS450H VCU Support Thread

Post by MattsAwesomeStuff »

Jack Bauer wrote: Mon May 10, 2021 7:05 amReally makes me wonder just why the F I'm still at this ...
I think sometimes you judge a community by it's worst members. At least in terms of how it seems to kick your feet out from under you. Which is fair, I'd feel the same way, even if logically I know that it's not representative.

I don't mind stepping up to do a bit of shame-hustling (generally, I don't know the specifics in this case). The ol' standing on shoulders of giants speech. If you're gaining from someone else's efforts, you have a moral contract to contribute and share alike. It'll probably get met with either a "I intended to, when I had X working well enough" or a "I did this to get ahead of my competitors, and they will free ride on my investment too if I share it". Both semi-legitimate, but, still to be shamed for.
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

MattsAwesomeStuff wrote: Mon May 10, 2021 4:54 pm I don't mind stepping up to do a bit of shame-hustling
Man. I really wish there was a "MUTE" button for this guy.
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

Dilbert wrote: Mon May 10, 2021 4:47 pm Yes i believe one of the users tested what i posted for the regen.
I must have missed that! Please point me in the right direction and I will test it out and post my work to a branch in the repository for all to review and work off of. We have the GS450H installed in two chassis, and a third on the way.
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: Lexus GS450H VCU Support Thread

Post by Dilbert »

Bassmobile wrote: Mon May 10, 2021 5:04 pm
Dilbert wrote: Mon May 10, 2021 4:47 pm Yes i believe one of the users tested what i posted for the regen.
I must have missed that! Please point me in the right direction and I will test it out and post my work to a branch in the repository for all to review and work off of. We have the GS450H installed in two chassis, and a third on the way.
Perfect! It was over on the zombie inverter thread.

viewtopic.php?f=3&t=1277&p=25176&hilit=regen#p25176

Arturk tested it out. It will need some tuning for different vehicles, but i think we should have some very gentle default params.
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

Dilbert wrote: Mon May 10, 2021 5:16 pm
Bassmobile wrote: Mon May 10, 2021 5:04 pm
Dilbert wrote: Mon May 10, 2021 4:47 pm Yes i believe one of the users tested what i posted for the regen.
I must have missed that! Please point me in the right direction and I will test it out and post my work to a branch in the repository for all to review and work off of. We have the GS450H installed in two chassis, and a third on the way.
Perfect! It was over on the zombie inverter thread.

viewtopic.php?f=3&t=1277&p=25176&hilit=regen#p25176

Arturk tested it out. It will need some tuning for different vehicles, but i think we should have some very gentle default params.
Badass! Thank you for pointing this out to me. Will fork the repo and start working on regen code in a new branch and put in a PR when I get some results. Hopefully we can get this properly vetted and merged into the code quickly. Also, hope we can UP version control and GIT competency in this community. It is unfortunate that it hasn't been a priority. Also, it becomes really hard to have code blobs and communication split all over the place. I very much wish that the communication channels on Github were payed more attention to. If we don't utilize this, it is going to continuously be a PITA to do proper code tracking and versioning.

WiFi module update
Wemos_wifi_d1.jpeg
Got 50 more of these little adapter boards in for anyone that is struggling with weak wifi signal with the OLIMEX esp boards. Allows using the more robust WEMOS D1 type board. They are available for 10US (incl. shipping) in the USA, or 18US shipped to EU.
Bryson
Posts: 179
Joined: Sat Jan 25, 2020 6:22 am
Location: California
Has thanked: 1 time
Been thanked: 4 times

Re: Lexus GS450H VCU Support Thread

Post by Bryson »

Here's the regen code I've written so far today, which can be found in my github repo here: https://github.com/Bry5on/Lexus-GS450H- ... Controller

It works a little different than the one posted earlier. Mine is built for one pedal driving:
* Regen kicks in above |100rpm| (1.15mph in my car) and regen torque ramps up with speed
* Max regen is allowed from |1000rpm| (11.5mph in my car)
* 0-20% of pedal is regen up to 1/8 of max drive torque, above 1000rpm
* 25-100% of pedal is acceleration, above 1000rpm
* edit: I've made the dead zone a constant 5% instead of making accell always start at 25%
* Both MG1 and MG2 will command regenerative torque

I won't be able to test until I get a spare battery rig setup, as all I've got now is a power supply running mine through a camry inverter (GS450h inverter is on the way)

I'm still pretty new at sharing/contributing anything with github, so please let me know if there's improvement to be had.

Code: Select all

int ThrotRange=0; //total range between min throttle and max throttle
int RegenRange=0; //value within pedal travel where regen starts
int AccelMinRange=0; //value within pedal travel where acceleration starts
int MaxRegenTorque=0; //max regen torque at min throttle position

short get_torque()
{
  //accelerator pedal mapping to torque values here
  ThrotVal = analogRead(Throt1Pin);
  ThrotRange = parameters.Max_throttleVal - parameters.Min_throttleVal; //full range of min-max throttle
  //RegenRange = parameters.Min_throttleVal + (ThrotRange / 5); // regen for first 20% of pedal travel
  RegenRange = parameters.Min_throttleVal + map(abs(mg2_speed), 0, 1000, 0, (ThrotRange / 5)); // regen for first 0-20% of pedal travel, depending on speed
  AccelMinRange = RegenRange + (ThrotRange/20); // throttle begins at 5-25% pedal travel (5% dead zone) based on MG2 speed derived RegenRange
  MaxRegenTorque = parameters.Max_Drive_Torque / 8; // regen up to 12.5% forward torque (1/8) at min throttle position
  //if (ThrotVal<parameters.Min_throttleVal+10) ThrotVal=parameters.Min_throttleVal;//dead zone at start of throttle travel
 if(gear==DRIVE) {
  if(mg2_speed > 100){ //we're above our min speed to start regen
    if(ThrotVal < RegenRange) { //we're asking to regenerate
      ThrotVal = map(ThrotVal, parameters.Min_throttleVal, RegenRange, -MaxRegenTorque, 0); //map from max regen torque to 0 within regen range
      ThrotVal = map(mg2_speed, 100, 1000, 0, ThrotVal); //scale how much we want to ramp regen based on mg2 speed (100-1000rpm), now that ThrotVal is converted from pedal to torque
    }
    else if(ThrotVal > AccelMinRange){ //we're asking for forward torque
      ThrotVal = map(ThrotVal, AccelMinRange, parameters.Max_throttleVal, 0, parameters.Max_Drive_Torque); //map from 0 torque to max torque within forward torque range
    }
    else ThrotVal = 0; //we're in the pedal dead zone where we request 0 torque
  }
  else { //we're below our min regen speed, zero torque for first ~5% of pedal
    if (ThrotVal < AccelMinRange) ThrotVal = AccelMinRange; // if we're in the dead zone, don't request any torque
    ThrotVal = map(ThrotVal, AccelMinRange, parameters.Max_throttleVal, 0, parameters.Max_Drive_Torque);
  }
 }
 if(gear==REVERSE) {
  //ThrotVal = map(ThrotVal, parameters.Min_throttleVal, parameters.Max_throttleVal, 0, -parameters.Max_Reverse_Torque);
  if(mg2_speed < -100){ //we're above our min speed to start regen
    if(ThrotVal < RegenRange) { //we're asking to regenerate
      ThrotVal = map(ThrotVal, parameters.Min_throttleVal, RegenRange, MaxRegenTorque, 0); //map from max regen torque to 0 within regen range
      ThrotVal = map(mg2_speed, 100, 1000, 0, ThrotVal); //scale how much we want to ramp regen based on mg2 speed (100-1000rpm), now that ThrotVal is converted from pedal to torque
    }
    else if(ThrotVal > AccelMinRange){ //we're asking for forward torque
      ThrotVal = map(ThrotVal, AccelMinRange, parameters.Max_throttleVal, 0, -parameters.Max_Drive_Torque); //map from 0 torque to max torque within forward torque range
    }
    else ThrotVal = 0; //we're in the pedal dead zone where we request 0 torque
  }
  else {//we're below our min regen speed, zero torque for first ~5% of pedal
    if (ThrotVal < AccelMinRange) ThrotVal = AccelMinRange; // if we're in the dead zone, don't request any torque
    ThrotVal = map(ThrotVal, AccelMinRange, parameters.Max_throttleVal, 0, -parameters.Max_Drive_Torque);
  }
 }
 if(gear==NEUTRAL) ThrotVal = 0;//no torque in neutral
  return ThrotVal; //return torque
}
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

Bryson wrote: Thu May 13, 2021 11:38 pm Here's the regen code I've written so far today, which can be found in my github repo here: https://github.com/Bry5on/Lexus-GS450H- ... Controller

Bryson, awesome mate! I'll pull this code and test it out in the next day or two. As far as GIT goes, It would be good for you to be working on a branch. Name it whatever. You don't want to be working on the MASTER branch. Then you would want to initiate a PR (Pull Request) to get your code branch pulled into Damiens repo. Where it can be reviewed further and finally Merged into the Master. Does that make sense?
Bryson
Posts: 179
Joined: Sat Jan 25, 2020 6:22 am
Location: California
Has thanked: 1 time
Been thanked: 4 times

Re: Lexus GS450H VCU Support Thread

Post by Bryson »

I'll do some more reading on git, looks like I have much homework to do.
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

So it seems there is a lot of confusion about using CAMRY inverters for this platform. My assumption is that users who have failed to get good results with the inverter are using the G9200-33020, from a 2007-2011 Camry NAFTA vehicle. This is the inverter that is recommended at the time of this writing in the Wiki. This should probably removed form the wiki, so other don't end up wasting time and money on an inverter that won't work.

In 2012 they changed the NAFTA Camry inverter to G9200-33171
We have the G9200-33171 paired to a GS450H Drive unit. Have not had any issue, However, still just preliminary low-speed testing in the parking lot. Have not done on road / highway travel thus far, because we need a proper traction pack to power the platform.

It seems the information is lacking for this more proper inverter. So here we worked up an info graphic that should help users to connect the -33171 unit and get spinning to do some proper tests.
Connections_G9200-33171.png
Bryson
Posts: 179
Joined: Sat Jan 25, 2020 6:22 am
Location: California
Has thanked: 1 time
Been thanked: 4 times

Re: Lexus GS450H VCU Support Thread

Post by Bryson »

My Camry inverter is a G9201-33010, comms looks good, will give it a test once I've got the high voltage cables! Thanks my man
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 278 times
Been thanked: 64 times

Re: Lexus GS450H VCU Support Thread

Post by nkiernan »

I have a G9200-33030 Camry inverter. Runs the GS450H box in forward direction but stutters in reverse and stops. Just tested with bench test.
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

nkiernan wrote: Sun May 16, 2021 5:58 pm I have a G9200-33030 Camry inverter. Runs the GS450H box in forward direction but stutters in reverse and stops. Just tested with bench test.
I wonder if this could be an issue with misplaced conductors on the resolver? It would be possible to look up the diagrams and schematics on the conductors of that particular inverter application via the Toyota tech info portal, but you would need to know the details about the chassis that the inverter was removed from in order to get useful data.
nkiernan
Posts: 505
Joined: Mon Feb 24, 2020 8:59 pm
Location: Ireland
Has thanked: 278 times
Been thanked: 64 times

Re: Lexus GS450H VCU Support Thread

Post by nkiernan »

Bassmobile wrote: Mon May 17, 2021 8:02 pm


Myself and Arturk got the exact same results. Tried some variations on wiring but didn't fix it. I got sections of the harness and the plugs with the inverter which tied in wire colors etc with Arturks info on the Wiki, so we were confident wiring etc was correct. Also worked to make sure it wasn't interference on the wiring. swapping in a GS450H inverter into the same setup fixed the problem then, so does seem to be something around that Camry inverter
User avatar
Bassmobile
Posts: 94
Joined: Sat Apr 25, 2020 5:51 am
Location: USA
Has thanked: 7 times

Re: Lexus GS450H VCU Support Thread

Post by Bassmobile »

I've edited the GS450H WIKI to remove the misleading information about the Camry inverter, and make it more clear, that this is still an unknown.

There are numerous models of inverters in use in the Camry line. Since the Camry is a much wider application than the GS450H, there are a lot more variations. We need to make sure that when we are referring to these inverters, we use specifics, such as the G9xxx model numbers. For example @Arturk didn't specify what inverter he used on his most excellent info graphic. This is important information that should not be overlooked in order for us to be able to extrapolate what Camry units do and do not work.

edit: I guess there is not way to `@` somebody on this forum platform. If you see this Arturk, please chime in, and if you can amend your graphic with model numbers, that would be helpful also.
User avatar
PatrcioEV-ATX
Posts: 181
Joined: Sun Dec 13, 2020 5:25 pm
Location: Austin, TX, USA
Has thanked: 40 times
Been thanked: 53 times

Re: Lexus GS450H VCU Support Thread

Post by PatrcioEV-ATX »

Got my transmission spinning smoothly in both directions tonight. Only hiccup was remembering that the Inverter Power output from the VCU grounds a relay for power into the inverter rather than actually providing 12 volts directly. Once I figured that out, everything just turned on and worked exactly as designed. Damien, thanks so much for V3 and a preprogrammed WIFI module!

Fyi, I'm using a 12volt bench power supply into a fuse block for ignition on (at the moment) and a 60volt bench power supply into the inverter. BMW E46 pedal, 2007 L110 transmission, and the inverter number I'm using is a G9200-30061 (that came with the wire connector and about 7 inches of pigtail). I bought an entire engine wiring harness off eBay and am using all original connectors and wiring up to the inverter and VCU. That harness does NOT come with the connector to the inverter. Only special wiring I had to source was shielded 2 wire from inverter to VCU as it's not part of the engine harness. I'm also planning on using the VSS to provide input for a speedometer cable converter (doing a 64 Rambler Classic). I also have the gear position sensor wired and am running R and D from that directly to the VCU. Plan on using my car's column shift lever to manually change gears, which will allow me to use the parking pawl.

video at: https://www.instagram.com/electricrambler/
1998 Ford ZX2 - DC EV conversion(sold) http://evalbum.com/2093
2012 Nissan Leaf (sold)
2016 Mercedes B250e (sold)
2023 Volvo C40

Current: 1964 Rambler Classic 660 w/ GS450h set up. 36kwh Tesla batteries from B250e.
https://www.instagram.com/rambler_660e/
User avatar
PatrcioEV-ATX
Posts: 181
Joined: Sun Dec 13, 2020 5:25 pm
Location: Austin, TX, USA
Has thanked: 40 times
Been thanked: 53 times

Re: Lexus GS450H VCU Support Thread

Post by PatrcioEV-ATX »

I have a question about the different software versions. Version 7 has a defined Brake Input pin set to Input mode but I don't see where that is used in the code. Brake Input is not in version 3 and I don't have CAN in my car, so I won't use any of the BMW specific CAN code in version 7. Assuming the conversation above about coding for regen works out, could one repurpose Brake Input to Brake Output (and change pinmode to output) to serve as a trigger for the brake lights at a particular level of regen? The part I'm not sure about is how to measure the level of regen. I guess you could read negative amps through the shunt...
1998 Ford ZX2 - DC EV conversion(sold) http://evalbum.com/2093
2012 Nissan Leaf (sold)
2016 Mercedes B250e (sold)
2023 Volvo C40

Current: 1964 Rambler Classic 660 w/ GS450h set up. 36kwh Tesla batteries from B250e.
https://www.instagram.com/rambler_660e/
Bryson
Posts: 179
Joined: Sat Jan 25, 2020 6:22 am
Location: California
Has thanked: 1 time
Been thanked: 4 times

Re: Lexus GS450H VCU Support Thread

Post by Bryson »

I like that idea a lot, if that pin can be configured as an output, I can do this in my next software rev. Regen in the VCU is defined by commanded torque. Verification within the car (or VCU) would be negative current, correct.
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
xp677
Posts: 435
Joined: Sat Jul 27, 2019 10:53 am
Location: UK
Has thanked: 1 time
Been thanked: 13 times

Re: Lexus GS450H VCU Support Thread

Post by xp677 »

Jack Bauer wrote: Mon May 10, 2021 7:05 am Funny thing is both of these features (regen and shifting) have been implemented by users of the vcu but not shared back with the community. Really makes me wonder just why the F I'm still at this ...
As far as I'm aware, regen is just a case of sending negative torque values. This can be mapped against vehicle speed, so that the car only regens above certain speeds. But the most basic form would be something along the lines of

if (speed < x kph) map(pedal reading, pedal min, pedal max, 0, 3500);
else map (pedal reading, pedal min, pedal max, -500, 3500);

This could be expanded to become a full linear map of vehicle speed vs pedal mapping.

For my build, for now, I just map it between -500 and 3500 all the time, then have a line like this:

if(speed < 5 && torque < 0) torque =0;

As for shifting, I never got it to work. If someone has managed it and not shared it, that's a shame.
User avatar
arturk
Posts: 146
Joined: Wed Oct 02, 2019 3:58 am
Location: United States, MD
Has thanked: 1 time
Been thanked: 2 times

Re: Lexus GS450H VCU Support Thread

Post by arturk »

xp677 wrote: Fri May 28, 2021 7:31 pm As far as I'm aware, regen is just a case of sending negative torque values. This can be mapped against vehicle speed, so that the car only regens above certain speeds.
I can confirm it since I implemented it in my build and reported here:
viewtopic.php?p=25176#p25176

As far as code I posted key function, which is based loosely on Dilbert's code for ZombieVerter.
I use VCUv2 running highly customized version of Damien's v7 code.
Implementation was tested extensively in real road conditions and I am extremely happy with results.
There is more tweaking to be done to take full advantage of regen and achieve perfectly smooth operation. Also I need to add sensor to allow me to monitor amount of braking force requested as my car does not have brake pressure sensor.
1998 Jaguar XJR, GS450h drivetrain, 48kWh/96s BMW battery
Bryson
Posts: 179
Joined: Sat Jan 25, 2020 6:22 am
Location: California
Has thanked: 1 time
Been thanked: 4 times

Re: Lexus GS450H VCU Support Thread

Post by Bryson »

Alright, working regen has been demonstrated on the bench using the code posted in my github repo! A tip from someone who's done this before took me down a slightly different route. Right now it's hard coded to max drive torque of 3500 and max reverse torque of 1750. Next up is to scale the maximums to those set in the UI. Then I will send a pull request.

https://github.com/Bry5on/Lexus-GS450H- ... TestBranch

Regen demonstration:

Shifting gears from D-R and back while the motor is still spinning:
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
Locked