The ZombieVerter VCU Project

Locked
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: The ZombieVerter VCU Project

Post 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.
User avatar
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

Post by Jack Bauer »

will do!
I'm going to need a hacksaw
User avatar
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

Post by Jack Bauer »

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 206 times
I'm going to need a hacksaw
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: The ZombieVerter VCU Project

Post 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?
User avatar
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

Post 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
User avatar
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

Post 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.
I'm going to need a hacksaw
User avatar
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

Post 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.
I'm going to need a hacksaw
User avatar
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

Post by Jack Bauer »

I can do a dual ftdi if that helps?
I'm going to need a hacksaw
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: The ZombieVerter VCU Project

Post 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).
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: The ZombieVerter VCU Project

Post 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..
User avatar
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

Post by Jack Bauer »

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
User avatar
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

Post 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....
I'm going to need a hacksaw
User avatar
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

Post 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
User avatar
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

Post 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:)
I'm going to need a hacksaw
User avatar
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

Post 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.
User avatar
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

Post by johu »

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
User avatar
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

Post by mdrobnak »

johu wrote: Wed Jan 27, 2021 8:04 pm GCC ARM implements arithmetic shifting: https://developer.arm.com/documentation ... operations
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
Dilbert
Posts: 410
Joined: Mon Aug 12, 2019 7:21 pm
Location: Dublin, Ireland
Been thanked: 4 times

Re: The ZombieVerter VCU Project

Post 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.
User avatar
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

Post 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.
Attachments
prius_bench2.zip
(16.03 KiB) Downloaded 258 times
I'm going to need a hacksaw
User avatar
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

Post by Jack Bauer »

About as close to 500khz as we can get I reckon. Scope is calibrated so should be accurate.
Attachments
2021-01-28 10.06.48.jpg
2021-01-28 10.02.56.jpg
I'm going to need a hacksaw
User avatar
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

Post 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.
Attachments
prius_bench3.zip
(17.98 KiB) Downloaded 165 times
I'm going to need a hacksaw
User avatar
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

Post by Jack Bauer »

and same again but with a yaris bare logic board.
Attachments
prius_bench4.zip
(17.7 KiB) Downloaded 61 times
I'm going to need a hacksaw
User avatar
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

Post 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 :D
Attachments
20210128_102338.jpg
I'm going to need a hacksaw
User avatar
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

Post by johu »

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
User avatar
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

Post 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.............
I'm going to need a hacksaw
Locked