Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displayed power is not correct #293

Open
jetronic18s opened this issue Jul 15, 2024 · 6 comments
Open

Displayed power is not correct #293

jetronic18s opened this issue Jul 15, 2024 · 6 comments

Comments

@jetronic18s
Copy link

jetronic18s commented Jul 15, 2024

I have just noticed that the displayed power is not correct.
62,61V * 0,04A = 2,5 W not 86,25W

grafik

Hardware/Software Versions
Controller version (from PCB): 4.4
Processor: ESP32
Version: f210e5b
Compiled: 2024-05-03T13:10:31.733Z
Language: de

My Shunt is a diyBMS-CurrentShunt with INA 228 and a 500A / 50mV Shunt

@jetronic18s
Copy link
Author

jetronic18s commented Jul 15, 2024

It must have been the same in the last official release. Huh?

Edith:
At slightly higher currents the values fit.
Does anyone have any idea why it shows this offset at close to 0A?

@midopple
Copy link

Hi,

here is an closed Issue for this error

#240

in the next release this should be fixed

@jetronic18s
Copy link
Author

Thanks for the tip, yes it looks exactly like mine.
Except that I have an external shunt with INA228.

I am running the latest firmware from Branch “stateofhealth”. there is no fix yet.

@midopple
Copy link

Hi,

I overlooked the fact that an external shunt is used, in this case the values are already calculated in the shunt and transmitted via RS485.

This is why the change in the software does not work here.

the calculation in the firmware of the shunt would have to be adjusted so that this is calculated correctly at low power levels.

I think the code should change like the follow example.
I do not have an external Shunt so i can't test it.

diyBMS-CurrentShunt/Code/diybmsCurrentShunt/src/main.cpp

Line 1160

double Power()
{
  
  double busVoltage = BusVoltage();
  double current = Current();
  double pow_val = busVoltage * abs(current); 
  
  if(pow_val < 200){
	return(pow_val);
  }
  else{
    // POWER Power [W] = 3.2 x CURRENT_LSB x POWER
    return (double)i2c_readUint24(INA_REGISTER::POWER) * (double)3.2 * registers.CURRENT_LSB;
  }
}

@jetronic18s
Copy link
Author

Thanks, I'll have a look at it and try to compile it.

Unfortunately I don't have direct access to the installation with the external shunt. I might be on site in 6 or 8 weeks.

You would probably have to move the issue to the shunt repo. Only @stuartpittaway can do that

@jetronic18s
Copy link
Author

jetronic18s commented Jul 18, 2024

@midopple
I have installed your fix, here is the hex file (for the external Shunt) and patch file attached.
Compiled_Firmware_Workaround.zip

Would anyone like to test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants