OpenXSensor HoTT Temperature

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
gravity
Posts: 8
Joined: Wed Feb 21, 2018 10:16 pm
Country: -

OpenXSensor HoTT Temperature

Post by gravity » Wed Feb 21, 2018 10:26 pm

Hello Folks.
Does anyone know how to use 2 NTC sensors from temperature?
I only have one temperature gauge working. My plane has 2 Gas engines.

Thank you.
oXs_config_advanced.h
(18.52 KiB) Downloaded 53 times
oXs_config_basic.h
(11.17 KiB) Downloaded 116 times

mstrens
Posts: 1190
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by mstrens » Thu Feb 22, 2018 8:15 am

In file advanced you made several mistakes.
Please read the file oXs_config_description.h
About NTC sensors it says:
* oXs reuses the mVolt calculated by oXs. The config must be adapted in a such a way that this mVolt is equal to the raw value returned by the ADC * 1000 (for better accuracy)
* Therefore, in section 6.1 and 6.2 ,
* USE_INTERNAL_REFERENCE must be as comment (so with // in front off)
* USE_EXTERNAL_REFERENCE must be as comment (so with // in front off)
* REFERENCE_VOLTAGE must be as comment (so with // in front off)
* RESISTOR_TO_GROUND must be set on 0 (for the index being used)
* OFFSET_VOLTAGE must (normally) be set on 0 (for the index being used)
* SCALE_VOLTAGE must be set on 204.6 (=1000 * 1023/5000) (for the index being used)
* Then you have to define some parameters in section 6.4
* FIRST_NTC_ON_VOLT_NR specify index of first voltage being used for conversion to temperature (e.g. 3 means VOLT_3) (so it is not the code of analog pin; this one is define in section 6.2)
* LAST_NTC_ON_VOLT_NR specify index of last voltage being used for conversion to temperature (e.g. 5 means VOLT_5)
* In this expample, it means that you expect to measure 3 temperatures based on NTC connected to the pins used for VOLT_3, VOLT_4 and VOLT_5
* note: if you use only one NTC, you must specify the same value for FIRST_NTC_ON_VOLT_NR and for LAST_NTC_ON_VOLT_NR
* if you do not use NTC, keep this line as comment
* SERIE_RESISTOR specify the resitance (in Ohm) connected between Arduino Vcc and NTC (and analog pin); select a value nearly equal to the resistance of NTC in the range of temperature you expect best accuracy

Here the corrections:
1) this line should be as comment (as said here above)
#define REFERENCE_VOLTAGE 3300 // set value in milliVolt; if commented, oXs will use or 1100 (if internal ref is used) or 5000 (if internal ref is not used)
becoming
//#define REFERENCE_VOLTAGE 3300 // set value in milliVolt; if commented, oXs will use or 1100 (if internal ref is used) or 5000 (if internal ref is not used)


2) There are 2 small (but important) typo fout.
You currently have:
#define FIRST_NTC_ON_VOLT_NR_1 // uncomment this line when thermistor are used; specify index of first voltage being used for conversion to temperature (e.g. 5 means VOLT_5)
#define LAST_NTC_ON_VOLT_NR_2 // specify index of last voltage being used for conversion to temperature (e.g. 6 means VOLT_6)

You can see that you have a "_" between NR and the digit. Then the compiler consider the digit as part of the name.

You should have space(s) instead. So it should be.
#define FIRST_NTC_ON_VOLT_NR 1 // uncomment this line when thermistor are used; specify index of first voltage being used for conversion to temperature (e.g. 5 means VOLT_5)
#define LAST_NTC_ON_VOLT_NR 2 // specify index of last voltage being used for conversion to temperature (e.g. 6 means VOLT_6)

3) The program has to know which arduino pin are connected to the NTC. This has to be done in line
#define PIN_VOLTAGE 0 , 8 , 8 , 8 , 8 , 8 // Fill 6 values; set to 0 up to 7 for analog pins A0 up to A7 ; set the value to 8 for the voltage(s) not to be measured.
But in you line, you only specified one pin for VOLT_1.
You have to specify too the pin used for VOLT2. If you connect it to pin A1, the line should become
#define PIN_VOLTAGE 0 , 1 , 8 , 8 , 8 , 8

4) Resistor to ground must be set to 0. (see above)
You have
#define RESISTOR_TO_GROUND 0 , 10 , 10 , 10 , 0 , 0
It should be
#define RESISTOR_TO_GROUND 0 , 0 , 10 , 10 , 0 , 0

