EDIT: Excel file with all the codes I hacked together. [POST="115258"]Jump to post 21[/POST] where I explain how to program the XGauge. Ok... I feel pretty stupid but I finally get it now. I've been trying for weeks to get my head around what XGauge was doing. Took WFEC and the revelation that we were flying blind without Battery Amps on the Prius to focus my efforts. Well here's what I found. First let qualify that this is CAN-bus only. Since I'm a Prius Pilot that's all I've been focused on. So what I've found out is that there are two types of CanBus requests. Passive (snooping the bus) and active. Passive is kinda like ease-dropping on a conversation... the data is just there. Passive is like asking a direct question and expecting a direct answer. Now after doing a bit of digging there is lots of data out there for the taking... Here's what I "think" we can get: Passive L/R GForce = TXD { 0x002A } F/B GForce = TXD { 0x002B } Steering degrees L/R = TXD { 0x002D } Brake engagement % = TXD { 0x0038 } Speed (decameters / hour ) = TXD { 0x00BC } Gas pedal position = TXD { 0x024C } Battery Temp = TXD { 0x03C3 } Ignition timining = TXD { 0x052E } EV button (on/off) = TXD { 0x0521 } Gas Fill Level = TXD { 0x05AC } Active Battery SoC = TXD { 0x07E321CE } Battery Temp = TXD { 0x07E321CF } MG 1/2 RPM = TXD { 0x07E221C3 } MG 1/2 RPM = TXD { 0x07E221C4 } Now there is some other stuff like Headlights (on/off) and stuff like that that I'm not that interested in, but this data all looked pretty cool. I haven't gotten that deep into it so don't pepper me with Q's yet, but please help my "Teach Dan XGauge" thread. If you look for the Passive commands and you can't find them, it's because the passive TXD is derived by taking the ID, left padding it with zeros and XOR'ing it wish 0x0008. Now all this is Attila Vass data, so I don't know if Ron has already tried and failed to get these to work, or if he just figured, no prius driver in his right mind would be interested in how many lateral G's he pulls in a turn. I'm obviously not in my right mind GForce sensor is the first one I want to try to get working! Now once I get the TXD working we can work on the rest... Here's my current reference set:Attila Vass Can Dump (Excel) 2way's XGauge Coding walkthru PriusChat XGauge Coding walkthru (Passive Can) Prius Tech Info PriusChat Known SGII Glide Bug 11011011
Great thread dan. Can we also write to the can bus. What I am thinking is, can we command engine off when in Neutral. Thus having a glide above 42 MPH.
Alright... First new XGauge is tested and Verified. EV Button ( On / Off ) TXD: 05 21 RXF: 01 05 22 29 00 00 RXD: 31 01 MTH: 00 01 00 01 00 00 NAM: EVb What you'll see on your Gauge is EVb ON EVb OFF And the fun part... It's real-time. No polling delay since it's packet sniffing. I leave it as a homework assignment to decode the logic I used to arrive at the XGauge coding. 11011011
Looks like your doing what I had planed to do. I just got my SG yesterday. After working with the RAW can-view data and the can-decoder software I'm now familiar with the raw CAN hex data and I know how to convert it. I'm Not familiar with the way the xgauge does the converting yet. I think I will need an example of how you get from Vass's info to what the SG displays. I'm sure its simple. I'm really interested seeing the Gforce in real time.
Look through the refereces I listed in the OP and all the XGauge stuff is pretty well explained. Here's the next dump of XGauges. These are blind codes (untested) so I don't know which work: Battery Temp (Max) TXD: 03 C3 RXF: 01 03 02 3B 00 00 RXD: 38 08 MTH: 00 01 00 01 00 00 NAM: BTc Battery Temp (Min) TXD: 03 C3 RXF: 01 03 02 3B 00 00 RXD: 30 08 MTH: 00 01 00 01 00 00 NAM: BTc Left / Right GForce TXD: 00 2A RXF: 01 00 02 22 00 00 RXD: 10 10 MTH: 00 01 00 01 FE 00 NAM: LRg Front / Back GForce TXD: 00 2B RXF: 01 00 02 23 00 00 RXD: 10 10 MTH: 00 01 00 01 FE 00 NAM: FBg Alignment (stear left / right) TXD: 00 2D RXF: 01 00 02 25 00 00 RXD: 10 10 MTH: 00 01 00 01 00 00 NAM: Slr Break Pedal Position TXD: 00 38 RXF: 01 00 02 30 00 00 RXD: 30 08 MTH: 00 64 00 80 00 00 NAM: BPs % 11011011
I just tried out the G force setting while sitting still and here is what I seen. LRg stays at about 3 but if I shake the car the number jumps around a bit. FBg stays at 1 even when I shake the car. I will be leaving for work in about an hour and I will report back with my trip results.
Yeah, it's just a flat hex value. I haven't scaled it to actuall GForce. It should go way positive on a hard left and way negative on a hard right. 11011011
OK.. got another two coded up but untested.... Speed down to the hundredth place. I always disliked the fact that the speedo doesn't have a decimal point. Well now it does. The MTH was tricky on this so I'll actually be surprised if I got it spot on with the first attempt. kph xx.xx TXD: 00 BC RXF: 01 00 42 B4 00 00 RXD: 38 10 MTH: 03 E8 04 00 00 00 NAM: kph xx.xx mph xx.xx TXD: 00 BC RXF: 01 00 42 B4 00 00 RXD: 38 10 MTH: 08 D8 0E 93 00 00 NAM: mph xx.xx
Gforce does work. Only problem is that the SG display rate is way too fast. You might have to divide the data by something to get it to slow down or to get an actual 0.00 gforce value.
All these passive commands are gonna refresh wicked fast. Can't be helped... that's how many canbus packets are flooding the bus. You could do some creative binary shift operations to clip off the last 4 bits or something. That should slow the jitter. 11011011
OK... have three left to do but Left / Right GForce TXD: 00 2A RXF: 01 00 02 22 00 00 RXD: 10 10 MTH: 00 01 00 01 FE 00 NAM: LRg Front / Back GForce TXD: 00 2B RXF: 01 00 02 23 00 00 RXD: 10 10 MTH: 00 01 00 01 FE 00 NAM: FBg Alignment (stear left / right) TXD: 00 2D RXF: 01 00 02 25 00 00 RXD: 10 10 MTH: 00 01 00 01 00 00 NAM: Slr Break Pedal Position TXD: 00 38 RXF: 01 00 02 30 00 00 RXD: 30 08 MTH: 00 64 00 80 00 00 NAM: BPs % Battery AMPs (passive) TXD: 00 33 RXF: 01 00 82 3B 00 00 RXD: 14 0C MTH: 00 01 00 01 00 00 NAM: bta kph xx.xx TXD: 00 BC RXF: 01 00 42 B4 00 00 RXD: 38 10 MTH: 03 E8 04 00 00 00 NAM: kph xx.xx mph xx.xx TXD: 00 BC RXF: 01 00 42 B4 00 00 RXD: 38 10 MTH: 08 D8 0E 93 00 00 NAM: mph xx.xx tps % TXD: 02 4C RXF: 01 02 82 44 00 00 MTD: 40 08 MTH: 00 0A 00 02 00 00 NAM: tps Battery SOC (passive) TXD: 03 C3 RXF: 01 03 02 3B 00 00 RXD: 20 10 MTH: 00 0A 00 02 00 00 NAM: SoC Battery Temp (Max) TXD: 03 C3 RXF: 01 03 02 3B 00 00 RXD: 38 08 MTH: 00 01 00 01 00 00 NAM: BTc Battery Temp (Min) TXD: 03 C3 RXF: 01 03 02 3B 00 00 RXD: 30 08 MTH: 00 01 00 01 00 00 NAM: BTc Battery Volt TXD: 03 C5 ... todo IGN (passive) TXD: 05 2E ... todo WTc (passive) TXD: 05 25 Gas Gauge TXD: 05 AC ... todo EV Button Status TXD: 05 21 RXF: 01 05 22 29 00 00 RXD: 31 01 MTH: 00 01 00 01 00 00 NAM: EVb More later.... 11011011
After looking at the g-force data in real time could the actual g-force readout be the number currently displayed divided by 100 or 200? Dividing by 10 on the values I seen and have captured with my can-view would result in a high number for such low actual g-force. Dividing by 100 gets us to what looks like a real number. According to Vass's data 0x200 is neutral. If going to a negative value of 0x000 that means there is only room for 0x200 of play in g-force. Converted to decimal that would be 512. If you divide 512 by 100 you get 5.12 or a max reading of 5.12 g-force in each direction. This number seems to be about right for measuring the g-force a car will experience. Actually if you was pulling 5g in a car that's a pretty good indication your currently in a crash. I'm still looking into understanding the xgauge so Dan if you want to you may want to divide the g-force data by 100 unless you think it needs to be another divisor. I think I will update my can-view decoder program to do the division of 100.
Cool... Thanks for the test data. I keep thinking of Prius Pilots doing donuts in a mall parking lot trying to calibrate the G-Force gauge Here's the updated gauge that just thunks a decimal where you suggested. GForce to Right x.xx TXD: 00 2A RXF: 01 00 42 22 00 00 RXD: 10 10 MTH: 00 01 00 01 FE 00 NAM: gfr GForce to Back x.xx TXD: 00 2B RXF: 01 00 42 23 00 00 RXD: 10 10 MTH: 00 01 00 01 FE 00 NAM: gfb Stearing (degrees left) xx.xx% TXD: 00 2D RXF: 01 00 42 25 00 00 RXD: 14 0C MTH: 00 64 01 BC 00 00 NAM: sdl Break Pedal Position xx.x % TXD: 00 38 RXF: 01 00 22 30 00 00 RXD: 30 08 MTH: 00 64 00 80 00 00 NAM: bps Battery AMPs (passive) TXD: 00 33 RXF: 01 00 82 3B 00 00 RXD: 14 0C MTH: 00 01 00 01 00 00 NAM: bta kph xx.xx TXD: 00 BC RXF: 01 00 42 B4 00 00 RXD: 38 10 MTH: 03 E8 04 00 00 00 NAM: kph mph xx.xx TXD: 00 BC RXF: 01 00 42 B4 00 00 RXD: 38 10 MTH: 08 D8 0E 93 00 00 NAM: mph tps xx.x% TXD: 02 4C RXF: 01 02 82 44 00 00 MTD: 40 08 MTH: 00 0A 00 02 00 00 NAM: tps Battery SOC (passive) xx.x % TXD: 03 C3 RXF: 01 03 82 CB 00 00 RXD: 20 10 MTH: 00 0A 00 02 00 00 NAM: soc Battery Temp degC (Max / Upper) TXD: 03 C3 RXF: 01 03 02 3B 00 00 RXD: 38 08 MTH: 00 01 00 01 00 00 NAM: buc Battery Temp degC (Min / Lower) TXD: 03 C3 RXF: 01 03 02 3B 00 00 RXD: 30 08 MTH: 00 01 00 01 00 00 NAM: blc Battery Volt (3CD pid) TXD: 03 C5 RXF: 01 03 02 CD 00 00 RXD: 20 10 MTH: 00 01 00 01 00 00 NAM: btv IGN (passive) TXD: 05 2E RXF: 01 05 02 26 00 00 RXD: 18 10 MTH: 00 01 00 01 00 00 NAM: ign WTc (passive) xx.x TXD: 05 25 RXF: 01 05 82 2C 00 00 RXD: 18 08 MTH: 00 0A 00 02 00 00 NAM: wtc Gas Gauge xx.x % TXD: 05 AC RXF: 01 05 82 A4 00 00 RXD: 18 08 MTH: 00 64 00 04 00 00 NAM: gas EV Button Status (on/off) TXD: 05 21 RXF: 01 05 22 29 00 00 RXD: 31 01 MTH: 00 01 00 01 00 00 NAM: evb I'm working on beautifying this into excel right now. 11011011
Hmmmmm That gives me an idea. I wonder if I can get one of my digital scales to work vertically? Tape a 1lbs weight to it, zero it out, do some doughnuts and compare the weight seen with the g-force data. Going in circles .5lbs would be .5g. I might give that a try sometime.
Allright... I've uploaded an Excel file with all the codes I hacked together. My list is by no means exhaustive, but it's better than the dinky three they originally had. Column1Column2Column3Column4Column5Column6Column7GAUGETXDRXFRXDMTHNAMNotesState of Charge07E321CE 056186CE0000 3008000A00020000SOC%Battery Voltage00330100023B00002010000100010000BTVHV Battery VoltsBattery Current07E321CE056186CE000038100001000AF333BTAHV Battery AmpsGForce to Right002A010042220000101000010001FE00gfrx.xx G's scaling a guessGForce to Back002B010042230000101000010001FE00gfbx.xx G's scaling a guessStearing002D010042250000140C006401BC0000sdlDegrees left xx.xx %Brake Pedal Position00380100823000003008006400800000bpsxx.x % depressionBattery Current00330100823B0000140C000100010000btaPassive CAN requestKilometers per Hour00BC010042B40000381003E804000000kphxx.xx kphMiles per Hour00BC010042B40000381008D80E930000mphxx.xx mphGas Pedal Position024C0102824400004008000A00020000gpsxx.x % depressionState of Charge03C3010382CB00002010000A00020000socPassive CAN requestBattery Temp (upper read)03C30103023B00003808000100010000buc°C max for the 5 ms cycleBattery Temp (lower read)03C30103023B00003008000100010000blc°C min for the 5 ms cycleBattery Voltage03C5010302CD00002010000100010000btv3CD pid readingIgnition degrees before TDC052E0105022600001810000100010000ignPassive CAN requestEV Button Status05210105222900003101000100010000evbEV button ON or OFFEngine Coolant Temp05250105822C00001808000A00020000wtcxx.x °CGas Gauge05AC010582A400001808006400040000gasxx.x % full 11011011
Updated the Excel file with all the codes. Code: CHANGELOG: v1.0 - 06-29-08: Initial Release. v1.1 - 06-29-08: Added Download Link. v1.2 - 06-29-08: Corrected Brake Pedal Position Added °F for all the °C readings Added Engine temp gauge (not coolant temp) Added Jitter Reduction (clipped last bit) Added Jitter Reduction (clipped last 2 bits) The Jitter reduction has to do with how fast the gauges refresh. The digits blur, so the x2 reduction clips the last bit, so you only get refreshes (on average) half the time. The x4 reduction clips the last two bits, so you only get a refresh (on average) 25% of the time. 11011011
Awsome! I just figured out how to get the TXD and MTH. I'm having a little trouble understanding RXF and RXD.