In the MLX90632 Datasheet, section 11.1.1.2, the pre-calculations indicate that S is either the average of RAM_4 and RAM_5 (called the channel 1 pair), or the average of RAM_7, and RAM_8 (channel 2 pair). However, the function mlx90632_read_temp_object_raw returns two values: object_new_raw, which is the average of a channel pair, and object_old_raw, which is the average of the other channel pair. These two values are eventually fed into mlx90632_preprocess_temp_object which is performing the calculation of S from section 11.1.1.2:
In this function, those two values, which are averages themselves, are averaged again. So the calculation of S, in the code, actually involves averaging all four RAM values together, instead of just two.
In the MLX90632 Datasheet, section 11.1.1.2, the pre-calculations indicate that S is either the average of RAM_4 and RAM_5 (called the channel 1 pair), or the average of RAM_7, and RAM_8 (channel 2 pair). However, the function
mlx90632_read_temp_object_raw
returns two values:object_new_raw
, which is the average of a channel pair, andobject_old_raw
, which is the average of the other channel pair. These two values are eventually fed intomlx90632_preprocess_temp_object
which is performing the calculation of S from section 11.1.1.2:return ((((object_new_raw + object_old_raw) / 2) / (MLX90632_REF_12)) / VR_IR) * 524288.0;
In this function, those two values, which are averages themselves, are averaged again. So the calculation of
S
, in the code, actually involves averaging all four RAM values together, instead of just two.