5) Scale voltage must be set to 204.6
You have
#define SCALE_VOLTAGE 310.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0
It should be
#define SCALE_VOLTAGE 204.6 , 204.6 , 1.0 , 1.0 , 1.0 , 1.0

6) In the file basic, you also have this line
#define NUMBEROFCELLS 1
This line should be put as comment because you do not measure cell voltages.

Let already try those changes.
I presume it should be ok.
If not let me know.

gravity
Posts: 8
Joined: Wed Feb 21, 2018 10:16 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by gravity » Thu Feb 22, 2018 8:12 pm

I have followed your instructions.

Now 2 temperatures are displayed but they are not correct and are crazy.
At the SCALE_VOLTAGE value of 204.6, temperatures of ~150 ° C are displayed in the cold basement. I think 15 ° would be correct.

Changes at the SCALE_VOLTAGE shift the temperature but then the temperatures Jump from -17 to 222 ° like Crasy.

What value does the decimal point of the temperature shift?

Oh, that's one 5V Arduino and 2 100k OHM NTC.
oXs_config_description.h
(112.2 KiB) Downloaded 101 times
oXs_config_basic.h
(11.17 KiB) Downloaded 112 times

mstrens
Posts: 1190
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by mstrens » Thu Feb 22, 2018 8:53 pm

Perhaps there is a bug in oXs.
Perhaps temperature is calculated internally with 1 decimal and the Hott protocol does not accept one decimal.
In file oXs_out_hott.cpp, there is a line with
TxHottData.gamMsg.temperature1 = (voltageData->mVolt[TEMPERATURE_1_SOURCE - VOLT_1].value ) + 20 ; // Hott applies an offset of 20. A value of 20 = 0°C

Can you try to change it by this (so adding "/ 10 "
TxHottData.gamMsg.temperature1 = (voltageData->mVolt[TEMPERATURE_1_SOURCE - VOLT_1].value ) / 10 + 20 ; // Hott applies an offset of 20. A value of 20 = 0°C

Let me know if it solves the issue for temperature .
Note : use the recommended scale voltage of 204.6.
If it is ok for temperature 1, then you should change in the same way the line of code for temperature 2. It is
TxHottData.gamMsg.temperature2 = (voltageData->mVolt[TEMPERATURE_2_SOURCE - VOLT_1].value ) + 20 ; // Hott applies an offset of 20. A value of 20 = 0°C

gravity
Posts: 8
Joined: Wed Feb 21, 2018 10:16 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by gravity » Thu Feb 22, 2018 9:40 pm

It can be.
I remeber at Cleanflight (GPS Speed) it was exactly the same, there the comma was not understood.
My copter threatens to break the sound barrier. ;)

Proposal has brought me close to realistic values ​​but this information is not useful.
Reminds more of a random generator. ;)
https://youtu.be/BsAiUJdVf7k

https://youtu.be/WhclVzHr42o
#define FIRST_NTC_ON_VOLT_NR 0
#define LAST_NTC_ON_VOLT_NR 0


mstrens
Posts: 1190
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by mstrens » Thu Feb 22, 2018 10:34 pm

Can you send me your latest config files (basic and advanced).
In previous post you put the file description but not the advanced.

gravity
Posts: 8
Joined: Wed Feb 21, 2018 10:16 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by gravity » Thu Feb 22, 2018 10:44 pm

Sorry
oXs_config_basic.h
(11.17 KiB) Downloaded 130 times
oXs_config_advanced.h
(18.51 KiB) Downloaded 49 times
#define LAST_NTC_ON_VOLT_NR 0 must be 1, That was just a test

mstrens
Posts: 1190
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by mstrens » Thu Feb 22, 2018 11:04 pm

You currently have
#define FIRST_NTC_ON_VOLT_NR 0
#define LAST_NTC_ON_VOLT_NR 0

It must be
#define FIRST_NTC_ON_VOLT_NR 1
#define LAST_NTC_ON_VOLT_NR 2

Please try this

gravity
Posts: 8
Joined: Wed Feb 21, 2018 10:16 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by gravity » Fri Feb 23, 2018 7:01 am

Good Morning.

I've already experimented with the values.
This is what it looks like when I set the values.
I have put the divider into the hott.cpp

https://youtu.be/nWiNEDhtQ54

mstrens
Posts: 1190
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by mstrens » Fri Feb 23, 2018 7:28 am

