ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_InternalSensor: fix imu temprature

Open HefnySco opened this issue 2 years ago • 9 comments

This is a proposed solution for this issue

adding is_internal_imu to know if imu is internal or not. _min_internal_imu_index is initialized with max instance and later is updated by least index of an internal imu.

HefnySco avatar Jan 26 '23 19:01 HefnySco

@IamPete1 kindly advise

HefnySco avatar Jan 30 '23 09:01 HefnySco

Looks like a valid fix, I was hoping to do a bit more of a structural re-work.

sure... but at least this solves the issue.

HefnySco avatar Jan 31 '23 20:01 HefnySco

@IamPete1 Kindly advise what changes are requires to pass this fix. I still see that if it fix the issue then it is better than the current status.

HefnySco avatar Feb 03 '23 09:02 HefnySco

@khancyr based on what I understand from the code function _publish_temperature is called from each IMU driver. so drivers that have no temperature sensors should not call it. And the implemented logic in this function is to take the least -non-external- imu index as a temperature reference.

HefnySco avatar Feb 04 '23 16:02 HefnySco

For example the Cube has three IMUS, each has a temperature sensor so will call _publish_temperature However only the first two IMUS are mounted near the heater, the third IMU is mounted somewhere else. For example:

image

IamPete1 avatar Feb 04 '23 18:02 IamPete1

@IamPete1 @khancyr Thank you for describing this issue.

I updated the proposed solution to do the following: if you give value to INS_DEFAULT_TEMP_INSTANCES then it will be the only temprature source. this will solve similar issues as the one you described. if you leave things as is it will use the least index of non-extrrnal imus.

HefnySco avatar Feb 04 '23 19:02 HefnySco

INS_DEFAULT_TEMP_INSTANCES will allow the designer to select the most suitable sensor for controlling the heater.

HefnySco avatar Feb 04 '23 19:02 HefnySco

@IamPete1 Kindly advise

HefnySco avatar Feb 23 '23 05:02 HefnySco

Ping @IamPete1 - question asked on this one.

Looks like we might still have issues.

peterbarker avatar Sep 11 '24 12:09 peterbarker