The ZombieVerter VCU Project
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
-
- Posts: 179
- Joined: Sat Jan 25, 2020 6:22 am
- Location: California
- Has thanked: 1 time
- Been thanked: 4 times
Re: The ZombieVerter VCU Project
Excellent! When you’re ready for testers/contributors, shout. My connector and enclosure are already on the way.
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Pinout and description done. Also picked up on 2 unrouted connections.
- Attachments
-
ZOM_V1_HEADER_PINOUT.ods
- (18.22 KiB) Downloaded 333 times
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Ah the joys of GigaDevices. As some of you may have already figured out I'm using the GD32F107VCT6 on the vcu. Its very close to being an STM32F107VCT6 but not quite...
Johannes had figured out one problem so got code running on the vcu and bench tested the following :
Digital inputs
Analog inputs
Toyota hybrid coms
Pwm timers(tim1 so far)
Usart3 (wifi)
Then hit a brick wall with CAN. No tx and no rx. Tx was a damien special. Not using remapped pins in the setup routine. Only took a day for brains here to relalise that... anyway now we have tx on both CAN channels. Yay....but still no rx..
Another day and about 25 emails to Johannes later I blunder my way to the receive routine and find that GD handle the CAN fifos differently to ST and thus the libopencm3 routine was only executing once. I bodged a work around and we have can rx.
Pushing this to the repo now so folks have something to test with. Attaching the GDF1 refference manual as only took an hour to download ...
Johannes had figured out one problem so got code running on the vcu and bench tested the following :
Digital inputs
Analog inputs
Toyota hybrid coms
Pwm timers(tim1 so far)
Usart3 (wifi)
Then hit a brick wall with CAN. No tx and no rx. Tx was a damien special. Not using remapped pins in the setup routine. Only took a day for brains here to relalise that... anyway now we have tx on both CAN channels. Yay....but still no rx..
Another day and about 25 emails to Johannes later I blunder my way to the receive routine and find that GD handle the CAN fifos differently to ST and thus the libopencm3 routine was only executing once. I bodged a work around and we have can rx.
Pushing this to the repo now so folks have something to test with. Attaching the GDF1 refference manual as only took an hour to download ...
- Attachments
-
- GD32F10x_User_Manual_EN_Rev2.4.zip
- (8.32 MiB) Downloaded 297 times
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
On the subject of Arm, bout time I fired this baby up:)
I'm going to need a hacksaw
-
- Posts: 967
- Joined: Sun Feb 23, 2020 9:24 am
- Location: Northern Ireland
- Has thanked: 364 times
- Been thanked: 218 times
- Contact:
Re: The ZombieVerter VCU Project
LOL, a very long time ago I repaired them for a local education board.Jack Bauer wrote: ↑Sun May 16, 2021 12:58 pm On the subject of Arm, bout time I fired this baby up:)

Unfortunately I was a bit rubbish at it. Mostly swapping chips to see what would happen.

-
- Posts: 395
- Joined: Sun Aug 25, 2019 12:39 pm
- Location: Finland
- Has thanked: 55 times
- Been thanked: 14 times
Re: The ZombieVerter VCU Project
Some auto repair shops just change parts that may get the car running, so business as usualAlibro wrote: ↑Sun May 16, 2021 4:30 pmLOL, a very long time ago I repaired them for a local education board.Jack Bauer wrote: ↑Sun May 16, 2021 12:58 pm On the subject of Arm, bout time I fired this baby up:)![]()
Unfortunately I was a bit rubbish at it. Mostly swapping chips to see what would happen.![]()