This is strange. It looks like the voltage measured by arduino changes a lot.
Do you have have the right connection to Arduino pins.
You should have
- one pin of NTC 1 connected to Gnd
- the other pin of NTC 1 connected to arduino pin A0
- one pin of a 10k resistor connected to Arduino pin A0 (so connected to NTC1 too)
- the other pin of the 10k resistor connected to Adruino Vcc
- one pin of NTC 2 connected to Gnd
- the other pin of NTC 2 connected to arduino pin A1
- one pin of a 10k resistor connected to Arduino pin A1 (so connected to NTC2 too)
- the other pin of the 10k resistor connected to Adruino Vcc.

Please check if this is right (e.g. with a multimeter to avoid bad soldering).

If this is OK, I could explain later on, how to go deeper to debug the issue

mstrens
Posts: 1190
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by mstrens » Fri Feb 23, 2018 7:48 am

To further debug the issue, we can first force a fix value (this just to check if the issue is in the transmission part or in the measurement part).
To do this, you can change the line
TxHottData.gamMsg.temperature1 = (voltageData->mVolt[TEMPERATURE_1_SOURCE - VOLT_1].value ) + 20 ;
by
TxHottData.gamMsg.temperature1 = 41 ;

And line
TxHottData.gamMsg.temperature2 = (voltageData->mVolt[TEMPERATURE_2_SOURCE - VOLT_1].value ) + 20 ;
by
TxHottData.gamMsg.temperature2 = 42 ;

This should normally give you dummy fixed temperature 1 = 21 and temperature 2 = 22 on your display.

gravity
Posts: 8
Joined: Wed Feb 21, 2018 10:16 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by gravity » Fri Feb 23, 2018 8:02 am

Tonight you get a feedback. Then I'll try it.

In any case, many thanks for your time!

gravity
Posts: 8
Joined: Wed Feb 21, 2018 10:16 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by gravity » Fri Feb 23, 2018 1:58 pm

Success. :mrgreen:
I've got the bad wiring switching a small QnD Shild.
changes in the adv. :
#define SERIE_RESISTOR 99000
I chose 100K Ohm Resistors.

In any case, the change in Hott.cpp was important.

RPM also seems to be functional.

thanks so much!

Image

Image


Yes, that can be done better :roll:

mstrens
Posts: 1190
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by mstrens » Fri Feb 23, 2018 2:18 pm

OK, Great.
Note that a resistor of 100K (associated with a 100K NTC) is good to measure temperature around 25 degree but probably that it will be less sensitive for high temperature.
Probably that accuracy will be a little better is the resistance is about the same as the NTC resistor at the temperature that you would like to measure.

Anyway, I will add the division by 10 in the next release of oXs.

User avatar
jhsa
Posts: 18007
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor HoTT Temperature

Post by jhsa » Fri Feb 23, 2018 4:06 pm

I presume you will be installing those NTC sensors on the engine's cylinder head? If so, I have similar sensors and would be interested in knowing how you did it :)

I did glue mine with epoxy glue to the cylinder head near the glow plug, and between 2 of the cooling fins. But when the engine gets hot, the epoxy tends to become a bit softer, and I am afraid it could come off?

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

gravity
Posts: 8
Joined: Wed Feb 21, 2018 10:16 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by gravity » Fri Feb 23, 2018 8:13 pm

yes, exactly. one engine was placed in the middle of the fuselage. (Do-335) I'm worried about the cooling.

That will be the next challenge.
Remove grease with petrol and stick it on with Kapton Tape !?
or drill a small hole in a cooling fin.

mstrens
Posts: 1190
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: OpenXSensor HoTT Temperature

Post by mstrens » Fri Feb 23, 2018 8:16 pm

I think (not 100% sure) that silicone is better than epoxy for high temperature.

User avatar
jhsa
Posts: 18007
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: OpenXSensor HoTT Temperature

Post by jhsa » Fri Feb 23, 2018 9:30 pm

Yes, I have high temperature (Red) silicone here.. how is it called? Liquid gaskets or something like that? :)
The problem is that it doesn't harden enough... it is just like soft rubber when dry. I don't think it would hold the sensor for long. When I was experimenting with it (and still have to finish this model), I have noticed that I really needed a good contact between the sensor and the cylinder head base, or the reading would not be accurate. The sensor would read too low.

João

Sent from my BLN-L21 using Tapatalk



My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

Carbo
Posts: 328
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: OpenXSensor HoTT Temperature

Post by Carbo » Sat Feb 24, 2018 11:51 am

Often only a mechanical solution works permanent, where the sensor is pressed with spingtension to the device. Easy to do between cooling fins, crankcase is more difficult.

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”