PID's for Torque Pro app

Vince31

Active Member
Joined
Aug 28, 2020
Messages
90
Reaction score
107
Points
33
Uk, Swindon
Thanks for the work you have done on this as well much appreciated. I have posted in another thread (Torque Pro) and have found that if you want to display the same temp as the car does then you need to select "22bb05" row 25 in your PID list. if I use Ambient Temperature (22e01b) row 29 it displays no value. I have also created a "Cell Variance" virtual PID as @Vince31 did. For anyone who is interested here is the Equation I used. Note my "Long Names" are slightly different to yours.

View attachment 3305

Torque Dashboard

View attachment 3306
If you want to calculate the cell imbalance for the whole battery pack then you have to do it a different way (according to the way MG do it).
First you need to calculate the delta voltage for each CMU pack 1 to 9, this can be done as follows for CMU1, then just do the same for the rest up to CMU9:
CMU1 Delta, 22b001, equation INT16(C:D)/2000 - INT16(A:B)/2000, header 781
CMU2 is 22b009, CMU3 is 011, CMU4 is 019,CMU5 is 021, CMU6 is 029, CMU7 is 0a3, CMU8 is 0ab, CMU9 is 0b3.
Then you need to create a new virtual PID to add up all of these and then divide by 9 to give the average delta for the pack. MG say this is the value used to determine the pack imbalance, if its over 0.100 v then the light will come on the dash telling you to slow charge. Mine is 0.020 v.
As you will see its a different value to the simple Cell Delta calculation, which means nothing really.

The battery Charge/Discharge rate is also a simple calculation using Battery Volts x Amps as follows:
(VAL{MG_HV_Battery_Volts}VAL{MG_HV_Current}/1000)-1
Substitute your own PIDs into the equation above. the minus 1 at the end converts the display so that it correctly shows minus values when discharging and positive values when charging. Works great when sat on a Rapid charger.
 
Joined
Oct 31, 2020
Messages
41
Reaction score
44
Points
21
Norway
Many thanks for the info much appreciated. Certainly see the logic of getting the cell variance using values form all the packs, be intersting to see what the difference is when all packs are used. (y)
 
Joined
Oct 31, 2020
Messages
41
Reaction score
44
Points
21
Norway
If you want to calculate the cell imbalance for the whole battery pack then you have to do it a different way (according to the way MG do it).
First you need to calculate the delta voltage for each CMU pack 1 to 9, this can be done as follows for CMU1, then just do the same for the rest up to CMU9:
CMU1 Delta, 22b001, equation INT16(C:D)/2000 - INT16(A:B)/2000, header 781
CMU2 is 22b009, CMU3 is 011, CMU4 is 019,CMU5 is 021, CMU6 is 029, CMU7 is 0a3, CMU8 is 0ab, CMU9 is 0b3.
Then you need to create a new virtual PID to add up all of these and then divide by 9 to give the average delta for the pack. MG say this is the value used to determine the pack imbalance, if its over 0.100 v then the light will come on the dash telling you to slow charge. Mine is 0.020 v.
As you will see its a different value to the simple Cell Delta calculation, which means nothing really.

The battery Charge/Discharge rate is also a simple calculation using Battery Volts x Amps as follows:
(VAL{MG_HV_Battery_Volts}VAL{MG_HV_Current}/1000)-1
Substitute your own PIDs into the equation above. the minus 1 at the end converts the display so that it correctly shows minus values when discharging and positive values when charging. Works great when sat on a Rapid charger.
Hi again. have tried to calculate the charge/discharge rate, but I get a Zero value for both PID's I have used for HV_Current. I have tried:

22b043 min val -200.0 max val 200.0 unit A Equation (INT16(A:B) - 40000) * 0.25 / 10 Header 781
and
22b043 min val -200.0 max val 200.0 unit A Equation ((((A*256)+B)0.025)-1000)(SQRT(B)/SQRT(B)) Header 781
Do you have an alternative PID I can use or a fix for the above equations? Thanks in advance for help.
 