Any opinions are my own, unless stated otherwise. I take no responsibility if you follow my way of doing things and it doesn't work. Please double check with someone who knows what they are doing.
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
First batch of boards on their way to beta testers:)
I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
Thanks, one just landed here, I will look at how the Toyota protocol will run on the giga device and see if the same approach from the stn32 will work or needs updates.
- Jack Bauer
- Posts: 3651
- 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 just to make a list of whats needed from the software side :
-Driver for the LIN bus using the TJA1020. I think Johannes has done something on this so I may just rip that off.
- Driver for CAN 3 using the MCP25625 on SPI2. Not fitted to current boards as out of stock at jlc but I have 50 on the way from Microchip so will fit to the next batch.
-Implement the PWM outputs.
-Implement the 2 DAC outputs.
-Driver for the two digital potentiometers AD5160 chips on SPI3.
Some of this I can muddle through myself but as always any help apreciated especially on the software side:)
-Driver for the LIN bus using the TJA1020. I think Johannes has done something on this so I may just rip that off.
- Driver for CAN 3 using the MCP25625 on SPI2. Not fitted to current boards as out of stock at jlc but I have 50 on the way from Microchip so will fit to the next batch.
-Implement the PWM outputs.
-Implement the 2 DAC outputs.
-Driver for the two digital potentiometers AD5160 chips on SPI3.
Some of this I can muddle through myself but as always any help apreciated especially on the software side:)
I'm going to need a hacksaw
- johu
- Site Admin
- Posts: 6650
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 349 times
- Been thanked: 1508 times
- Contact:
Re: The ZombieVerter VCU Project
The DAC code intended for Tesla resolver is here: https://github.com/jsphuebner/stm32-car ... hwinit.cpp . Should lend itself well to any application.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Re: The ZombieVerter VCU Project
On 3 of the items below, would it be possible just to map these to parameters, which can then be manipulated locally in the firmware, or the web interface or even mapped onto the CAN bus if needed?
-Implement the PWM outputs.
-Implement the 2 DAC outputs.
-Driver for the two digital potentiometers AD5160 chips on SPI3.
So if the firmware read the params every 50-100mS and just updated the physical output device, if there has been any change in the parameter value.
-Implement the PWM outputs.
-Implement the 2 DAC outputs.
-Driver for the two digital potentiometers AD5160 chips on SPI3.
So if the firmware read the params every 50-100mS and just updated the physical output device, if there has been any change in the parameter value.
- EV_Builder
- Posts: 1205
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 18 times
- Been thanked: 37 times
- Contact:
Re: The ZombieVerter VCU Project
That's more like remote IO functionality. But what Damien means is the core code in itself to write to an output with pwm functionality. I think we should build a smaller remote IO device (extension style) but that's on my list of whishes. Easy to distribute in the car and can be centrally commanded is my idea.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- EV_Builder
- Posts: 1205
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 18 times
- Been thanked: 37 times
- Contact:
Re: The ZombieVerter VCU Project
Very cool VCU guys. Starts to look like a pro-build.
Defenitly recommend to buy.
Small tweaks with my Chinese housing and connector. There is only one case grommet, connector surrounded. I don't have the grommet for the lid so to say.
The board is very good for a first runs. Because it fits. For the sake of tolerances I think that:
- watching it from the back, connector down, the right hole pattern plus mounting hole should be like 0.6mm to the left.
- watching it component side, connectors to the top, my right lower hole is 1mm of to the right. So my threads of the bolt touch the board.
But it all fits and can be made fit perfectly so for a first run it couldn't be better.
Defenitly recommend to buy.
Small tweaks with my Chinese housing and connector. There is only one case grommet, connector surrounded. I don't have the grommet for the lid so to say.
The board is very good for a first runs. Because it fits. For the sake of tolerances I think that:
- watching it from the back, connector down, the right hole pattern plus mounting hole should be like 0.6mm to the left.
- watching it component side, connectors to the top, my right lower hole is 1mm of to the right. So my threads of the bolt touch the board.
But it all fits and can be made fit perfectly so for a first run it couldn't be better.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
- EV_Builder
- Posts: 1205
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 18 times
- Been thanked: 37 times
- Contact:
Re: The ZombieVerter VCU Project
You are more then welcome

Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Little bit of overlap here from the i3 ccs thread. This is a BMW i3 EDME. Basically their version of a VCU that control the drivetrain, battery , cooling etc.
Here is the BMW blurb :
EDME: Electrical Digital Motor Electronics
The EDME control unit acts as the master control unit and coordinator for the primary functions of the drive control.
Before a drive torque is implemented, the EDME must be checked to see if the driving readiness has been produced.
The EDME queries if all the subsystems of the electrical drive control function trouble-free, which is a requirement for allocating the drive torque. The EDME control unit regards the available electrical power for the electric motor, which is primarily determined by the state of the high-voltage battery. Via the corresponding Bus telegrams, the SME control unit communicates the state to the EDME control unit.
As a result of these checks, the EDME determines if and in what scope the drive torque can be provided. In the event of fault states or restricted availability, the EDME outputs a Check Control message on the instrument cluster.
The EDME control unit is supplied with terminal 30B and terminal 15 wake-up.
The EDME control unit is connected to the data buses of the FlexRay, PT-CAN and PT-CAN2.
The following components are connected to the Electrical Digital Motor Electronics (EDME):
Accelerator pedal module
Intelligent battery sensor via the LIN bus
Front electric fan
Electric fan of engine compartment
2 temperature sensor in the rear engine compartment (for Range extender OE only)
Electric coolant pump
Radiator blind drive (active air-flap control) via LIN bus
Shutoff-capable expansion valve
The EDME control unit contains among other things the logic when the parking lock should be engaged or disengaged. Via the PT-CAN, the EDME control unit transmits the corresponding commands to the electrical machine electronics (EME).
It behaves similar with the drive positions "R" and "D". Here too, the EDME control unit calculates the function logic. The electrical machine electronics (EME) is responsible for the execution, to for example activate the electrical machine in accordance with reversing or drive.
Here is the BMW blurb :
EDME: Electrical Digital Motor Electronics
The EDME control unit acts as the master control unit and coordinator for the primary functions of the drive control.
Before a drive torque is implemented, the EDME must be checked to see if the driving readiness has been produced.
The EDME queries if all the subsystems of the electrical drive control function trouble-free, which is a requirement for allocating the drive torque. The EDME control unit regards the available electrical power for the electric motor, which is primarily determined by the state of the high-voltage battery. Via the corresponding Bus telegrams, the SME control unit communicates the state to the EDME control unit.
As a result of these checks, the EDME determines if and in what scope the drive torque can be provided. In the event of fault states or restricted availability, the EDME outputs a Check Control message on the instrument cluster.
The EDME control unit is supplied with terminal 30B and terminal 15 wake-up.
The EDME control unit is connected to the data buses of the FlexRay, PT-CAN and PT-CAN2.
The following components are connected to the Electrical Digital Motor Electronics (EDME):
Accelerator pedal module
Intelligent battery sensor via the LIN bus
Front electric fan
Electric fan of engine compartment
2 temperature sensor in the rear engine compartment (for Range extender OE only)
Electric coolant pump
Radiator blind drive (active air-flap control) via LIN bus
Shutoff-capable expansion valve
The EDME control unit contains among other things the logic when the parking lock should be engaged or disengaged. Via the PT-CAN, the EDME control unit transmits the corresponding commands to the electrical machine electronics (EME).
It behaves similar with the drive positions "R" and "D". Here too, the EDME control unit calculates the function logic. The electrical machine electronics (EME) is responsible for the execution, to for example activate the electrical machine in accordance with reversing or drive.
I'm going to need a hacksaw
- Jack Bauer
- Posts: 3651
- 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,anyone interested in writing a LIM class for the VCU or just adding to the charger class?
I'm going to need a hacksaw
- EV_Builder
- Posts: 1205
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 18 times
- Been thanked: 37 times
- Contact:
Re: The ZombieVerter VCU Project
I'm planning to make a small IO gateway/slave/assistant BMS etc.. over CANBus. So it will expand the usecases it will do what you wrote.Dilbert wrote: ↑Fri May 21, 2021 3:39 pm On 3 of the items below, would it be possible just to map these to parameters, which can then be manipulated locally in the firmware, or the web interface or even mapped onto the CAN bus if needed?
-Implement the PWM outputs.
-Implement the 2 DAC outputs.
-Driver for the two digital potentiometers AD5160 chips on SPI3.
So if the firmware read the params every 50-100mS and just updated the physical output device, if there has been any change in the parameter value.
CANBus in and out and you control IO. Ideally to use with hardware in the trunk or frunk for example. Saves wires. I just need to learn designspark first....
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
Well this is fun. Getting the LIM class added to the master branch for testing in the E46. I mean its only 350kw of potential charger power and I never do things like put signed values in unsigned variables or mistake || for | ....
Seriously though folks a little help on this would be great... Even just a look over for stupid programming mistakes. I'll push what I've done so far to the repo.
On another note :
static const int MAX_USER_MESSAGES = 10;
Seriously Johannes!

