• We are having a problem with new Hotmail members being unable to receive activation emails. Please avoid using a Hotmail email address. Thanks.

MG ZS EV ECU data via the Torque Pro app

I'll get in on helping with this too soon.
I've been querying directly via a serial terminal and getting some of the data back and then figuring out what to do to covert it to meaningful data. I was thinking of making my own app at some point, but if can do it all via Torque Pro then there's no point.

Quick question that may save me some time. What APK file are you using? Could you share the file somewhere?
I'm an Apple man unfortunately and torque pro isn't available on it anymore. The only android devices I have are Amazon Fire's, I can install android apps on it (like the Thai app) but I need the APK file directly to do it - I got hold of the torque pro apk from a couple of sources but couldn't get it to connect to the car. If you could upload the apk file you're using for me to install that'd be great.
 
I've just gone through the csv, all the formulas in it make sense in terms of the possible values that can represent.
It is better using the built in INT16, INT32 functions.

I've read that for temperature, it's kinda of standard practice to minus 40 in order to represent all normal possible values (-40 to 216)

Battery Current Amps: using (INT16(A:B) - 40000) * 0.25 / 10
Kinda makes sense..
(2bytes is max 65536)
Amps can be positive and negative values not massively different -50 vs 200, so kinda half of the values needed for positive and half for negative, but rather than subtract half (32,768), they've used a nice round number of 40,000. In theory you'd expect higher positive values than negative values so subtracting 30,000 may have made more sense, but by using 40(k) they're sticking to the "standard".
Max 65536 - 40000 = 25536, which if they'd have just said is to 1 decimal place (/10) would have given a maximum possible value of 2553.6, which I'd have thought is plentiful. But they've decided to go for 1/40....

Volts is using /4 formula (*0.25)
65536 if it was to 2 decimal places (/100) would "only" give a max value of 655.36 which is probably a bit close to what's possible in an EV.
65536 if it was to 1 decimal places (/10) would give a max value of 6553.6 which is massive, but perfectly good enough still getting an accuracy of 0.1
But, they've gone with, 65536 /4 giving a max value of 16384 giving an accuracy of 0.25
Conclusion, they very much like the number 4!!!!!!!!!

Now, if you've got to here you probably wish you hadn't read of that brain dump :p
 
Last edited:
@nix Is there a reason for the ABS function on the speed formula?
Sorry if it's obvious I've not got the app running yet, just looking at the csv.

Any thoughts as to why a couple of the formulas use - 32767 and not 32768?

Face TEMP (22E013) (INT16(A:B) / 10) - 30
Are we sure it's not -40 rather than -30, as that's very different to normal...

Edit. Just noticed tyre temps formula doesn't do a -40, I'm surprised as in theory it could be negative couldn't it?
Edit Edit! I just used the Thai app at 10pm and it reports my tyre temps at 28-32c whereas outside temp now is 14c/battery temp 22c...

I think that's all the thoughts I've had now lol!
(I know a lot of this has just been taken from OMVS so may not be known!)
 
Last edited:
I've just gone through the csv, all the formulas in it make sense in terms of the possible values that can represent.
It is better using the built in INT16, INT32 functions.

I've read that for temperature, it's kinda of standard practice to minus 40 in order to represent all normal possible values (-40 to 216)

Battery Current Amps: using (INT16(A:B) - 40000) * 0.25 / 10
Kinda makes sense..
(2bytes is max 65536)
Amps can be positive and negative values not massively different -50 vs 200, so kinda half of the values needed for positive and half for negative, but rather than subtract half (32,768), they've used a nice round number of 40,000. In theory you'd expect higher positive values than negative values so subtracting 30,000 may have made more sense, but by using 40(k) they're sticking to the "standard".
Max 65536 - 40000 = 25536, which if they'd have just said is to 1 decimal place (/10) would have given a maximum possible value of 2553.6, which I'd have thought is plentiful. But they've decided to go for 1/40....

Volts is using /4 formula (*0.25)
65536 if it was to 2 decimal places (/100) would "only" give a max value of 655.36 which is probably a bit close to what's possible in an EV.
65536 if it was to 1 decimal places (/10) would give a max value of 6553.6 which is massive, but perfectly good enough still getting an accuracy of 0.1
But, they've gone with, 65536 /4 giving a max value of 16384 giving an accuracy of 0.25
Conclusion, they very much like the number 4!!!!!!!!!

Now, if you've got to here you probably wish you hadn't read of that brain dump :p
Hi @JodyS21
On the contrary, I very much enjoyed reading your brain dump over my morning coffee as I'd very much had my "poke at it until it works, then test after the kids are asleep" hat on until now, and hadn't put my engineering hat on and asked myself "why would they be using formulas like this on these counters?" Thanks for the analysis!
 
@nix Is there a reason for the ABS function on the speed formula?
@JodyS21 you will note that for RPM I have two counters, one which reports the values directly, and go negative if you are reversing, and the other ABS() value which is suitable for a Gauge display:
"001_Engine Speed Real","RPM Real","0x22b402","INT16(A:B) - 32767)",-1000,10000,"rpm","7E3","","",1
"001_Engine Speed","RPM",,"ABS(VAL{001_Engine Speed Real})",0,10000,"rpm",,"","",1

For Speed I got lazy and applied ABS() directly as a negative speed isn't really useful in most circumstances (speed in reverse should still be a positive value IMO), however if you'd like me to split it into two, I easily can:
"001_Vehicle Speed","Speed","0x22ba00","ABS((INT16(A:B)- 20000)/100)",0,160,"km/h","7E3","","",1
 
--snip--
Face Temp (22E013) (INT16(A:B) / 10) - 30
Are we sure it's not -40 rather than -30, as that's very different to normal...

Edit. Just noticed tyre temps formula doesn't do a -40, I'm surprised as in theory it could be negative couldn't it?
Edit Edit! I just used the Thai app at 10pm and it reports my tyre temps at 28-32c whereas outside temp now is 14c/battery temp 22c...
@JodyS21 I've had another look at the various temp readings on my car and they seem to all be in the correct ranges at present and Face Temp seems to adjust up and down within a range that's not unrealistic although I haven't checked it with a thermometer.

Can you please double check the temps on your vehicle as your tire temps may vary wildly from outside temp if you've for example had a long drive home, and then the outside temp dives but the tires are still warm. I suspect that compressed air insulated inside rubber behaves quite differently to the outside atmosphere.

I'm very happy to take corrections, it's just that these now look ok to me..
 
Hi,

James here.

Thanks for all the top notch work with getting the ZS EV to connect with Torque Pro.

Working very well for me.

Is there any news with regard to getting it to talk with ABRP?
Would love to have this sorted by the time we are allowed on long trips.

TIA

James
 
Hi @JodyS21
On the contrary, I very much enjoyed reading your brain dump over my morning coffee as I'd very much had my "poke at it until it works, then test after the kids are asleep" hat on until now, and hadn't put my engineering hat on and asked myself "why would they be using formulas like this on these counters?" Thanks for the analysis!
I can send you daily my evening brain dumps and then there'll be there for you to read over breakfast daily lol
 
@JodyS21 you will note that for RPM I have two counters, one which reports the values directly, and go negative if you are reversing, and the other ABS() value which is suitable for a Gauge display:
"001_Engine Speed Real","RPM Real","0x22b402","INT16(A:B) - 32767)",-1000,10000,"rpm","7E3","","",1
"001_Engine Speed","RPM",,"ABS(VAL{001_Engine Speed Real})",0,10000,"rpm",,"","",1

For Speed I got lazy and applied ABS() directly as a negative speed isn't really useful in most circumstances (speed in reverse should still be a positive value IMO), however if you'd like me to split it into two, I easily can:
"001_Vehicle Speed","Speed","0x22ba00","ABS((INT16(A:B)- 20000)/100)",0,160,"km/h","7E3","","",1
I wasn't sure what the ABS function did.
I think I agree with you, speed and revs should always show as a positive on a gauge.

I assume, please correct me, all of the csv entries are data that is then available to put onto a dash screen, it is then up to you which data you choose to use on a dash screen. Importantly, does it only get the data for what's on the dash screen - wouldn't want to overload it and slow it all down.

If it's not going to slow things down etc.
I think we should have the real speed and real rpm data points available to select, as well as them as positive values.

It's very frustrating that I can't try it out yet!!!!!!
 
@JodyS21 I've had another look at the various temp readings on my car and they seem to all be in the correct ranges at present and Face Temp seems to adjust up and down within a range that's not unrealistic although I haven't checked it with a thermometer.

Can you please double check the temps on your vehicle as your tire temps may vary wildly from outside temp if you've for example had a long drive home, and then the outside temp dives but the tires are still warm. I suspect that compressed air insulated inside rubber behaves quite differently to the outside atmosphere.

