The ZombieVerter VCU Project
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Dilbert, No I don't think so. The control loop would be designed to see some resistance from the car and as we had no regen dialed in it just kept spinning would be my guess.
Jon, Yes ota works but you need a specific bootloader for the 105 and a specific wifi firmware also. Will pop them up later today.
Jon, Yes ota works but you need a specific bootloader for the 105 and a specific wifi firmware also. Will pop them up later today.
I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
Ok so over speed like that wouldn't be unusual for one of these motors, so we need to command a negative torque to bring it back to rest on the bench, rather than zero torque, provided we can take back current. OK so maybe we should look at decoding more of the MTH return data and maybe get the RPM indicator working on the ECU, so we can see the real speed. I've been looking at the mth data, bytes 38-39 and 40-41 appear to be MG2 speed if we want to map either of them back for monitoring.Jack Bauer wrote: ↑Mon Feb 01, 2021 8:08 am Dilbert, No I don't think so. The control loop would be designed to see some resistance from the car and as we had no regen dialed in it just kept spinning would be my guess.
Jon, Yes ota works but you need a specific bootloader for the 105 and a specific wifi firmware also. Will pop them up later today.
I've been looking at the 4 torque values being sent for MG2 and trying to understand what toyota are doing. When no accelerator is added and no brake applied they seem to be running a closed-loop speed control to get the car to creep. They just give it enough torque to start rolling and then back it off to maintain (in each direction).
I've been considering how to implement regen on this transaxle/inverter. I could log some more HTM data during a proper drive cycle, so we can see are they setting a negative torque when zero throttle is applied. I guess that feeds into the creep algorithm, such that they will apply a negative torque till the speed drops and then the creep will kick in and make it positive again. i could do the same test with the "engine" braking mode set too, so we should have higher regen levels.
It would be nice if the VCU could implement a regen function for these inverters.
Re: The ZombieVerter VCU Project
I guess the algorithm, would look something like this:-
When the throttle is at zero position, run a PI controller to generate the torque value and bring the motor speed to +X rpm (assuming car is in forward, else -). This controller would only have a small torque range it could apply (depending on the regen level). Then when the throttle not at zero we just use that value directly. I would probably run a ramp on the torque demand, so it can change by more than Y every cycle, this should give a smooth transfer between the PI controller and throttle pedal..
When the throttle is at zero position, run a PI controller to generate the torque value and bring the motor speed to +X rpm (assuming car is in forward, else -). This controller would only have a small torque range it could apply (depending on the regen level). Then when the throttle not at zero we just use that value directly. I would probably run a ramp on the torque demand, so it can change by more than Y every cycle, this should give a smooth transfer between the PI controller and throttle pedal..
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Yeah that makes sense. I'm gonna run some more tests this morning just with the stupid power supply. At least we know the issue with mg2 hunting was just the power supply hitting a limit.
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Yep we have mg2 rpm in bytes 38 and 39.
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
So we can now run mg1 and mg2 together or on their own in forward or reverse. Brilliant work on this Dilbert:)
I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
The voltages seem to be in 100-101 and 102-103. Scaling is -5 and divide by 2. The graph looks great.
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Very good. I will probably be a day or two before i get a chance to grab more data from the vehicle and work out the regen etc..
It would be interesting to get a regen scheme working for this and then use it for the Lexus and possibly others. I guess the question is if this regen scheme should live at a higher level in the controller rather than down at this level with the comms etc...
The other interesting thing would be to see if this will work with a Gen2 transaxle.
It would be interesting to get a regen scheme working for this and then use it for the Lexus and possibly others. I guess the question is if this regen scheme should live at a higher level in the controller rather than down at this level with the comms etc...
The other interesting thing would be to see if this will work with a Gen2 transaxle.
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
I like the idea of the regen module being at a higher level but I'm not exactly capable of writing it:) Yeah I've been mulling over some possible combos also of inverter and transaxle/motor. Sadly I don't have a gen2 transaxle anymore. I do have an is300h and rav4 inverter here so just for laughs might wire them up and see what they do if I get the chance.
edit : the gen3 inverter seems to not care about whether its running one or two motors or if the resolver is disconnected etc. So in theory if the resolver poles and motor poles match it would spin up.
edit : the gen3 inverter seems to not care about whether its running one or two motors or if the resolver is disconnected etc. So in theory if the resolver poles and motor poles match it would spin up.
I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
I think we can come up with a higher level flow diagram that might also work for other units such as the leaf etc, as we are just commanding torque. I wonder how this is handled in the SINE / FOC firmware? i presume there is some stuff in there. It is mainly to improve driveability and make the car creep etc...
If we ignore making the vehicle creep for now, we could do a simple algorithm for regen torque based on motor speed and forward/reverse. I think on some hybrids/evs they try to mimic engine braking. This would need to be tweaked for each vehicle slightly.
I wonder could we just do stepped regen levels when the throttle is zero, based on the brake input.
Yes, i was surprised it ran one with the other disconnected, which means to me that the inverter sees these as separate independent units, and the data which gets transferred is probably separate too. If i do a proper drive to capture data (on both streams), we might be able to figure out the boost converter.
I have a gen 2 transaxle so would like to try one of these Gen3 inverters with it. Does anyone know of any breakers in Ireland that have one? i wouldn't mind buying one and trying it.
If we ignore making the vehicle creep for now, we could do a simple algorithm for regen torque based on motor speed and forward/reverse. I think on some hybrids/evs they try to mimic engine braking. This would need to be tweaked for each vehicle slightly.
I wonder could we just do stepped regen levels when the throttle is zero, based on the brake input.
Yes, i was surprised it ran one with the other disconnected, which means to me that the inverter sees these as separate independent units, and the data which gets transferred is probably separate too. If i do a proper drive to capture data (on both streams), we might be able to figure out the boost converter.
I have a gen 2 transaxle so would like to try one of these Gen3 inverters with it. Does anyone know of any breakers in Ireland that have one? i wouldn't mind buying one and trying it.
Re: The ZombieVerter VCU Project
Bytes 55-56 in the MTH data look interesting (power in watts?)
- Attachments
-
- mth55-56.png (11.4 KiB) Viewed 5044 times
Re: The ZombieVerter VCU Project
Ahhh, that makes sense. I see some memory address stuff that needs to change. Ill try bludgeoning my way through some changes in an effort to better understand the stuff and use whatever posted as a fall back in case of failureJack Bauer wrote: ↑Mon Feb 01, 2021 8:08 am Jon, Yes ota works but you need a specific bootloader for the 105 and a specific wifi firmware also. Will pop them up later today.

