Page 18 of 38
Re: The ZombieVerter VCU Project
Posted: Thu Feb 04, 2021 7:27 pm
by mdrobnak
Dilbert wrote: ↑Thu Feb 04, 2021 5:20 pm
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
If you've had this thought, then you've already figured out that it needs to be a bit more nuanced.

Simple + direction taken into account might be your first pass, but that likely is a minimum. What's the vehicle speed? If it's below a certain value, probably don't want to do anything... That's probably another easy one.
-Matt
Re: The ZombieVerter VCU Project
Posted: Thu Feb 04, 2021 7:28 pm
by Dilbert
Here are the MG2 speed and torque for a drive cycle, this should give us a starting point for the torque during the various stages of regen etc..
Re: The ZombieVerter VCU Project
Posted: Fri Feb 05, 2021 11:38 am
by Dilbert
I had a look at the FOC firmware today, there is some nice code in there that could possibly be re-used for this application to keep things similar enough. Although i want to try out the simple logic above before trying to do anythign more complex.
Also i'm thinking long term the likes of the direction selection should be moved to a higher level (100mS task), so it will work for both leaf and Toyota and not be implemented down in the HTM transmit routine.
Re: The ZombieVerter VCU Project
Posted: Fri Feb 05, 2021 12:00 pm
by Jack Bauer
Makes sense. I'm going to work on the Pius/Gs450h menu selection. Assuming I just need to specify a different offset in the 1ms case routine to do this?
Re: The ZombieVerter VCU Project
Posted: Fri Feb 05, 2021 12:56 pm
by Dilbert
Yep one starts @ state 0 (lexus) and prius/auris/yaris starts @ state 5. If we want to support the rav4 Tripple inverter we could start @ state 10 etc...
Re: The ZombieVerter VCU Project
Posted: Fri Feb 05, 2021 10:56 pm
by mdrobnak
While that works for now, I'd recommend that the states be given names (via an Enum) that makes sense, and each control protocol is in their own subclass.
I'm heads down trying to get my head around my own stuff, but might have some time next week to dedicate to this and other things Damien is working on.
I hope to have my car shifting correctly by the end of the month, which would be the last main barrier before being able to convert it to an EV.
Re: The ZombieVerter VCU Project
Posted: Sat Feb 06, 2021 9:28 am
by Jack Bauer
uhhh...Yeah! what Matt said:)
Re: The ZombieVerter VCU Project
Posted: Sat Feb 06, 2021 11:59 am
by Dilbert
I would consider just renaming the GS450 files / class as something more generic like Toyota or Hybrid etc..
Here's the enum:
enum{
STATE_GS450H_SEND_REQ,
STATE_GS450H_SEND_HTM,
STATE_GS450H_DELAY,
STATE_GS450H_READ_MTH,
STATE_GS450H_EXCHANGE_DATA,
STATE_PRIUS_SEND_REQ,
STATE_PRIUS_SEND_HTM,
STATE_PRIUS_DELAY,
STATE_PRIUS_READ_MTH,
STATE_PRIUS_EXCHANGE_DATA,
};
Re: The ZombieVerter VCU Project
Posted: Sat Feb 06, 2021 3:45 pm
by Dilbert
I wasn't happy with my code above for regen, as it didn't give the brake priority over the throttle, so maybe something like this:-
int16_t CalcTorque( int16_t throttle, int16_t brake, int16_t motor_speed, int16_t dir_selected){
int16_t torque;
if(brake > 0){
if(motor_speed > 40){ //moving forward
torque = map(brake,0,100,-200,-2000); //need to make this variable or atleast have a number of steps
}
else if(motor_speed < -40){ //moving back
torque = map(brake,0,100,200,+2000);
}
else{
torque = 0;
}
}
else if(throttle > 0){
//let the throttle set the torque directly
torque = map(throttle,0,100,0,1000); // add in the map function
}
else{
//no throttle or brake applied so see if we need a negative torque....
//maybe implement creep feature here, to up/down the torque to when in gear
if(motor_speed > 40){ //moving forward
//minimum torque to simulate engine braking
torque = -200;
}
else if(motor_speed < -40){ //going back
//minimum torque to simulate engine braking
torque = 200;
}
else{ //not moving
torque = 0;
}
}
return torque;
}
long map(long x, long in_min, long in_max, long out_min, long out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
Re: The ZombieVerter VCU Project
Posted: Sat Feb 06, 2021 6:05 pm
by Jack Bauer
Ok cool. Think I need to make an experimental branch for testing. Currently working on the Prius menu option then will bring in the regen. Good news is we can test in the E65/gs450h and E46/Leaf combos.
Re: The ZombieVerter VCU Project
Posted: Sat Feb 06, 2021 11:49 pm
by theBROCK
Hi Matt, Damien, Dilbert and everyone involved into this development, is there anyway I can get one of these boards and maybe try to contribute? Happy to be able to work on any end, got a 3rd gen Prius inverter and transaxle coming my way in the upcoming weeks; would love to help testing/adding features to it.
Cheers to everyone!
Re: The ZombieVerter VCU Project
Posted: Sun Feb 07, 2021 8:49 am
by Jack Bauer
I appreciate the support but at this point I want to keep the development very focused as personally I am under some tight time constraints on this and other projects. As explained in this video there will be a hardware release on the way with lots of additional capabilities :
Re: The ZombieVerter VCU Project
Posted: Sun Feb 07, 2021 11:42 am
by jetsetwilly2000
Hi, I've just watched the video about "so much software" and I missed the post when you asked for assistance with a webpage based front end for the projects.
I'm a "nerd" who deals with both Microcontrollers (hobby) and also Web based projects (as my job). I'd be delighted to work on a front end for you and everyone else on the forum to make updating, configuring and tinkering with the microcontrollers, etc.
I'm also looking at starting my own EV mod project using a GS450h equipment so it'll be a real pleasure to pay back to everyone involved by helping out in any way I can with the project.
-- Ian.
Re: The ZombieVerter VCU Project
Posted: Sun Feb 07, 2021 3:17 pm
by Jack Bauer
So today I froze my butt of in a chilling wind to make sure everything worked. This kind of thing will be so much easier after I sell the ip and move to Lanzarote.
-added option to select prius gen3 inverter (bench tested working).
-added INVudc parameter (inverter measured dc link voltage). Works on prius and gs450h but reads double on the leaf inverter for some reason...
-remembered to git add the charger files:) just place holders for now. Working on this next.
-all of these bench tested and in the E46/Leaf and E65/GS450H combos.
In other news I'm supposed to have a gen3 leaf inverter on the way but someone thought Ireland is in the UK so slight delay

