Page 10 of 38

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 2:00 am
by ChazFisher
mdrobnak wrote: Mon Jan 18, 2021 4:55 pm <snip>

It's repetitive because it's generating a map of the interrupts that are different for all the supported ST / ARM platforms.

There are windows specific build instructions on the github for libopencm3:

https://github.com/libopencm3/libopencm3

If that helps get you going with libopencm3, great!

Damien, were you able to test any of the cleanups? If we have more people joining, we should probably get that merged. Thanks!

-Matt
Actually, the breadth of the libopencm3 project, and the number of processors supported, is pretty impressive. My quotes around repetitive were simply because that's what the comment in the script file said. I tried the instructions in the libopencm3 github, but msys was giving me some "memory page size" errors. Today, I tried using cygwin instead - and success! Not only did libopencm3 build, but so did the Rev 4.97R software. Or at least I got .hex and .bin files from it - I haven't tried actually flashing a processor.

Now, I'm going to stop clogging up Damien's thread with unrelated questions. ;)

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 10:01 am
by Jack Bauer
Ok, tested the new code in the E65. Good news : starts up and drives forward no problem. Bad news: No reverse. Gear indicator on the dash shows "R" but Neutral is shown on the web interface. Everything else seems fine. I reloaded my old code in order to reverse the beast back up the driveway:)

I changed the E65 CAS module to account for the "engine cranking" message :

Code: Select all

bool Can_E65::Cas(int id, uint32_t data[2], uint32_t time)
{

    ///////////Message from CAS on 0x130 byte one for Terminal 15 wakeup
    uint8_t* bytes = (uint8_t*)data;// arrgghhh this converts the two 32bit array into bytes. See comments are useful:)
    if(id==0x130)
    {
        if(bytes[0] == 0x45)
        {
         T15Status=true; //if the cas sends 0x45 in byte 0 of id 0x130 we have a run command
         }
         else if (bytes[0] == 0x55)
         {
         T15Status=true;
         }
        else T15Status=false;
    }
    return T15Status;
}
This allows for a foot on brake start just like the ice version. Matt could you update the super version with this please?

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 1:46 pm
by Jack Bauer
V3 prius test bench all set. Just add software:)

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 2:31 pm
by Dilbert
I'm working on it now. I've found 3 possible locations of battery data, in around the end of the data stream, see attached files.

Also attached what i believe to be MG1 and MG2 torque commands. I believe I let the car out of park to just roll forward hence the blip on MG2.

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 2:40 pm
by Dilbert
Here's the files i've developed if you want to test. (still haven't sorted my GIT issue)

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 3:43 pm
by mdrobnak
Jack Bauer wrote: Tue Jan 19, 2021 10:01 am Ok, tested the new code in the E65. Good news : starts up and drives forward no problem. Bad news: No reverse. Gear indicator on the dash shows "R" but Neutral is shown on the web interface. Everything else seems fine. I reloaded my old code in order to reverse the beast back up the driveway:)

I changed the E65 CAS module to account for the "engine cranking" message :

Code: Select all

bool Can_E65::Cas(int id, uint32_t data[2], uint32_t time)
{

    ///////////Message from CAS on 0x130 byte one for Terminal 15 wakeup
    uint8_t* bytes = (uint8_t*)data;// arrgghhh this converts the two 32bit array into bytes. See comments are useful:)
    if(id==0x130)
    {
        if(bytes[0] == 0x45)
        {
         T15Status=true; //if the cas sends 0x45 in byte 0 of id 0x130 we have a run command
         }
         else if (bytes[0] == 0x55)
         {
         T15Status=true;
         }
        else T15Status=false;
    }
    return T15Status;
}
This allows for a foot on brake start just like the ice version. Matt could you update the super version with this please?
I must have busted something with the direction setting parameter. Let me take a quick look.

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 3:47 pm
by Jack Bauer
Ok cool. Will test tomorrow. So I just replace the existing gs450h files with these? I guess will need to change the dma to 100 bytes for htm and 120 for mth?

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 3:49 pm
by Jack Bauer
Thanks Matt:) Sorry Dilbert ignore me. I'm silly.

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 3:58 pm
by mdrobnak
:D :D :D

Code: Select all

-        switch (E65Vehicle.getGear())
-        {
-        case 0:
-            selectedDir = 0; // Park
-            break;
-        case 1:
-            selectedDir = 0; // Neutral
-            break;
-        case 2:
-            selectedDir = -1; // Reverse
-            break;
-        case 3:
-            selectedDir = 1; // Drive
-            break;
-        }
+        if(Can_E65::Gear_E65()==0) selectedDir = 0; //park
+        if(Can_E65::Gear_E65()==2) selectedDir = 0; //neutral
+        if(Can_E65::Gear_E65()==1) selectedDir = -1; //reverse
+        if(Can_E65::Gear_E65()==3) selectedDir = 1; //drive
What's wrong here?

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 4:02 pm
by mdrobnak
Ok, first, just do a git restore utils.pp to bring that back to the git version, then a git pull..I fixed 1/2 being swapped.

It should work, but try reverse first ;)

If so, then I'll add in the engine cranking thing.

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 4:06 pm
by Dilbert
Jack Bauer wrote: Tue Jan 19, 2021 3:49 pm Thanks Matt:) Sorry Dilbert ignore me. I'm silly.
Yea the arrays are resized, i've also made the code a bit more generic, so we can specify how long the data is when calculating/verifying the checksums. At some point we could consider naming the baseclass ToyotaSerial (or something) which runs the inverter protocol and it can then be configured for the different models GS450H/Prius/Auris etc....

Just replace the two files you have at the moment. The new code actually uses stats 5-9 in the 1mS Task for the prius/auris.

