evbuilder wrote: βSun Mar 06, 2022 9:36 pm
I've found a ToyotaInverters page on the wiki which looks to be intended for this info. So far I added it to Toyota and OEM categories so it is more easily found. I should probably add the above to it to help the next guy! I've only been looking at this for a week or two.
Thanks for the guidance, now have a gs450h_vcu up and running with source code that I can modify.
It took me a few hours to find all of the pieces and get working.
Here is a link to the whole set for a working example, and a small write up How To for getting it started.
https://www.dropbox.com/sh/1ulm2gir3jfy ... SQgBa?dl=0
The data exchange is indeed a 2 direction array, 80 bytes to the inverter and 100 bytes from the inverter.
The data is in the array is modified to request torque, -3500 to 3500, see DRIVE and REVERSE below.
The data needs to be exchanged at 10mS to keep the Inverter happy
Now I have to link it to a Prius inverter and see what happens then, or doesn't...
Anyone done this yet?
I might need Damien's help there, how do I contact him?
BTW >>> the gs450h_vcu can be reprogrammed to be a SPI sync serial bus sniffer, so there is no need to design your own, or you can borrow Damien's design.
Here are some code snippets
// SPI Data Exchange.
// mth is from the Inverter
// htm is to the Inverter
byte mth_data[100];
byte htm_data_setup[80]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,25,0,0,0,0,0,0,0,128,0,0,0,128,0,0,0,37,1};
byte htm_data[80]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0};
// Get Demand Torque from Throttle Pedal
short get_torque()
{
//accelerator pedal mapping to torque values here
ThrotVal=analogRead(Throt1Pin); //75 to 370
if(ThrotVal<80) ThrotVal=75; //dead zone at start of throttle travel
if(gear==DRIVE) ThrotVal = map(ThrotVal, 75, 370, 0, 3500); //drive torque default
if(gear==REVERSE) ThrotVal = map(ThrotVal, 75, 370, 0, -3500); //reverse torque default
if(gear==PARK) ThrotVal = 0; //no torque in park or neutral
if(gear==NEUTRAL) ThrotVal = 0; //no torque in park or neutral
return ThrotVal; //return torque
}