Formerly 92 E30 BMW Cabrio with Tesla power
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: The ZombieVerter VCU Project
The Leaf inverter will coast to stop if you give zero torque below certain rpm, but at higher rpm it will maintain speed given zero torque command and no external load to the motor. Does the Toyota stuff do the same or does it maintain even, say, 60 rpm?
It's nice to be able to cut off the tiny amount of regen for bench testing and gear changes well before stopping. My Leaf control code certainly takes advantage of it. Would be difficult to close in on exactly 0rpm even with a PID controller.
It's nice to be able to cut off the tiny amount of regen for bench testing and gear changes well before stopping. My Leaf control code certainly takes advantage of it. Would be difficult to close in on exactly 0rpm even with a PID controller.
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Seems to only want to keep running at higher rpms
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Might something like this get us some regen braking:-
s32fp utils::CalcRegen( int16_t throttle, int16_t motor_speed, int16_t brake){
int16_t torque;
if(throttle > 0){
//let the throttle set the torque directly
torque = throttle; // add in the map function
}
else{
//no throttle applied so see if we need a negative torque....
if(motor_speed > 40){ //moving forward
if(brake > 0){ //regen level for when brake is pressed, could be multi level
torque = -2000;
}
else{ //minimum torque to simulate engine braking
torque = -200;
}
}
else if(motor_speed < -40){ //going back
if(brake > 0){ //regen level for when brake is pressed, could be multi level
torque = 2000;
}
else{ //minimum torque to simulate engine braking
torque = 200;
}
}
else{ //not moving
torque = 0;
}
}
}
s32fp utils::CalcRegen( int16_t throttle, int16_t motor_speed, int16_t brake){
int16_t torque;
if(throttle > 0){
//let the throttle set the torque directly
torque = throttle; // add in the map function
}
else{
//no throttle applied so see if we need a negative torque....
if(motor_speed > 40){ //moving forward
if(brake > 0){ //regen level for when brake is pressed, could be multi level
torque = -2000;
}
else{ //minimum torque to simulate engine braking
torque = -200;
}
}
else if(motor_speed < -40){ //going back
if(brake > 0){ //regen level for when brake is pressed, could be multi level
torque = 2000;
}
else{ //minimum torque to simulate engine braking
torque = 200;
}
}
else{ //not moving
torque = 0;
}
}
}
- mackoffgrid
- Posts: 94
- Joined: Thu Jan 02, 2020 10:18 am
- Location: Brisbane Australia
- Has thanked: 6 times
- Been thanked: 1 time
Re: The ZombieVerter VCU Project
My early attempts at PID controlling the leaf motor at low RPM, with no load on the bench resembled a washing machineceleron55 wrote: ↑Mon Feb 01, 2021 3:37 pm The Leaf inverter will coast to stop if you give zero torque below certain rpm, but at higher rpm it will maintain speed given zero torque command and no external load to the motor. Does the Toyota stuff do the same or does it maintain even, say, 60 rpm?
It's nice to be able to cut off the tiny amount of regen for bench testing and gear changes well before stopping. My Leaf control code certainly takes advantage of it. Would be difficult to close in on exactly 0rpm even with a PID controller.

- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
I've assumed that a positive torque value results in a positive motor speed value and vice-versa. Also the values of 200 and 2000 are guestimates, the Auris is about 200 to creep forward on level ground. It would be nice to make some variables for the values, so the different re-gen levels could be programmed in.
A little filter on the torque value coming out of this might be nice to smooth things out as the algorithm swaps between the accelerator input and the braking levels.
A little filter on the torque value coming out of this might be nice to smooth things out as the algorithm swaps between the accelerator input and the braking levels.
- mdrobnak
- Posts: 692
- Joined: Thu Mar 05, 2020 5:08 pm
- Location: Colorado, United States
- Has thanked: 1 time
- Been thanked: 5 times
Re: The ZombieVerter VCU Project
Speaking from experience here...this isn't as trivial as one might hope. Loads easier with electric though!

-Matt
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
As I said in the video after the light bulb exploded "I'm sure it will be just fine".
I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
OK I captured a good bit more data from the Auris today while it was driving. The data capture and processing worked fine. I've added a feature to the python script so I can downsample the data to speed up processing and graphing.
The graph below shows MG2 torque during a drive cycle and the re-gen values which are seen.
The graph below shows MG2 torque during a drive cycle and the re-gen values which are seen.
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Excellent. I'll be swinging back around to doing some work on this in a day or so.
I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
Off the throttle seems to be about -100, then when the brake is applied it applies a variable torque proportional to the braking force required.
I have the MG2 speed also from the HTM frame on the same graph, so if we want to mimic how a toyota hybrid drives that should be no problem. I'll post up the full graph. We should also be able to see the MG2 speed that the system will regen down to.
I'm kinda undecided if we should include the gear selection in any algorithm for regen, or just do it like the simple algorithm above, which is based of MG2 direction of travel. I'm thinking if the vehicle rolls back might it correct in the wrong direction
I have the MG2 speed also from the HTM frame on the same graph, so if we want to mimic how a toyota hybrid drives that should be no problem. I'll post up the full graph. We should also be able to see the MG2 speed that the system will regen down to.
I'm kinda undecided if we should include the gear selection in any algorithm for regen, or just do it like the simple algorithm above, which is based of MG2 direction of travel. I'm thinking if the vehicle rolls back might it correct in the wrong direction