I need to re-run my macro's on the incoming data (mth) and verify the locations of the data coming back in from the inverter.

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 5:46 pm
by Jack Bauer
Thanks Matt. will test in the E65 tomorrow. Dilbert, would it help If i captured some data with the logic analyser?

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 5:54 pm
by mdrobnak
Dilbert wrote: Tue Jan 19, 2021 4:06 pm Yea the arrays are resized, i've also made the code a bit more generic, so we can specify how long the data is when calculating/verifying the checksums. At some point we could consider naming the baseclass ToyotaSerial (or something) which runs the inverter protocol and it can then be configured for the different models GS450H/Prius/Auris etc....

Just replace the two files you have at the moment. The new code actually uses stats 5-9 in the 1mS Task for the prius/auris.

I need to re-run my macro's on the incoming data (mth) and verify the locations of the data coming back in from the inverter.
Do you need help with git still?
Jack Bauer wrote: Tue Jan 19, 2021 5:46 pm Thanks Matt. will test in the E65 tomorrow. Dilbert, would it help If i captured some data with the logic analyser?
I updated the test for 0x45 or 0x55 will set T15 true.

-Matt

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 5:58 pm
by Jack Bauer
Thanks Matt, I'm back down the bottom of the learning curve with some of the new programming symbols and methods. Pity I can't just plug a new eeprom into my brain:)

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 6:00 pm
by mdrobnak
Jack Bauer wrote: Tue Jan 19, 2021 5:58 pm Thanks Matt, I'm back down the bottom of the learning curve with some of the new programming symbols and methods. Pity I can't just plug a new eeprom into my brain:)
I'm pretty crap at object-oriented programming, so don't feel bad. Just trying to eliminate global variables and clean up function calls. :)

-Matt

Edit: . = funciton, -> = data member

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 6:02 pm
by Jack Bauer
Right I'll test the "base" version first before moving in Dilbert's version of the gs450h library. Looks like I'll have to put in a call to SetPrius() or SetGS450H() in the main loop. I'll add a menu option for Prius and find my way to the call from there. Not doing that now as my brain is cheese at this time of day:)

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 6:03 pm
by Jack Bauer
mdrobnak wrote: Tue Jan 19, 2021 6:00 pm
Edit: . = funciton, -> = data member
Ahhhhhh......... This is kinda like reverse engineering:)

Re: The ZombieVerter VCU Project

Posted: Tue Jan 19, 2021 6:32 pm
by Dilbert
The file I've uploaded should work as is in Prius mode for testing as I'm setting the htm_state = 5 on start up, without calling the function to set Prius mode

Re: The ZombieVerter VCU Project

Posted: Wed Jan 20, 2021 10:33 am
by Jack Bauer
Still no reverse in the E65:(

Re: The ZombieVerter VCU Project

Posted: Wed Jan 20, 2021 11:55 am
by Jack Bauer
Prius bench test 1 : New software loaded up. Can see htm and mth on scope. Getting and invstat ON on the wifi but no life at all from the inverter and no response to torque commands. Going to lookup the wiring diagrams and see if there is a shutdown or enable line I'm not seeing and then grab some captures with the logic analyser.

Re: The ZombieVerter VCU Project

Posted: Wed Jan 20, 2021 12:58 pm
by Dilbert
OK, that's a good start, it means it is exchanging the frames and for the incoming mth data the checksums and data length must be correct.

Are you seeing the DC bus value (you probably don't have a battery connected) coming from the mth data and into GS450HClass::dc_bus_voltage? I don't think it is being taken into a param yet which you can easily read. In one of the runs I had recorded I'm thinking some of the bytes were moved on by 1 column, but this was the mth data.

They are definitely doing the same thing where they put the torque commands twice into the htm message. Also the MG1 torque command to start the engine is in location 75/76, but when driving the vehicle i'm seeing MG1 torque commands down in 5/6 (same as GS450H).

I've a good bit of data in excel which i want to review. I'm wondering is there a heartbeat counter added or similar, which we would need to mimic.

Oh just saw something, uncomment out line 396 // inv_status--;

I think we are constantly sending the setup data!

Re: The ZombieVerter VCU Project

Posted: Wed Jan 20, 2021 1:34 pm
by Jack Bauer
Ok will try that. Here are a bunch of logic analyser captures. Both from the bench rig and a few bare logic boards :
https://github.com/damienmaguire/Prius- ... erial_Logs

Re: The ZombieVerter VCU Project

Posted: Wed Jan 20, 2021 1:46 pm
by Jack Bauer
Ok did the code code mod. Didn't seem to change much. Here is a capture :
https://github.com/damienmaguire/Prius- ... .logicdata

Re: The ZombieVerter VCU Project

Posted: Wed Jan 20, 2021 1:48 pm
by Jack Bauer
Just might be worth noting its a ct200h inverter I'm using but I have "prius" logic boards that I can swap in if we think that's an issue.

Re: The ZombieVerter VCU Project

Posted: Wed Jan 20, 2021 2:46 pm
by Dilbert
I'd imagine the Auris/CT200h should be very similar, i can't see any reason to have a different variant for each and hybrid was an option for both of these vehicles, so volume-wise it probably didn't make sense to do anything different.

Although we are getting the MTH frame back ok, i wonder is this variant more picky about the REQ signal, that it won't accept the HTM, unless a specific timing is met (hard to believe i know). I've attached a screengrab of the REQ line in yellow, along with the rest of the data, i wonder is there something specific in the timing of this, the GS450H doesn't seem to mind too much.



We could try replay the HTM data i've captured back to the inverter and see if you hear any switching.

I still have an RJ45 cable in the glove box of the Auris and it is connected to all 4 signals, so we can capture as much data as we like.
I would like to have some method of capturing from both sides of the data-stream at the same time.