Re: The ZombieVerter VCU Project
Posted: Sun Feb 07, 2021 3:27 pm
by Jack Bauer
@jetsetwilly2000 many thanks for your kind offer:)
Re: The ZombieVerter VCU Project
Posted: Sun Feb 07, 2021 11:20 pm
by arber333
Damien
Is your Zombie VCU capable of running Chademo code? Since you say it can run Leaf inverter and Chademo and Leaf VCU share a lot of design.
tnx
Re: The ZombieVerter VCU Project
Posted: Mon Feb 08, 2021 9:06 am
by Jack Bauer
No not at this time and I'm not planning on implementing fast charge presently.
Re: The ZombieVerter VCU Project
Posted: Mon Feb 08, 2021 5:10 pm
by Isaac96
The current state of the fast charge software is pretty much in flux anyways... The latest development versions are untested and the old ones have multiple known issues. At some point I can port it, but it's got to be working first.
Re: The ZombieVerter VCU Project
Posted: Mon Feb 08, 2021 8:41 pm
by mackoffgrid
I just watched your latest video which crystalized why you called this project "ZombieVerter" (I admit to not reading this whole thread) and your motivation - Very Good idea.
In regards to alternative youtube channels you may want to look at the Dave Jones video (EEVBlog) on this topic
https://odysee.com/@eevblog:7/eevblab-8 ... -year-of:3
or
https://www.youtube.com/watch?v=E_ChC3eY0zI
Re: The ZombieVerter VCU Project
Posted: Thu Feb 11, 2021 12:44 pm
by Jack Bauer
Gen 3 leaf inverter arrived today so will be trying to give this the zombie module treatment. Right now its too cold for me to work on the cars to test the regen code so going to work on the charger module for the next few days and get it running with a volt charger to get the bugs out. That and I need to charge the E46 soon and the pcs won't happen straight away. annndd I need to charge and balance the front pack for the E65......soo many cars....
Re: The ZombieVerter VCU Project
Posted: Sat Feb 13, 2021 1:29 pm
by Jack Bauer
Just got my "middle class man's charger" up and running with a spare leaf vcu. Now on to charge enable via can for the zombieverter.
Re: The ZombieVerter VCU Project
Posted: Mon Feb 15, 2021 3:19 pm
by Jack Bauer
So, wrestled the control of the ampera charger to the ground after two days of bit (and head) bashing as they seem to swap endian every now and again! anyway, got it working on arduino to ease the burden so now time to move onto the STM32. As a bonus I got to learn about casting (variables. Not spells).
Re: The ZombieVerter VCU Project
Posted: Mon Feb 15, 2021 5:01 pm
by mdrobnak
That seems rather odd. The coda variant that I have definitely asks for input in Big Endian mode. But then again they also have the 12V DC/DC disabled. So perhaps not quite as comparable as one might hope.
Re: The ZombieVerter VCU Project
Posted: Tue Feb 16, 2021 12:06 pm
by Jack Bauer
Yeah the coda is a different beast. Used one in the Range Rover build. Anyway, connected up the V2 and V3 taps from the isa shunt to the battery in the E46. Bugs! I think this is a left over from the evtv code I ripped off. So fix this and move to floats on the voltage display. What could go wrong:)
Re: The ZombieVerter VCU Project
Posted: Tue Feb 16, 2021 4:01 pm
by mdrobnak
Yeah they were doing some weird stuff with voltage differences...
Do note (I assume you know this...but you know what assuming does) - Power and such is calculated from V1 - so that should be the highest voltage!
-Matt