Page 13 of 38
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 11:02 am
by Dilbert
I wasn't fully expecting it to work first time. I want to review any static data in the htm frame and init our frame to the same
I've also noticed that there seems to be 2 or 3 set up frames so might look at how to send them. First setup frame might be sent twice
Could you grab the MTH data using an ftdi cable and capture to a file (hex or bin file is fine) , hopefully should see it's hb counter going up. I can process it in python quickly.
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 11:55 am
by Jack Bauer
will do!
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 2:17 pm
by Jack Bauer
Here is a MTH capture from the bench setup in hex format. No hv applied. Capture includes startup.
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 3:21 pm
by Dilbert
Ok there's something funny happening in that data if i'm reading it correctly.
In hex we have 2 chars for every byte, so for MTH data @ 120 bytes binary we would expect a repeat every 240 bytes, but i seem to be getting a repeat every 242 bytes. I wonder do we have an extra byte sneaking into each frame?
On one of my signals at inverter power up i was getting an extra byte in, which i just deleted. That seems to have an extra byte in for each frame.
Is this just a CAN transceiver connected to an FTDI cable on the MTH line?
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 3:38 pm
by mdrobnak
BTW, something cppcheck pointed out is that shifting of a negative number (the regen amount limit of -5000) is undefined behavior. I wonder what we're actually putting 'on the wire' and wonder if that's why we have no regen in these cars.
-Matt
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 3:40 pm
by Jack Bauer
I'm tapped in on the stm32 side of the mth transciever on the vcu. So this should be exactly what is being pumped into the rx pin of the micro.
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 3:41 pm
by Jack Bauer
In other new we now have a vcu fitted and powered up in the e46 touring so e46 integration and leaf inverter comms testing will be happening soon.
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 3:43 pm
by Jack Bauer
I can do a dual ftdi if that helps?
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 5:15 pm
by Dilbert
Jack Bauer wrote: ↑Wed Jan 27, 2021 3:40 pm
I'm tapped in on the stm32 side of the mth transciever on the vcu. So this should be exactly what is being pumped into the rx pin of the micro.
Sounds like it should work, I have done similar myself in the past, I'm just surprised the data is not lining up correctly. Could MTH+ and MTH- be flipped? (unlikely I know).
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 5:17 pm
by Dilbert
Jack Bauer wrote: ↑Wed Jan 27, 2021 3:43 pm
I can do a dual ftdi if that helps?
Doesn't have to be a dual one, but it might not do any harm as it would allow us to validate what we are generating on the HTM line too, so probably no harm. If you just take one of the STM-VCU boards and hold the processor in reset you should be able to use the on board transcievers..
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 5:44 pm
by Jack Bauer
I'll do another in the morning and will flip mth+/- just in case. 99% sure they are correct.
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 5:54 pm
by Jack Bauer
On another note I do have a bit of a weird problem with the isa routine. I've added in reading v2 and v3 and if I have nothing connected to one of them it reads 65v for some reason....
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 5:55 pm
by mdrobnak
Did you initialize them?
_Any_ time you declare a variable, you should initialize it to a sane value, otherwise you get garbage.
ie
int ISA::Voltage2; < bad
int ISA::Votlage2=0; < good
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 6:06 pm
by Jack Bauer
No difference:( I think what happens looking at the can data is the isa hovers around 0v +/- a few mv which is throwing my carefull crafted routine into a wobbly when it goes negative:)
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 6:11 pm
by mdrobnak
Oh, that's a good point, I don't remember how sign handling is on the ISA. I'll have to look more closely at that with my own code as well.
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 8:04 pm
by johu
Re: The ZombieVerter VCU Project
Posted: Wed Jan 27, 2021 8:46 pm
by mdrobnak
Wouldn't that likely be used in terms of a divide or multiply by 2 (as an optimization)? A ">>" is a logical bit shift to me, but I may be wrong. I genuinely don't know, and you seem to have more real-world C than most of us.
Dealing with negative numbers can be a problem. I'm just wondering if we accidentally hit into one.
I'm just trying to follow the lead of the Rust people and minimize "UB" - undefined behavior. I'm certainly not the expert, and its why I'm hoping tools help us all write better code.
-Matt
Re: The ZombieVerter VCU Project
Posted: Thu Jan 28, 2021 9:47 am
by Dilbert
Jack Bauer wrote: ↑Wed Jan 27, 2021 5:44 pm
I'll do another in the morning and will flip mth+/- just in case. 99% sure they are correct.
Was thinking about this earlier, the MTH +/- isn't flipped, but always worth checking.
I think that possibly the transfer clock of the FTDI cable and VCU aren't exactly matching. I know on the VCU here i did scope the CLK pin and saw 500KHz (or very very close), i'm wondering is that clock slightly off and we are getting a few extra bits received. Maybe measure it with a scope and set the FTDI baud rate based on that.
Re: The ZombieVerter VCU Project
Posted: Thu Jan 28, 2021 9:54 am
by Jack Bauer
Here is a dual ftdi capture with the same setup as yesterday. power on both vcu and inverter from cold then off.
Re: The ZombieVerter VCU Project
Posted: Thu Jan 28, 2021 10:09 am
by Jack Bauer
About as close to 500khz as we can get I reckon. Scope is calibrated so should be accurate.
Re: The ZombieVerter VCU Project
Posted: Thu Jan 28, 2021 10:15 am
by Jack Bauer
same test but with a bare logic board from a prius inverter. Keep in mind my bench gen3 is from a lexus ct200h.
Re: The ZombieVerter VCU Project
Posted: Thu Jan 28, 2021 10:17 am
by Jack Bauer
and same again but with a yaris bare logic board.
Re: The ZombieVerter VCU Project
Posted: Thu Jan 28, 2021 10:36 am
by Jack Bauer
First power up in the E46. Good news is vehicle side can seems to be working well. Bad news : I'm outta gas

Re: The ZombieVerter VCU Project
Posted: Thu Jan 28, 2021 11:13 am
by johu
Nice! Can you run that MPG meter backwards to display KW? Gas-o-meter also CAN controlled?
Re: The ZombieVerter VCU Project
Posted: Thu Jan 28, 2021 11:20 am
by Jack Bauer
Yeah I think it is. good idea.
Edit : fixed isa shunt v2 and v3. its was the Damien classic : signed value in an unsigned variable.............