Joined
Oct 31, 2020
Messages
41
Reaction score
44
Points
21
Norway
I have managed to get the HV Battery Current PID working in Torque. I checked the value with the Thai app and its the same.

This is the PID I have added:

"Name" MG HV Battery Current
"ShortName" Current
"ModeAndPID" 22b043
"Equation" (INT16(A:B) - 40000) * 0.25 / 10
"Min Value" -200
"Max Value" 200 "Units" A
"Header" 781
"startDiagnostic"
"stopDiagnostic"
"Scale" 1
 

Vince31

Active Member
Joined
Aug 28, 2020
Messages
90
Reaction score
107
Points
33
Uk, Swindon
Yes that is the correct PID and equation for current.
You now need to create a new PID:
"Name" MG Charge_Discharge Rate
"ShortName" Charge
"ModeAndPID" (Leave this blank)
"Equation" (VAL{MG HV Battery Volts} * VAL{MG HV Battery Current}/1000) * -1
"Min Value" -80
"Max Value" 80
"Units" Kw
"Header" (Leave this blank)
"startDiagnostic"
"stopDiagnostic"
"Scale" 1

If you create a new gauge (I use the Half Dial (Needle)) and map it to this new PID then it should show you the Charge rate. This type of PID is called a virtual PID because it does not refer to a raw ECU command address, but uses data from one or more other PIDs to give a calculated result based on your equation.
 
Last edited:

Bluecruiser

Standard Member
Joined
Feb 2, 2021
Messages
19
Reaction score
7
Points
3
Princes Risberough
Hi @Vince31
In-fact the file you've used is a historical one that I received part-way through development from the Thai ZS EV user group. My PID list is called "MG ZS EV.csv" (as you can see in the instructions) and it does not have any leading dots. It also already contains a Virtual PID called "MG BMS Voltage Delta" which should give you the info you are looking for :)
 

Bluecruiser

Standard Member
Joined
Feb 2, 2021
Messages
19
Reaction score
7
Points
3
Princes Risberough
Hi @Vince31
In-fact the file you've used is a historical one that I received part-way through development from the Thai ZS EV user group. My PID list is called "MG ZS EV.csv" (as you can see in the instructions) and it does not have any leading dots. It also already contains a Virtual PID called "MG BMS Voltage Delta" which should give you the info you are looking for :)
Can you. Tell me where to put the PID please as all I can see on tourqe pro after opening hidden files and encles screen shot any help would be great please
 

Attachments

  • Screenshot_20210527_172325_com.huawei.hidisk.jpg
    Screenshot_20210527_172325_com.huawei.hidisk.jpg
    75.7 KB · Views: 85

Vince31

Active Member
Joined
Aug 28, 2020
Messages
90
Reaction score
107
Points
33
Uk, Swindon
Can you. Tell me where to put the PID please as all I can see on tourqe pro after opening hidden files and encles screen shot any help would be great please
Try creating a new folder in there called extendedpids, and then paste the PIDs in there. In mine the folder already exists.
 

Bluecruiser

Standard Member
Joined
Feb 2, 2021
Messages
19
Reaction score
7
Points
3
Princes Risberough
Yes that is the correct PID and equation for current.
You now need to create a new PID:
"Name" MG Charge_Discharge Rate
"ShortName" Charge
"ModeAndPID" (Leave this blank)
"Equation" (VAL{MG HV Battery Volts}VAL{MG HV Battery Current}/1000)-1
"Min Value" -80
"Max Value" 80
"Units" Kw
"Header" (Leave this blank)
"startDiagnostic"
"stopDiagnostic"
"Scale" 1

If you create a new gauge (I use the Half Dial (Needle)) and map it to this new PID then it should show you the Charge rate. This type of PID is called a virtual PID because it does not refer to a raw ECU command address, but uses data from one or more other PIDs to give a calculated result based on your equation.
i have downloaded the pids on to tourqe pro the full list earlier do i also need to addon as well the two extra pids the one you did and the one john in the post before you did..
thank you for your help on this really appreciate as unsure so better to ask.
 

