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

Difference between code and datasheet #29

Open
Piero01 opened this issue Feb 17, 2021 · 4 comments
Open

Difference between code and datasheet #29

Piero01 opened this issue Feb 17, 2021 · 4 comments
Assignees

Comments

@Piero01
Copy link

Piero01 commented Feb 17, 2021

Hello,
It seems there are some differences regarding the datasheet and the example library:

  1. In datasheet p31: in the 3rd iteration the end result is obtained but in the library 5 iterations are made cfr. mlx90632.c lines 403 and 434. How many iterations should be done then? Is there an advantage to make more iterations?
  2. In datasheet p30 and p34, the S_TO value is computed with only 1 value of S = (RAM_4 + RAM_5) / 2 (for cycle_pos = 1), RAM_7 and RAM_8 are not used.
    In the code function mlx90632_preprocess_temp_object(), line284:
    return ((((object_new_raw + object_old_raw) / 2) / (MLX90632_REF_12)) / VR_IR) * 524288.0;
    it is using object_new_raw = (RAM_4 + RAM_5) / 2 and object_old_raw = (RAM_7 + RAM_8) / 2 (for cycle_pos = 1).
    What should be done finally? Is the code up-to-date with the datasheet? Should I follow the datasheet or the code?

Thanks.

@Letme
Copy link
Member

Letme commented Feb 17, 2021

Which eeprom version do you have in chip and which version are you looking at in datasheet?

@Piero01
Copy link
Author

Piero01 commented Feb 18, 2021

EE_VERSION on chip returns 0x8305.
I'm using the datasheet from Melexis website: revision 10 - November 2020.

@Letme
Copy link
Member

Letme commented Feb 18, 2021

  1. The iterations usually converge, so from 3 to 5 iterations may be some last digits might change - usually they don't, so for speed-wise 3 iterations are enough. Seems like the datasheet was updated with this in mind. I will check internally about the change.

  2. For the calculations, it indeed seems like we average it once too many. I doubt there is much difference as most values are quite stable - maybe +/- 1 difference, but it indeed seems discrepancy. Will also check about the latest developments in this topic.

Thanks for a detailed review of the implementation.

@slavysis
Copy link
Collaborator

Hi,

  1. 3 iterations should be enough as @Letme pointed out, more iterations will change some of the last digits - it should be more apparent for the high temperatures, but the effect is negligible.
  2. Basically, you can use both approaches (as described in the DS and as implemented in the driver). The datasheet gives a more direct calculation whereas the driver implements a simple moving average filter. The difference between the two would be that the driver implementation would have a bit less noise, but in certain cases (sudden changes in the object temperature) it will react a bit slower.

Best regards

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

3 participants