I'm very happy to take corrections, it's just that these now look ok to me..

I can do some temp testing on friday hopefully. It'll only be using the thai app though.

(Car had been sat for several hours, so I'd expect tyre temps to be pretty near to ambient temp by then)
 
I wasn't sure what the ABS function did.
I think I agree with you, speed and revs should always show as a positive on a gauge.

I assume, please correct me, all of the csv entries are data that is then available to put onto a dash screen, it is then up to you which data you choose to use on a dash screen. Importantly, does it only get the data for what's on the dash screen - wouldn't want to overload it and slow it all down.

If it's not going to slow things down etc.
I think we should have the real speed and real rpm data points available to select, as well as them as positive values.

It's very frustrating that I can't try it out yet!!!!!!
@JodyS21 my understanding is that unless you have a PID on a gauge then it's not reading it. I also agree with you that both should be available and that's what I've done, however I'm not reading the PID a second time to run in though ABS, but rather using a "Virtual PID" to re-process the existing data. As you can see, no PID is being read in the third column of the second row in the below example:

"MG Vehicle Speed Actual","Speed","0x22ba00","(INT16(A:B)- 20000)/100",-200,200,"km/h","7E3","","",1
"MG Vehicle Speed","Speed",,"ABS(VAL{MG Vehicle Speed Actual})",0,200,"km/h",,"","",1
 
@JodyS21 my understanding is that unless you have a PID on a gauge then it's not reading it. I also agree with you that both should be available and that's what I've done, however I'm not reading the PID a second time to run in though ABS, but rather using a "Virtual PID" to re-process the existing data. As you can see, no PID is being read in the third column of the second row in the below example:

"MG Vehicle Speed Actual","Speed","0x22ba00","(INT16(A:B)- 20000)/100",-200,200,"km/h","7E3","","",1
"MG Vehicle Speed","Speed",,"ABS(VAL{MG Vehicle Speed Actual})",0,200,"km/h",,"","",1
That raises an interesting point.... Is it clever enough to know that it needs to go and get the "MG Vehicle Speed Actual" data if only the "MG Vehicle Speed" is in a gauge?!?
Agreed you don't want to waste resources to go query the same bit of data twice potentially.
 
Torque Pro is triggering the car alarm (when it is locked) which is problematic.
Any solutions?
 
Need to figure out a way to keep the ECU awake while charging... That way can monitor the charging and upload with at a remote charging point... and read on another phone while waiting in the restaurant.

Pressing stop/start button, while charging and locking from inside, then putting window up is an option but that will use more current than we need.
 
Need to figure out a way to keep the ECU awake while charging... That way can monitor the charging and upload with at a remote charging point... and read on another phone while waiting in the restaurant.

Pressing stop/start button, while charging and locking from inside, then putting window up is an option but that will use more current than we need.
That's what I've done to get around keeping it on but locked. Not ideal.

Try the OMVS guys, I vaguely recall reading something about keeping it alive on their site, may not be possible via Torque Pro though...

I'd like to be able to monitor it whilst charging at home - shouldn't cause a 12v drain problem as will be AC charging which keeps the 12v topped up.
 
@nix
I've still been able to try this all out myself.
I've got some more data though I'd suggest can we add to get via the PIDS - the ECU version numbers.
BUT s it possible to get the data shown in torque pro though as just an ascii value rather than a gauge etc?

f194 looks like returns (from which ever ECU it is directed to) in ascii the version number/name.
So "Mode and PID": 22f194
Header:
761 for ICE ecu
760 for IPK ecu
771 for SCU ecu
e.g. 761[769]:f194 53 31 36 30 36 33 30 2e 30 31 = "S160630.01"
1617913146230.png
 
@nix
I've still been able to try this all out myself.
I've got some more data though I'd suggest can we add to get via the PIDS - the ECU version numbers.
BUT s it possible to get the data shown in torque pro though as just an ascii value rather than a gauge etc?
-snip-
@JodyS21 I have been trying to figure out how to do exactly this and haven't yet been able to convince Torque to display ASCII values. I suspect that a "plugin" as opposed to Extended PIDs" may be required to make this work. Unfortunately the author of Torque has been MIA since circa 2016.
 
Support us by becoming a Premium Member

Latest MG EVs video

New EVs from MG: MG S9 & MG9 plus hot topics from the forums
Subscribe to our YouTube channel
Back
Top Bottom