The ZombieVerter VCU Project
Re: The ZombieVerter VCU Project
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.
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.
- Jack Bauer
- Posts: 3649
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 288 times
- Contact:
- 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
Here is a MTH capture from the bench setup in hex format. No hv applied. Capture includes startup.
- Attachments
-
- mth_prius_bench1.zip
- (16.21 KiB) Downloaded 207 times
I'm going to need a hacksaw
Re: The ZombieVerter VCU Project
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?
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?
- 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
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
-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
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.
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
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.
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
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).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.
Re: The ZombieVerter VCU Project
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..
- 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'll do another in the morning and will flip mth+/- just in case. 99% sure they are correct.
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
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....
I'm going to need a hacksaw
- 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
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

_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
- 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
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:)
I'm going to need a hacksaw
- 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
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.
- johu
- Site Admin
- Posts: 6645
- 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
GCC ARM implements arithmetic shifting: https://developer.arm.com/documentation ... operations
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- 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
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.johu wrote: ↑Wed Jan 27, 2021 8:04 pm GCC ARM implements arithmetic shifting: https://developer.arm.com/documentation ... operations

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
Was thinking about this earlier, the MTH +/- isn't flipped, but always worth checking.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.
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.
- 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
Here is a dual ftdi capture with the same setup as yesterday. power on both vcu and inverter from cold then off.
- Attachments
-
- prius_bench2.zip
- (16.03 KiB) Downloaded 259 times
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
About as close to 500khz as we can get I reckon. Scope is calibrated so should be accurate.
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
same test but with a bare logic board from a prius inverter. Keep in mind my bench gen3 is from a lexus ct200h.
- Attachments
-
- prius_bench3.zip
- (17.98 KiB) Downloaded 165 times
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
and same again but with a yaris bare logic board.
- Attachments
-
- prius_bench4.zip
- (17.7 KiB) Downloaded 62 times
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
First power up in the E46. Good news is vehicle side can seems to be working well. Bad news : I'm outta gas 

I'm going to need a hacksaw
- johu
- Site Admin
- Posts: 6645
- 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
Nice! Can you run that MPG meter backwards to display KW? Gas-o-meter also CAN controlled?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- 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 I think it is. good idea.
Edit : fixed isa shunt v2 and v3. its was the Damien classic : signed value in an unsigned variable.............
Edit : fixed isa shunt v2 and v3. its was the Damien classic : signed value in an unsigned variable.............
I'm going to need a hacksaw