Seriously though folks a little help on this would be great... Even just a look over for stupid programming mistakes. I'll push what I've done so far to the repo.
On another note :
static const int MAX_USER_MESSAGES = 10;
Seriously Johannes!



I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
I wouldn't mind helping out, but i'm also thinking about how to make this generic for the various different chargers that people are using etc...
See attached my first attempt at drawing up a state diagram for the system including a charger.
See attached my first attempt at drawing up a state diagram for the system including a charger.
- Jack Bauer
- Posts: 3651
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
Re: The ZombieVerter VCU Project
On a specific note can someone please help me with this :
Code: Select all
I_Batt=(Param::GetInt(Param::idc)+819.2)*10; //This crashes the stm32
I_Batt=(Param::GetInt(Param::idc)+819)*10; //This works but with a slightly wrong value.
I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
I'm 25 years rusty on C++ but, try casting the result of getting the param as a float (or get it as a float value if you can???). Something like ... =((float)Param::GetInt(Param::idc)...Jack Bauer wrote: ↑Mon May 31, 2021 9:45 am On a specific note can someone please help me with this :
Code: Select all
I_Batt=(Param::GetInt(Param::idc)+819.2)*10; //This crashes the stm32 I_Batt=(Param::GetInt(Param::idc)+819)*10; //This works but with a slightly wrong value.
The way you're trying to do it, you'll lose the floating point part of 819.2 anyway, because apparently if you just add a float and and int, the float gets converted to an int implicitly instead of the other way. Casting will maybe fix your error but will also preserve the floating point.
Patreon supporter and mild troublemaker. You can be both.
-
- Posts: 285
- Joined: Mon Jan 18, 2021 12:39 pm
- Location: Edinburgh, Scotland, UK
- Has thanked: 64 times
- Been thanked: 88 times
Re: The ZombieVerter VCU Project
I think if you use the following in the i3LIMClass::Send10msMessages() you should get better accuracy using the fixed point macros.
I've only compile tested this so it comes with a health warning. The basic idea with the fixed point macros is:
Code: Select all
V_Batt=FP_TOINT(FP_MUL(Param::Get(Param::udc),10));
V_Batt2=FP_TOINT(FP_DIV(Param::Get(Param::udc),4));
I_Batt=FP_TOINT(FP_MUL(Param::Get(Param::idc)+FP_FROMFLT(819.2),10));
SOC_Local=FP_TOINT(FP_MUL(Param::Get(Param::SOC),10));
- add and substract values using regular + and - C operators
- multiply and divide use the FP_MUL(a,b) for a*b and FP_DIV(a,b) for a/b. Don't use the C / and * operators.
- All C constants with a decimal point (e..g 3.1415) are floats. You can use these provided you convert to fixed point s32fp type with the FP_FROMFLT() macro
- To get the integer portion of a fixed point value us FP_TOINT().