Bluecruiser

Standard Member
Joined
Feb 2, 2021
Messages
19
Reaction score
7
Points
3
Princes Risberough
I'm in UK (Swindon) and use the UK specific PIDs available from the MGZSEV Owners Facebook group. I think you may be using different PIDs.
Have not done yet as know they said Australian mg so though ask as that's why I asked so will see if I can find uk pid S then and the two pids that you and jhon g did those two have to be added as well thanks again
 
Joined
Oct 31, 2020
Messages
41
Reaction score
44
Points
21
Norway
If you want to calculate the cell imbalance for the whole battery pack then you have to do it a different way (according to the way MG do it).
First you need to calculate the delta voltage for each CMU pack 1 to 9, this can be done as follows for CMU1, then just do the same for the rest up to CMU9:
CMU1 Delta, 22b001, equation INT16(C:D)/2000 - INT16(A:B)/2000, header 781
CMU2 is 22b009, CMU3 is 011, CMU4 is 019,CMU5 is 021, CMU6 is 029, CMU7 is 0a3, CMU8 is 0ab, CMU9 is 0b3.
Then you need to create a new virtual PID to add up all of these and then divide by 9 to give the average delta for the pack. MG say this is the value used to determine the pack imbalance, if its over 0.100 v then the light will come on the dash telling you to slow charge. Mine is 0.020 v.
As you will see its a different value to the simple Cell Delta calculation, which means nothing really.

The battery Charge/Discharge rate is also a simple calculation using Battery Volts x Amps as follows:
(VAL{MG_HV_Battery_Volts}VAL{MG_HV_Current}/1000)-1
Substitute your own PIDs into the equation above. the minus 1 at the end converts the display so that it correctly shows minus values when discharging and positive values when charging. Works great when sat on a Rapid charger.
The battery charge rate PID calculation in your example appears to not be correct. This is what I got working (VAL{MG_HV_Battery_Volts} * VAL{MG_HV_Current}/1000)-1 the multiply symbol "" needs to be added between the 2 values and and after "1000)"

I have also added a new Cell Inbalance guage using your example that sums each pack and then is divided by 9 which shows an inbalance of 6.7mV with SoC around 16%.

Charging Value kW.JPG
 

Vince31

Active Member
Joined
Aug 28, 2020
Messages
90
Reaction score
107
Points
33
Uk, Swindon
Sorry typo in the equation: (VAL{MG_HV_Battery_Volts} * VAL{MG_HV_Current}/1000) * -1 As you can see added the "*" symbol
Yes, The PID equation I use in Torque Pro has the multiplication (x2) as you show, looks like I missed them out when typing it again for you, sorry
 

Danielecalabrese

Novice Member
Joined
Jan 30, 2021
Messages
14
Reaction score
0
Points
1
Bangkok
Can I find somewhere the pod files you are referring to with the new calculation or shall we follow the post and do it manually ourselves?
 

Danielecalabrese

Novice Member
Joined
Jan 30, 2021
Messages
14
Reaction score
0
Points
1
Bangkok
Thanks. Does have anyone had UI files for torque to tablet landscape? The UI for with the gauge seem to be only for phone portrait
 

rbpasapera

Active Member
Joined
Sep 10, 2020
Messages
263
Reaction score
260
Points
66
Costa Rica
Driving
MG ZS EV
Hello EV friends!

Downloaded pids from github.com/peternixon and I can't find the battery power sensor, tried MG Charging Rate (kW) but the readings were not very accurate.

Edit: deleted the *-1 in the pid equation so that it can show Power = Volts x Amps
 
Last edited:
Support us by becoming a Premium Member

Latest MG EVs video

MG ZS EV delivery updates and MG5 refresh review
Subscribe to our YouTube channel
Top Bottom