RPM resolution?

Development & General Chat for the superb openxvario project.

Moderator: rainer

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

Re: RPM resolution?

Post by mstrens »

OK.
There is no reason why you would not be able to finish the project.
You are probably just making a stupid mistake.

Look at Arduino tutorials and make exercises with basic sketches.
Good luck.

Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Some success!

Post by Endorphin »

mstrens wrote: Mon Feb 17, 2020 9:50 am .................................
You are probably just making a stupid mistake.
..................................
I have no doubt about the "stupid mistake" part!

I have had some partial success since my last post. I moved over to another computer, Linux Mint 19.1 with Arduino IDE 1.8.10 .
Three sketches have compiled and then uploaded to an arduino nano board successfully.
One Blink.
And another upload of my previously successful "Voltsagger", from Vollradth. (Just for confirmation of procedures etc.).
And...........your compiled files posted earlier.
This is progress..........!

However, when I then connect the nano that I have uploaded with your two files, the Taranis X9DPlus does not find the new sensor.

My next step is to take a FrSky working variometer from another installation and plug it into the FrSky D8R-11 Plus receiver that I am using as a test set up to see if that will be recognised by the OpenTx when I select "find new sensors".

More later.

Unfortunately, I do not know what "stupid mistake" I have been making all this tiime!

Jim.
User avatar
kalle123
Posts: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: RPM resolution?

Post by kalle123 »

You are using a FrSky D8R-II plus.

Mstrens 'oXs_config_basic.h' lists this line here

Code: Select all

#define PROTOCOL  FRSKY_SPORT   // select between FRSKY_SPORT , FRSKY_HUB , FRSKY_SPORT_HUB , MULTIPLEX , HOTT, JETI
This is NOT working, must be FRSKY_HUB
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

The files provided are foreseen for a receiver that support the Frsky Sport protocol.

Your D8R-11 receiver does not support this protocol.
This can explain why you do not get data on the Tx.

For your receiver, you have to use the Frsky Hub protocol.
You have to edit the oXs_config_basic.h file.
There is
#define PROTOCOL FRSKY_SPORT // select between FRSKY_SPORT , FRSKY_HUB , FRSKY_SPORT_HUB , MULTIPLEX , HOTT, JETI

It must become
#define PROTOCOL FRSKY_HUB // select between FRSKY_SPORT , FRSKY_HUB , FRSKY_SPORT_HUB , MULTIPLEX , HOTT, JETI


You can also try
#define PROTOCOL FRSKY_SPORT_HUB // select between FRSKY_SPORT , FRSKY_HUB , FRSKY_SPORT_HUB , MULTIPLEX , HOTT, JETI
This one is supposed to works with the 2 types of protocol (but it is not always the case)
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

This is what I have edited down too:
Attachments
FRSKY_HUB.png

Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

I will go back and do it again exactly like you describe above.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

You edited it right.
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

I made the change to your specific instruction.
Data still not received by my tx.
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

This is the compiled file that I arrived at:

void setup() {
// put your setup code here, to run once:

}
// OpenXsensor https://github.com/openXsensor/
// started by Rainer Schlosshan and maintained by Michel Strens

// This is version : 8.2.13 (22 oct 2019)

//******************************************************************************************************************************************************* //
// //
// ! IMPORTANT NOTE !!!!!!!!!! Another file in this project provides detailed explanations on how to set up this file (see oXs_config_description.h). //
// //
//******************************************************************************************************************************************************* //
// Note: the oXs_config_basic.h and oXs_config_advanced.h files present on the GitHub site are not always meaningful.
// It could be that the combination of active/non active parameters is not consistent.
// This is just the result of many updates and tests in this document.
// So take always care to set up the files according to your needs and check carefully all options.
// For old version 2 and 3 of oXs, there was a program named "configurator" running on PC that allowed easier editing of a oXs_config.h file
// Still this configurator is not developped anymore. So this version request manual editing.


#ifndef OXS_CONFIG_BASIC_h
#define OXS_CONFIG_BASIC_h

// --------- 1 - Telemetry protocol ---------
#define PROTOCOL FRSKY_HUB // select between FRSKY_SPORT , FRSKY_HUB , FRSKY_SPORT_HUB , MULTIPLEX , HOTT, JETI

// ***** 1.1 - Pin connected to Rx ************ See oXs_config_advanced.h (normally no need to change it) (default is arduino pin 4 connected to RX)
// ***** 1.2 - SPORT_SENSOR_ID (used only for Frsky Sport protocol) ***** See oXs_config_advanced.h (normally no need to change it)

// --------- 2 - Data to transmit --------- uncomment the lines below if you want to transmit some extra oXs measurements into some telemetry fields
// ***** 2.1 - Frsky data *****
//#define VFAS_SOURCE VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define FUEL_SOURCE ADS_VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define A3_SOURCE ADS_VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define A4_SOURCE ADS_VOLT_3 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define ACCX_SOURCE TEST_1 // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define ACCY_SOURCE TEST_2 // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define ACCZ_SOURCE TEST_3 // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define T1_SOURCE TEST_1 // select between TEST_1, TEST_2, TEST_3 , GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , SENSITIVITY, PPM, VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define T2_SOURCE TEST_2 // select between TEST_1, TEST_2, TEST_3, , GLIDER_RATIO, SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , SENSITIVITY, PPM, VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4

// ***** 2.2 - Hott data *****
//#define CELL_UNDERVOLTAGE_WARNING 3300 // Warning threshold in mV;
//#define BATTERY_1_SOURCE ADS_VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define BATTERY_2_SOURCE ADS_VOLT_2 // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define MAIN_BATTERY_SOURCE ADS_VOLT_3 // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define TEMPERATURE_1_SOURCE VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, TEST_1, TEST_2, TEST_3 , GLIDER_RATIO , SENSITIVITY , PPM
//#define TEMPERATURE_2_SOURCE PPM // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, TEST_1, TEST_2, TEST_3 , GLIDER_RATIO , SENSITIVITY, PPM

// ***** 2.3 - Multiplex data *****
//#define SETUP_MULTIPLEX_DATA_TO_SEND \
5 , REL_ALTIMETER , 1 , 1 , 0 , -16384 , 16383 , \
6 , VERTICAL_SPEED , 1 , 1 , 0, -500 , 500 , \
7 , ALTIMETER_MAX , 1 , 1 , 0 , -16384 , 16383
// 8 , VOLT_1 , 1, 1 , 0 , -16384 , 16383
// 6 , CURRENTMA , 1 , 1, 0 , -16384 , 16383 ,\
// 7 , MILLIAH , 1 , 1, 0 , -16384 , 16383
// 7 , CELL_TOT , 1 , 1 , 0 , -16384 , 16383 , \
// 4 , VOLT_4 , 1 , 1 , 0 , -16384 , 16383 , \
// 9 , PPM , 1 , 1 , 0 , -16384 , 16383
// 3 , ALTIMETER , 1 , 1 , 0 , -16384 , 16383 , \

// ***** 2.4 - Jeti data *****
//#define VOLTAGE_SOURCE VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6
//#define TEMPERATURE_SOURCE NTC // select between MS5611 and NTC

// ***** 2.5 - How to fill TEST_1, TEST_2, TEST_3 ****** see oXs_config_advanced.h (required only when some measurements have to be filled in TEST_1, TEST_2 or TEST_3)

// --------- 3 - PPM settings --------- see oXs_config_advanced.h (default, this option is not active)

// --------- 4 - Vario settings ---------
// ***** 4.1 - Connecting 1 or 2 barometric sensor(s) *****
//#define FIRST_BARO_SENSOR_USE NO_BARO // select between NO_BARO , MS5611, GY86 , BMP085 , BMP180 , GY87, BMP280
// Note : when used, second sensor is to define in oXs_config_advanced.h

// ***** 4.2 - Type of Vspeed to transmit *****
//#define VSPEED_SOURCE FIRST_BARO // select between FIRST_BARO, BARO_AND_IMU, SECOND_BARO , AVERAGE_FIRST_SECOND, AIRSPEED_COMPENSATED or PPM_SELECTION

// ***** 4.3 - Sensitivity predefined by program ***** see oXs_config_advanced.h (normally no need to change it)
// ***** 4.4 - Sensitivity adjusted from the TX ***** see oXs_config_advanced.h (normally no need to change it)
// ***** 4.5 - Hysteresis parameter & Alt compensation based on sensor temp ***** see oXs_config_advanced.h (normally no need to change it)
// ***** 4.6 - Vertical speeds calculations based on PPM **** see oXs_config_advanced.h (change only if PPM_SELECTION is used)
// ***** 4.7 - Analog vertical speed ***** see oXs_config_advanced.h (change if you want to activate it)
// ***** 4.8 - Calculating glider ratio, average sink/climb rate ************** see oXs_config_advanced.h (change if you want to get those measurement)
// --------- 5 - Airspeed settings --------- see oXs_config_advanced.h for additionnal parameters (normally no need to change them)
//#define AIRSPEED_SENSOR_USE NO_AIRSPEED // select between NO_AIRSPEED , MS4525 , MPXV7002

// --------- 6 - Voltages & Current sensor settings ---------

// ***** 6.1 - Voltage Reference to measure voltages and current ***** see oXs_config_advanced.h when voltage reference is not Vcc and 5 volt

// ***** 6.2 - Voltage parameters ***** see oXs_config_advanced.h for additionnal parameters when YES
//#define ARDUINO_MEASURES_VOLTAGES NO // select between YES , NO (When NO, following line is discarded)

// ***** 6.3 - Max number of Lipo cells to measure (and transmit to Tx) *****
//#define NUMBEROFCELLS 0 // Put this line as comment or set value to 0 (zero) if you do not want to transmit cell voltages.

// ***** 6.4 - Convert voltage to temperature (° Celcius) ***** see oXs_config_advanced.h if you want to measure temperature(s) with thermistor

// ***** 6.5 - Current parameters ***** see also oXs_config_advanced.h for additionnal parameters if you want to measure current with a current sensor
//#define ARDUINO_MEASURES_A_CURRENT NO // select between YES , NO

// ***** 6.6 - Ads1115 parameters ***** see oXs_config_advanced.h for additional parameters when AN_ADS1115_IS_CONNECTED is YES
//#define AN_ADS1115_IS_CONNECTED NO // select between YES , NO

// --------- 7 - RPM (rotations per minute) settings --------- see oXs_config_advanced.h for additional parameter about the number of pulses per rotation
#define CALCULATE_RPM YES // select between YES , NO

// --------- 8 - Persistent memory settings --------- ( see also oXs_config_advanced.h - used mainly when a flow sensor is connected )
//#define SAVE_TO_EEPROM NO

// --------- 9 - GPS --------------- see oXs_config_advanced.h for additionnal parameters (normally no need to change them)
//#define A_GPS_IS_CONNECTED NO // select between YES , NO

// --------- 10 - IMU 6050 --- (accelerometer + gyro) and HMC5883 (magnetometer) -- see oXs_config_advanced.h for additionnal parameters e.g. about calibration
// ***** 10.1 - IMU 6050 *****
//#define A_MPU6050_IS_CONNECTED NO // select between YES , NO

// ***** 10.2 - HMC5883 *****
//#define CALCULATE_YAW_WITH_HMC5883 NO // select between YES , NO ; YES requires that A_MPU6050_IS_CONNECTED is YES here above

// --------- 11 - Flow sensor --------------- if YES, see also oXs_config_advanced.h
//#define A_FLOW_SENSOR_IS_CONNECTED NO // select between YES , NO

// --------- 12 - Locator ---------------
//#define A_LOCATOR_IS_CONNECTED NO // select between YES , NO


// --------- 20 - Sequencer --------- see oXs_config_advanced.h (only when oXs has to generate signals in sequence)


#endif// End define OXS_CONFIG_BASIC_h

//******************************************************************************************************************************************************* //
// //
// ! IMPORTANT NOTE !!!!!!!!!! Another file in this project provides detailed explanations on how to set up this file (see oXs_config_description.h). //
// //
//******************************************************************************************************************************************************* //
// Note: the oXs_config_advanced.h file present on the GitHub site is not always meaningful.
// It could be that the combination of active/non active parameters is not consistent.
// This is just the result of many updates and tests in this document.
// So take always care to set up the oXs_config_basic.h and oXs_config_advanced.h files according to your needs and check carefully all options.

#ifndef OXS_CONFIG_ADVANCED_h
#define OXS_CONFIG_ADVANCED_h
//#include "oXs_config_macros.h"


// --------- 1 - Telemetry protocol --------- Protocol is defined in oXs_config_basic.h file

// ****** 1.1 - Pin connected to Rx ********
#define PIN_SERIALTX 4 // The pin which transmits the serial data to the telemetry receiver, Usually pin 4 (otherwise pin 2)

// ***** 1.2 - SPORT_SENSOR_ID used (only for Frsky Sport protocol) ***** See list of available values in oXs_config_descripion.h
//#define DATA_ID_VARIO 0x00 // = sensor 0 used for Alt and Vspeed
//#define DATA_ID_FLVSS 0xA1 // 1 used for Cell values
//#define DATA_ID_FAS 0x22 // 2 used for vfas , current and fuel
//#define DATA_ID_GPS 0x83 // 3 used for GPS data
//#define DATA_ID_RPM 0xE4 // 4 used for rpm, T1, T2, airspeed
//#define DATA_ID_ACC 0x67 // 7 used for Acc X, Y, Z
//#define DATA_ID_TX 0x0D // used to read data sent by Tx in order to adjust some oXs parameters (flow sensor or ppm)
// --------- 2 - Data to transmit ---------
// ***** 2.1 - Frsky data ***** see oXs_config_basic.h file
// ***** 2.2 - Hott data ***** see oXs_config_basic.h file
// ***** 2.3 - Multiplex data ***** see oXs_config_basic.h file
// ***** 2.4 - Jeti data ***** see oXs_config_basic.h file

// ***** 2.5 - How to fill TEST_1, TEST_2, TEST_3 ******
//define FILL_TEST_3_WITH_EXPECTED_ALT // uncomment this line if oXs has to calculate an expected Alt in the future based on current Alt, Vspeed and vertical Acc
//#define EXPECTED_ALT_AT_SEC 0.2 // time (in sec) for expected Alt (this line must be uncommented wen previous is uncommented

//#define FILL_TEST_1_2_3_WITH_LINEAR_ACC // uncomment this line if oXs has to fill TEST_1, TEST_2, TEST_3 with linear Acc

//#define FILL_TEST_1_2_WITH_VSPEED_AND_ALT_FROM_SECOND_VARIO // uncomment to activate this option

//#define FILL_TEST_1_WITH_DTE // uncomment to activate this option

//#define FILL_TEST_2_WITH_PPM_AIRSPEED_COMPENSATION // uncomment to activate this option

//#define FILL_TEST_1_WITH_YAWRATE // uncomment to activate this option

//#define FILL_TEST1_WITH_HEADING_FROM_MAGNETOMETER // uncomment to activate this option

//#define FILL_TEST_1_2_3_WITH_FLOW_SENSOR_CONSUMPTION // uncomment to activate this option

//#define FILL_TEST1_WITH_GPS_NUMBER_OF_SAT // uncomment to activate this option; note: when there is a GPS fix 3D (or higher), then number of sat is increased by 100

//#define FILL_TEST2_WITH_GPS_HDOP // uncomment to activate this option

// --------- 3 - PPM settings ---------
//#define PIN_PPM 2 // Uncomment this line in order to use a Rx channel to control oXs; default is 2 but my own device use 3
//#define PPM_MIN_100 988 // default 1500 - 512 ; // pulse width (usec) when TX sends a channel = -100
//#define PPM_PLUS_100 2012 // default 1500 + 512 ; // pulse width (usec) when TX sends a channel = +100

//#define PPM_VIA_SPORT // uncomment this line to get ppm data over SPORT protocol instead of from a PWM channel (it requires a Tx with openTx running LUA script)

// --------- 4 - Vario settings --------- Type of baro is defined in oXs_config_basic.h file

// ***** 4.1 - Connecting 1 or 2 barometric sensor(s) *****
//#define SECOND_BARO_SENSOR_USE NO_BARO // select between NO_BARO , MS5611

// ***** 4.2 - Type of Vspeed to transmit ***** Is defined only in oXs_config_basic.h file

// ***** 4.3 - Sensitivity predefined by program *****
//#define SENSITIVITY_MIN 80 // normal value for MS5611; for BMP, it is probably better to use a lower value like 20
//#define SENSITIVITY_MAX 300
//#define SENSITIVITY_MIN_AT 100
//#define SENSITIVITY_MAX_AT 1000

// ***** 4.4 - Sensitivity adjusted from the TX *****
//#define SENSITIVITY_MIN_AT_PPM 10 // sensitivity will be changed by OXS only when PPM signal is between the specified range enlarged by -5 / +5
//#define SENSITIVITY_MAX_AT_PPM 40
//#define SENSITIVITY_PPM_MIN 20 // common value for vario is 20
//#define SENSITIVITY_PPM_MAX 100 // common value for vario is 100

// ***** 4.5 - Hysteresis parameter & Alt compensation based on sensor temp *****
//#define VARIOHYSTERESIS 5
//#define ALT_TEMP_COMPENSATION 800

// ***** 4.6 - Vertical speeds calculations based on PPM *****
//#define VARIO_PRIMARY FIRST_BARO // select between FIRST_BARO, SECOND_BARO , AVERAGE_FIRST_SECOND, AIRSPEED_COMPENSATED , BARO_AND_IMU
//#define VARIO_SECONDARY AIRSPEED_COMPENSATED // select between FIRST_BARO, SECOND_BARO , AVERAGE_FIRST_SECOND, AIRSPEED_COMPENSATED , BARO_AND_IMU
//#define SWITCH_VARIO_MIN_AT_PPM 10
//#define SWITCH_VARIO_MAX_AT_PPM 90

// ***** 4.7 - Analog vertical speed *****
//#define PIN_ANALOG_VSPEED 3 // Uncomment this line to get an analog voltage related to Vspeed
//#define ANALOG_VSPEED_MIN -3
//#define ANALOG_VSPEED_MAX 3

// ***** 4.8 - Calculating glider ratio, average sink/climb rate ******************************
//#define GLIDER_RATIO_CALCULATED_AFTER_X_SEC 1 // Uncomment this line as comment if a calculation must be performed ; value must be higher or equal to 1 (sec)
//#define SPEED_TOLERANCE 5 // in % of speed
//#define VSPEED_MIN_TOLERANCE -200 // out of tolerance when Vspeed is lower than this value (cm/sec)
//#define VSPEED_MAX_TOLERANCE -10 // out of tolerance when Vspeed is upper than this value (cm/sec)
//#define GLIDER_RATIO_ON_AT_PPM -100 // Glider ratio is calculated when PPM has this value ; keep as comment when ppm is not used

// --------- 5 - Airspeed settings ---------
//#define AIRSPEED_AT_SEA_LEVEL_AND_15C // if this line is commented, airspeed is calculated using baro pressure and temperature (so being "true" airspeed instead of normalised airspeed)
//#define AIRSPEED_IN_KMH // uncomment this line if airspeed has to be in km/h instead of knot/h ( except some old versions, openTx expects knot/h)

//#define AIRSPEED_RESET_AT_PPM 100

//#define COMPENSATION_MIN_AT_PPM 60
//#define COMPENSATION_MAX_AT_PPM 90
//#define COMPENSATION_PPM_MIN 80
//#define COMPENSATION_PPM_MAX 140

// --------- 6 - Voltages & Current sensor settings ---------

// ***** 6.1 - Voltage Reference to measure voltages and current *****
//#define USE_INTERNAL_REFERENCE // uncomment this line if you use 1.1 volt internal reference instead of Vcc (voltage divider mst be used to reduce voltages to 1.1 volt max)
//#define USE_EXTERNAL_REFERENCE // uncomment this line if you use an external reference instead of Vcc
//#define REFERENCE_VOLTAGE 4970 // set value in milliVolt; if commented, oXs will use or 1100 (if internal ref is used) or 5000 (if internal ref is not used)

// ***** 6.2 - Voltage parameters *****
// Each of following lines contains 6 parameters, the first value is for VOLT_1, the second for VOLT_2, ... up to the sixth for VOLT_6
//#define PIN_VOLTAGE 6 , 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.
//#define RESISTOR_TO_GROUND 2.95 , 10 , 10 , 10 , 0 , 18 // set value to 0 when no divider is used for a voltage; can contains decimals
//#define RESISTOR_TO_VOLTAGE 46.9 , 8.7 , 22 , 27 , 0 , 47 // set value to 0 when no divider is used for a voltage; can contains decimals
//#define OFFSET_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0 // optionnal, can be negative, must be integer, in principe in mv
//#define SCALE_VOLTAGE 1.00 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 // optionnal, can be negative, can have decimals

// ***** 6.3 - Max number of Lipo cells to measure (and transmit to Tx) ***** Is defined only in oXs_config_basic.h file

// ***** 6.4 - Convert voltage to temperature (° Celcius) *****
//#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 1 // specify index of last voltage being used for conversion to temperature (e.g. 6 means VOLT_6)
//#define SERIE_RESISTOR 4700 // resistance connected to Arduino Vcc (in Ohm)
//#define STEINHART_A 7.00111E-4 // these parameters are specific to the NTC being used.
//#define STEINHART_B 2.1644E-4
//#define STEINHART_C 1.0619E-07

//#define TERMISTOR_NOMINAL 100000 // nominal resistor of NTC (in Ohm) Those 3 parameters are not used anymore (replaced by STEINHART8A B and C
//#define TEMPERATURE_NOMINAL 25 // nominal temperature of NTC (in degree Celcius)
//#define B_COEFFICIENT 3950 // B coefficient of NTC

// ***** 6.5 - Current parameters *****
//#define PIN_CURRENTSENSOR 6 // Arduino pin used to measure the voltage provided by a current sensor
//#define MVOLT_AT_ZERO_AMP 2500 // in millivolt
//#define MVOLT_PER_AMP 60 // in milliVolt per Amp
//#define RESISTOR_TO_GROUND_FOR_CURRENT 0 // put as comment or set to 0 if no divider is used (e.g. 19.8 for 1.1 internal ref)
//#define RESISTOR_TO_CURRENT_SENSOR 0 // put as comment or set to 0 if no divider is used (e.g 39 for 1.1 internal ref)

// ***** 6.6 - Ads1115 parameters *****
//#define ADS_MEASURE A0_TO_A1 , ADS_OFF , ADS_OFF , ADS_OFF // select 4 values between A0_TO_A1, A0_TO_A3, A1_TO_A3, A2_TO_A3, A0_TO_GND, A1_TO_GND, A2_TO_GND, A3_TO_GND, ADS_OFF
//#define ADS_FULL_SCALE_VOLT MV2048, MV4096, MV6144, MV4096 // select between MV6144 MV4096 MV2048 MV1024 MV512 MV256
//#define ADS_OFFSET 0, 0 , 0 , 0 // must be an integer (positive or negative)
//#define ADS_SCALE 1, 1, 1, 1 // can be a float
//#define ADS_RATE MS2 , MS9, MS9 , MS2 // select between MS137, MS69, MS35, MS18, MS9, MS5, MS3 , MS2
//#define ADS_AVERAGING_ON 10 , 20, 30, 50 // number of values used for averaging (must be between 1 and 254)
//#define ADS_CURRENT_BASED_ON ADS_VOLT_1 // uncomment if current, and comsumption have to be calculated based on one of ADS voltage measurement; select then the voltage to be used between ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define ADS_AIRSPEED_BASED_ON ADS_VOLT_1 // uncomment if airspeed (and dte) have to be calculated based on one of ADS voltage measurement ; select then the voltage to be used between ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4

// --------- 7 - RPM (rotations per minute) settings ---------
#define PULSES_PER_ROTATION 1

// --------- 8 - Persistent memory settings ---------
//#define PIN_PUSHBUTTON 2 // default is 10 but my own device is 2

// --------- 9 - GPS ------------------------------------------------------------------------------------------------
//#define GPS_SPEED_IN_KMH // uncomment this line if GPS speed has to be sent in km/h instead of knot/h (only for Frsky protocol)
#define GPS_SPEED_3D // uncomment this line if GPS speed has to be the 3d speed instead of the 2d speed (note: 3d is probably less accurate - to test)
#define GPS_REFRESH_RATE 5 // rate at which GPS sent new data; select between 1, 5 or 10 (Hz). Default = 5 Hz; Ublox NEO6 does not support 10 hz

// --------- 10 - IMU 6050 --- (accelerometer + gyro) and HMC5883 (magnetometer) --------------------------------------
// ***** 10.1 - IMU 6050 *****
//#define PIN_INT_6050 2 // Interrupt from 6050 has to be connected to Arduino pin 2 or pin 3 (do not use here the same pin as PPM)

//#define DISPLAY_ACC_OFFSET // used ONLY in order to display the acceleration offset on pc terminal; KEEP AS COMMENT once offsets have been setup

//#define ACC_OFFSET_X 0 // fill here the first value reported when DISPLAY_ACC_OFFSET is activated (eg. -160)
//#define ACC_OFFSET_Y 0 // fill here the second value reported when DISPLAY_ACC_OFFSET is activated (eg. -150)
#//define ACC_OFFSET_Z 0 // fill here the third value reported when DISPLAY_ACC_OFFSET is activated (eg. -1100)

// ***** 10.2 - HMC5883 *****
//#define GENERATE_MAG_CALIBRATION_DATA // uncomment this line when HMC5883 calibration has to be performed. Set back as comment once calibration parameters have been introduced

//#define XMAG_OFFSET 2.4683 // must be an integer
//#define YMAG_OFFSET -1.3694 // must be an integer
//#define ZMAG_OFFSET 138.9683 // must be an integer
//#define XXMAG_CORRECTION 0.122082 // can have decimals
//#define XYMAG_CORRECTION -0.00204026
//#define XZMAG_CORRECTION 0.00377534
//#define YXMAG_CORRECTION -0.00204026
//#define YYMAG_CORRECTION 0.130413
//#define YZMAG_CORRECTION -0.00491189
//#define ZXMAG_CORRECTION 0.00377534
//#define ZYMAG_CORRECTION -0.00491189
//#define ZZMAG_CORRECTION 0.138038

// --------- 11 - Flow sensor ---------
//#define PULSES_PER_ML 10.0 // number of pulses per milli liter (depends on sensor); can have decimals
//#define TANK_CAPACITY 1000 // tank capacity in ml
//#define INIT_FLOW_PARAM 30 , 100 , 500 , 700 , 0 , 0, 0, 0 // define at 4 levels of flow (in mliter/min) (e.g. 30, 100, 500, 700) 4 correction parameters (in %; e.g. 20, 10, -5, 15); flow levels have to be sorted from low to high
//#define FLOW_SENSOR_RESET_AT_PPM 95 // when absolute value of ppm is greater than this, flow counter is reset.

// --------- 20 - Sequencer ---------
//#define SEQUENCE_OUTPUTS 0b100000
//#define SEQUENCE_UNIT 2
//#define SEQUENCE_m100 1 , 0b100000 , 3 , 0b000000 , 1 , 0b100000 , 3 , 0b000000
//#define SEQUENCE_m75 1 , 0b100000 , 1 , 0b000000 , 2 , 0b100000 , 2 , 0b000000
//#define SEQUENCE_m50 5 , 0b100000 , 5 , 0b000000
//#define SEQUENCE_m25 5 , 0b100000 , 5 , 0b000000 , 0 , 0b100000
//#define SEQUENCE_0 3 , 0b100000 , 1 , 0b000000
//#define SEQUENCE_25 2 , 0b100000 , 2 , 0b000000
//#define SEQUENCE_50 5 , 0b100000 , 5 , 0b000000
//#define SEQUENCE_75 7 , 0b100000 , 7 , 0b000000
//#define SEQUENCE_100 8 , 0b100000 , 16 , 0b000000 , 24 , 0b100000 , 32 , 0b000000
//#define SEQUENCE_LOW 10 , 0b100000 ,10 , 0b000000 // sequence for Low voltage
//#define SEQUENCE_MIN_VOLT_6 4000 // sequence_100 will be activated if voltage 6 is lower that the value.
//#define SEQUENCE_MIN_CELL 3000 // sequence_100 will be activated if lowest cell is lower that the value.


#endif// End define OXS_CONFIG_ADVANCED_h




void loop() {
// put your main code here, to run repeatedly:

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

Re: RPM resolution?

Post by mstrens »

I think I begin to understand your mistake.

It seems you try to put every thing inside one single file (with a function setup() and a function loop() at the end).

This is not good.

In openXsensor projects the code is spread on quite are many diferent files (about 20 or more).
First check that you folder structure is right (normally it should be if unzip the dowloaded file).
You should have a folder named openXsensor that contains several files like openXsensor.ino , oXs_config_basic.h , oXs_config_advanced.h and many other.
If you select the file openXsensor.ino, it should automatically open the Arduino IDE and you should have many tabs (in a row at top of the screen).
In this row, you should see an arrow (on the rigth of this row).
Select the arrow and you should get a list of all files being in the same directory.
Scroll down in the list and select oXs_config_basic.h
Now, you can delete the content of this tab and make a copy paste of the oXs_config_basic.h I provide a few posts above.
Then in this tab, edit one line in order to replace FRSKY_SPORT by FRSKY_HUB

Then (in the same way) select the tab oXs_config_advanced.h.
Delet the content of this file and do a copy paste of the oXs_config_advanced.h I provide a few posts above.

Now try to compile.
If OK you can compile/flash
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

Yes, I think that is at least, one of the problems.
You did explain before, but I forgot along the way while trying countless different permutations and combinations.
Stupid mistake indeed!
I have to stop for dinner now. Will try later tonight.
I will try this for one last and final attempt.
Thanks,

Jim.
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Two computers, two different problems!

Post by Endorphin »

On my Dell Vostro 220 computer running Linux Mint 19.1, I am able to open the Arduino IDE by clicking on the openxsensor.ino file. Then I find the tabs. However, the tabs for the basic and the advanced files are not present! Lots of other tabs are offered but not the ones required. Mysterious!

In my other desktop computer, I am able to go all the way to the compile stage, which it does successfully.
However, the problem then is a permissions one; It cannot gain access to either ports offered.
I think this later one is a Linux problem, I will post on the forums tomorrow.

If I ever get back to working on this project, I am tempted to boot up one of my old Win7 operating systems to see if that works throughout the process from download to upload of the arduino nano board.

I am not doing any good at all here, just wasting valuable time. A more measured man that me would have abandoned this many hours, or days ago.

Thanks for all the assistance; sorry for wasting your time as well.

Better days ahead.

Jim.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: Two computers, two different problems!

Post by mstrens »

Endorphin wrote: Tue Feb 18, 2020 11:34 am On my Dell Vostro 220 computer running Linux Mint 19.1, I am able to open the Arduino IDE by clicking on the openxsensor.ino file. Then I find the tabs. However, the tabs for the basic and the advanced files are not present! Lots of other tabs are offered but not the ones required. Mysterious!
It not a problem for me trying to help you.
The row with the tabs is not long enough to display all files (there are to many files).
But on the rigth side of this row, there should be an arrow (triangle down). Do'nt you have this?
When you click on it, you should get a vertical list of files. Again, this list is not long enough to display all files but, below, there should be an arrow (triangle down) that should allow you to scroll down in the vertical list in order to see the oXs_config... files

If this does not work, it is still possible to edit the 2 config files with a normal texteditor (like notepad).
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Basic and advanced tabs definitely missing in my Dell.

Post by Endorphin »

Michael,
I did click on the triangle down arrow. I find a long list of tabs. The two required basic and advanced tabs are missing! I scrolled and searched, reloaded, rebooted countless times until my head started to spin.
This is starting to adversely affect my sleep; I must abandon it for now for the sake of my mental health.
No offence to you.

Thanks,

jim.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

OK. No problem at all, It is your choice.

If you want to try again later, just let me know.

For info, as said, it is possible to edit the 2 files outside of arduino IDE and then to compile.
So it would for sure be possible to find a solution.
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

mstrens wrote: Tue Feb 18, 2020 7:58 pm ...................

For info, as said, it is possible to edit the 2 files outside of arduino IDE and then to compile.
So it would for sure be possible to find a solution.
Actually, I tried that, several times.
That is how I arrived at the file I posted above. Where you ascertained that you thought you knew what I was doing wrong.
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

Michael,

Would I be straining the friendship if I post the sketch that I arrived at here for you to check over please?
It compiles ok. Then uploads successfully.
When I connect it up to the D8 Plus receiver (rx. pin), the taranis will not recognise the sensor.
I'll post it here hoping you or someone else will be able to see what is wrong with it, or run it.

Code: Select all

[code]
//******************************************************************************************************************************************************* //
//                                                                                                                                                        //
// ! IMPORTANT NOTE !!!!!!!!!!   Another file in this project provides detailed explanations on how to set up this file (see oXs_config_description.h).   //
//                                                                                                                                                        //
//******************************************************************************************************************************************************* //
//  Note: the oXs_config_advanced.h file present on the GitHub site is not always meaningful.
//       It could be that the combination of active/non active parameters is not consistent.
//       This is just the result of many updates and tests in this document.
//       So take always care to set up the oXs_config_basic.h and oXs_config_advanced.h files according to your needs and check carefully all options.

#ifndef OXS_CONFIG_ADVANCED_h
#define OXS_CONFIG_ADVANCED_h
//#include "oXs_config_macros.h"


// --------- 1 - Telemetry protocol ---------  Protocol is defined in oXs_config_basic.h file

// ****** 1.1 - Pin connected to Rx ********
#define PIN_SERIALTX      4                 // The pin which transmits the serial data to the telemetry receiver, Usually pin 4 (otherwise pin 2)

// ***** 1.2 - SPORT_SENSOR_ID used (only for Frsky Sport protocol)  *****   See list of available values in oXs_config_descripion.h 
//#define         DATA_ID_VARIO  0x00  // = sensor 0 used for Alt and Vspeed
//#define         DATA_ID_FLVSS  0xA1  //          1 used for Cell values
//#define         DATA_ID_FAS    0x22  //          2 used for vfas , current and fuel
//#define         DATA_ID_GPS    0x83  //          3 used for GPS data
//#define         DATA_ID_RPM    0xE4  //          4 used for rpm, T1, T2, airspeed
//#define         DATA_ID_ACC    0x67  //          7 used for Acc X, Y, Z
//#define         DATA_ID_TX     0x0D  //           used to read data sent by Tx in order to adjust some oXs parameters (flow sensor or ppm)
// --------- 2 - Data to transmit ---------                   
// ***** 2.1 - Frsky data *****                              see oXs_config_basic.h file
// ***** 2.2 - Hott data *****                               see oXs_config_basic.h file
// ***** 2.3 - Multiplex data *****                          see oXs_config_basic.h file   
// ***** 2.4 - Jeti data *****                               see oXs_config_basic.h file

// ***** 2.5 - How to fill TEST_1, TEST_2, TEST_3  ******    
//define FILL_TEST_3_WITH_EXPECTED_ALT                        // uncomment this line if oXs has to calculate an expected Alt in the future based on current Alt, Vspeed and vertical Acc
//#define EXPECTED_ALT_AT_SEC 0.2                               // time (in sec) for expected Alt (this line must be uncommented wen previous is uncommented

//#define FILL_TEST_1_2_3_WITH_LINEAR_ACC                     // uncomment this line if oXs has to fill TEST_1, TEST_2, TEST_3 with linear Acc

//#define FILL_TEST_1_2_WITH_VSPEED_AND_ALT_FROM_SECOND_VARIO  // uncomment to activate this option

//#define FILL_TEST_1_WITH_DTE                                 // uncomment to activate this option

//#define FILL_TEST_2_WITH_PPM_AIRSPEED_COMPENSATION           // uncomment to activate this option

//#define FILL_TEST_1_WITH_YAWRATE                             // uncomment to activate this option

//#define FILL_TEST1_WITH_HEADING_FROM_MAGNETOMETER              // uncomment to activate this option

//#define FILL_TEST_1_2_3_WITH_FLOW_SENSOR_CONSUMPTION             // uncomment to activate this option

//#define FILL_TEST1_WITH_GPS_NUMBER_OF_SAT                      // uncomment to activate this option; note: when there is a GPS fix 3D (or higher), then number of sat is increased by 100

//#define FILL_TEST2_WITH_GPS_HDOP                               // uncomment to activate this option

// --------- 3 - PPM settings ---------
//#define PIN_PPM           2     // Uncomment this line in order to use a Rx channel to control oXs; default is 2 but my own device use 3
//#define PPM_MIN_100       988     // default 1500 - 512 ; // pulse width (usec) when TX sends a channel = -100
//#define PPM_PLUS_100      2012    // default 1500 + 512 ; // pulse width (usec) when TX sends a channel = +100

//#define PPM_VIA_SPORT             // uncomment this line to get ppm data over SPORT protocol instead of from a PWM channel (it requires a Tx with openTx running LUA script)

// --------- 4 - Vario settings ---------    Type of baro is defined in oXs_config_basic.h file

// ***** 4.1 - Connecting 1 or 2 barometric sensor(s)  ***** 
#define SECOND_BARO_SENSOR_USE    NO_BARO                    // select between NO_BARO , MS5611

// ***** 4.2 - Type of Vspeed to transmit  *****             Is defined only in oXs_config_basic.h file                       

// ***** 4.3 - Sensitivity predefined by program *****
//#define SENSITIVITY_MIN 80          // normal value for MS5611; for BMP, it is probably better to use a lower value like 20
//#define SENSITIVITY_MAX 300
//#define SENSITIVITY_MIN_AT 100
//#define SENSITIVITY_MAX_AT 1000

// ***** 4.4 - Sensitivity adjusted from the TX *****
//#define SENSITIVITY_MIN_AT_PPM 10    // sensitivity will be changed by OXS only when PPM signal is between the specified range enlarged by -5 / +5
//#define SENSITIVITY_MAX_AT_PPM 40
//#define SENSITIVITY_PPM_MIN  20      // common value for vario is 20
//#define SENSITIVITY_PPM_MAX 100      // common value for vario is 100

// ***** 4.5 - Hysteresis parameter & Alt compensation based on sensor temp *****
//#define VARIOHYSTERESIS 5
//#define ALT_TEMP_COMPENSATION 800

// ***** 4.6 - Vertical speeds calculations based on PPM *****
//#define VARIO_PRIMARY       FIRST_BARO          // select between FIRST_BARO, SECOND_BARO , AVERAGE_FIRST_SECOND, AIRSPEED_COMPENSATED , BARO_AND_IMU
//#define VARIO_SECONDARY     AIRSPEED_COMPENSATED          // select between FIRST_BARO, SECOND_BARO , AVERAGE_FIRST_SECOND, AIRSPEED_COMPENSATED , BARO_AND_IMU
//#define SWITCH_VARIO_MIN_AT_PPM 10
//#define SWITCH_VARIO_MAX_AT_PPM 90

// ***** 4.7 - Analog vertical speed *****
//#define PIN_ANALOG_VSPEED 3                 // Uncomment this line to get an analog voltage related to Vspeed
//#define ANALOG_VSPEED_MIN -3
//#define ANALOG_VSPEED_MAX  3

// ***** 4.8  - Calculating glider ratio, average sink/climb rate ******************************
//#define GLIDER_RATIO_CALCULATED_AFTER_X_SEC 1  // Uncomment this line as comment if a calculation must be performed ; value must be higher or equal to 1 (sec)
//#define SPEED_TOLERANCE   5              // in % of speed
//#define VSPEED_MIN_TOLERANCE -200        // out of tolerance when Vspeed is lower than this value  (cm/sec)
//#define VSPEED_MAX_TOLERANCE  -10        // out of tolerance when Vspeed is upper than this value  (cm/sec)
//#define GLIDER_RATIO_ON_AT_PPM -100      // Glider ratio is calculated when PPM has this value ; keep as comment when ppm is not used 

// --------- 5 - Airspeed settings ---------
//#define AIRSPEED_AT_SEA_LEVEL_AND_15C // if this line is commented, airspeed is calculated using baro pressure and temperature (so being "true" airspeed instead of normalised airspeed)      
//#define AIRSPEED_IN_KMH  // uncomment this line if airspeed has to be in km/h instead of knot/h ( except some old versions, openTx expects knot/h) 

//#define AIRSPEED_RESET_AT_PPM   100

//#define COMPENSATION_MIN_AT_PPM 60
//#define COMPENSATION_MAX_AT_PPM 90
//#define COMPENSATION_PPM_MIN  80
//#define COMPENSATION_PPM_MAX 140

// --------- 6 - Voltages & Current sensor settings ---------

// ***** 6.1 - Voltage Reference to measure voltages and current *****
//#define USE_INTERNAL_REFERENCE  // uncomment this line if you use 1.1 volt internal reference instead of Vcc (voltage divider mst be used to reduce voltages to 1.1 volt max)
//#define USE_EXTERNAL_REFERENCE  // uncomment this line if you use an external reference instead of Vcc
//#define REFERENCE_VOLTAGE 4970    // set value in milliVolt; if commented, oXs will use or 1100 (if internal ref is used) or 5000 (if internal ref is not used) 

// ***** 6.2 - Voltage parameters *****
// Each of following lines contains 6 parameters, the first value is for VOLT_1, the second for VOLT_2, ... up to the sixth for VOLT_6 
//#define PIN_VOLTAGE        6  , 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.
//#define RESISTOR_TO_GROUND  2.95 , 10    , 10  , 10 , 0  , 18               // set value to 0 when no divider is used for a voltage; can contains decimals 
//#define RESISTOR_TO_VOLTAGE 46.9 , 8.7 , 22 , 27  , 0 , 47              // set value to 0 when no divider is used for a voltage; can contains decimals 
//#define OFFSET_VOLTAGE      0   , 0     , 0    , 0    , 0   , 0                // optionnal, can be negative, must be integer, in principe in mv
//#define SCALE_VOLTAGE       1.00 , 1.0   , 1.0  , 1.0  , 1.0 , 1.0              // optionnal, can be negative, can have decimals

// ***** 6.3 - Max number of Lipo cells to measure (and transmit to Tx) *****      Is defined only in oXs_config_basic.h file

// ***** 6.4 - Convert voltage to temperature (° Celcius) *****     
//#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 1    // specify index of last voltage being used for conversion to temperature (e.g. 6 means VOLT_6)
//#define SERIE_RESISTOR 4700      // resistance connected to Arduino Vcc (in Ohm)
//#define STEINHART_A 7.00111E-4   // these parameters are specific to the NTC being used.
//#define STEINHART_B 2.1644E-4
//#define STEINHART_C 1.0619E-07

//#define TERMISTOR_NOMINAL 100000 // nominal resistor of NTC (in Ohm)                    Those 3 parameters are not used anymore (replaced by STEINHART8A B and C
//#define TEMPERATURE_NOMINAL 25 // nominal temperature of NTC (in degree Celcius)
//#define B_COEFFICIENT 3950 // B coefficient of NTC

// ***** 6.5 - Current parameters  *****
//#define PIN_CURRENTSENSOR   6  //      Arduino pin used to measure the voltage provided by a current sensor
//#define MVOLT_AT_ZERO_AMP              2500    // in millivolt
//#define MVOLT_PER_AMP                  60      // in milliVolt per Amp
//#define RESISTOR_TO_GROUND_FOR_CURRENT  0   // put as comment or set to 0 if no divider is used (e.g. 19.8 for 1.1 internal ref)
//#define RESISTOR_TO_CURRENT_SENSOR      0   // put as comment or set to 0 if no divider is used (e.g  39   for 1.1 internal ref)

// ***** 6.6 - Ads1115 parameters  *****
//#define ADS_MEASURE A0_TO_A1 ,  ADS_OFF , ADS_OFF , ADS_OFF // select 4 values between A0_TO_A1, A0_TO_A3, A1_TO_A3, A2_TO_A3, A0_TO_GND, A1_TO_GND, A2_TO_GND, A3_TO_GND, ADS_OFF
//#define ADS_FULL_SCALE_VOLT  MV2048, MV4096, MV6144, MV4096 //  select between MV6144 MV4096 MV2048 MV1024 MV512 MV256
//#define ADS_OFFSET 0, 0 , 0 , 0 // must be an integer (positive or negative)
//#define ADS_SCALE 1, 1, 1, 1 // can be a float
//#define ADS_RATE  MS2 , MS9, MS9 , MS2 // select between MS137, MS69, MS35, MS18, MS9, MS5, MS3 , MS2
//#define ADS_AVERAGING_ON 10 , 20, 30, 50 // number of values used for averaging (must be between 1 and 254) 
//#define ADS_CURRENT_BASED_ON ADS_VOLT_1  // uncomment if current, and comsumption have to be calculated based on one of ADS voltage measurement; select then the voltage to be used between ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define ADS_AIRSPEED_BASED_ON ADS_VOLT_1  // uncomment if airspeed (and dte) have to be calculated based on one of ADS voltage measurement ; select then the voltage to be used between ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4

// --------- 7 - RPM (rotations per minute) settings ---------                      
#define PULSES_PER_ROTATION 1

// --------- 8 - Persistent memory settings ---------
//#define PIN_PUSHBUTTON    2   // default is 10 but my own device is 2

// --------- 9 - GPS ------------------------------------------------------------------------------------------------
//#define GPS_SPEED_IN_KMH  // uncomment this line if GPS speed has to be sent in km/h instead of knot/h (only for Frsky protocol)
//#define GPS_SPEED_3D      // uncomment this line if GPS speed has to be the 3d speed instead of the 2d speed (note: 3d is probably less accurate - to test) 
//#define GPS_REFRESH_RATE  5      // rate at which GPS sent new data; select between 1, 5 or 10 (Hz). Default = 5 Hz; Ublox NEO6 does not support 10 hz  

// --------- 10 - IMU 6050 --- (accelerometer + gyro) and HMC5883 (magnetometer) --------------------------------------
// ***** 10.1 - IMU 6050 *****
//#define PIN_INT_6050 2   // Interrupt from 6050 has to be connected to Arduino pin 2 or pin 3 (do not use here the same pin as PPM)

//#define DISPLAY_ACC_OFFSET // used ONLY in order to display the acceleration offset on pc terminal; KEEP AS COMMENT once offsets have been setup 

//#define ACC_OFFSET_X 0 // fill here the first value reported when DISPLAY_ACC_OFFSET is activated (eg. -160)
//#define ACC_OFFSET_Y 0 // fill here the second value reported when DISPLAY_ACC_OFFSET is activated (eg. -150)
//#define ACC_OFFSET_Z 0 // fill here the third value reported when DISPLAY_ACC_OFFSET is activated (eg. -1100)

// ***** 10.2 - HMC5883 *****
//#define GENERATE_MAG_CALIBRATION_DATA   // uncomment this line when HMC5883 calibration has to be performed. Set back as comment once calibration parameters have been introduced 

//#define    XMAG_OFFSET 2.4683     // must be an integer
//#define    YMAG_OFFSET -1.3694     // must be an integer
//#define    ZMAG_OFFSET 138.9683     // must be an integer
//#define    XXMAG_CORRECTION  0.122082   // can have decimals
//#define    XYMAG_CORRECTION  -0.00204026
//#define    XZMAG_CORRECTION  0.00377534 
//#define    YXMAG_CORRECTION  -0.00204026
//#define    YYMAG_CORRECTION  0.130413
//#define    YZMAG_CORRECTION  -0.00491189
//#define    ZXMAG_CORRECTION  0.00377534
//#define    ZYMAG_CORRECTION  -0.00491189
//#define    ZZMAG_CORRECTION  0.138038

// --------- 11 - Flow sensor ---------
//#define PULSES_PER_ML                    10.0                 // number of pulses per milli liter (depends on sensor); can have decimals
//#define TANK_CAPACITY                    1000                 // tank capacity in ml
//#define INIT_FLOW_PARAM  30 , 100 , 500 , 700 , 0 , 0, 0, 0   // define at 4 levels of flow (in mliter/min) (e.g. 30, 100, 500, 700) 4 correction parameters (in %; e.g. 20, 10, -5, 15); flow levels have to be sorted from low to high
//#define FLOW_SENSOR_RESET_AT_PPM         95                   // when absolute value of ppm is greater than this, flow counter is reset.

// --------- 20 - Sequencer ---------
//#define SEQUENCE_OUTPUTS 0b100000  
//#define SEQUENCE_UNIT 2
//#define SEQUENCE_m100    1 , 0b100000 , 3 , 0b000000 , 1 , 0b100000 , 3 , 0b000000 
//#define SEQUENCE_m75     1 , 0b100000 , 1 , 0b000000 , 2 , 0b100000 , 2 , 0b000000
//#define SEQUENCE_m50     5 , 0b100000 , 5 , 0b000000
//#define SEQUENCE_m25     5 , 0b100000 , 5 , 0b000000 , 0 , 0b100000
//#define SEQUENCE_0       3 , 0b100000 , 1 , 0b000000
//#define SEQUENCE_25      2 , 0b100000 , 2 , 0b000000
//#define SEQUENCE_50      5 , 0b100000 , 5 , 0b000000
//#define SEQUENCE_75      7 , 0b100000 , 7 , 0b000000
//#define SEQUENCE_100     8 , 0b100000 , 16 , 0b000000 , 24 , 0b100000 , 32 , 0b000000  
//#define SEQUENCE_LOW    10 , 0b100000 ,10 , 0b000000   // sequence for Low voltage
//#define SEQUENCE_MIN_VOLT_6 4000 // sequence_100 will be activated if voltage 6 is lower that the value.
//#define SEQUENCE_MIN_CELL   3000 // sequence_100 will be activated if lowest cell is lower that the value.


#endif// End define OXS_CONFIG_ADVANCED_h
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

It is a good point that you continue trying to solve your issue.

In your last post there was only one file content.
I had expected that you would put 2 files (oXs_config_basic.h and oXs_config_advanced.h)

In order to make it easier, I put here the 2 files that you should use.
I already edited the "basic" file in order to put the FRSKY_HUB protocol instead of the FRSKY_SPORT.

So in principe, you should just unzip the attachment and copy the 2 files in your folder that contains the file openXsensor.ino
So this will replace the existing files.

Then you just click on the file openXsensor.ino. It will open the Arduino IDE with all tabs (even if you do not see all of them).
Then you can just compile and flash.

I hope it should work.
Attachments
oxs_config.zip
(7.96 KiB) Downloaded 281 times
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

mstrens wrote: Wed Feb 19, 2020 7:50 am ............................

In your last post there was only one file content.
I had expected that you would put 2 files (oXs_config_basic.h and oXs_config_advanced.h)

..........................
I meant to include both. Sorry, operator error, not done intentionally.
How does one copy and paste the combined basic and advanced (edited) files from arduino, for posting here on the forum please?

I will try again to load and compile the combined files that you have provided again.

Thanks,

Jim.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

On this forum, you can upload your files as attachement if you can't easily make a copy/paste in the body.
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Taranis X9D Plus does not recognise the sensor.

Post by Endorphin »

Michael,

I tried that again. No success; I am going round and round in circles.
The good news is, I now can compile a sketch and upload it.
However, it is absolutely no good to me as a sensor.
It's been a good exercise though; I have learned a few things. I will probably try another arduino project one day, but only something much more simple.
I'll stick with FrSky varios for my sailplanes. The tacho for my tug plane is not really necessary. It would be nice to know what RPM the motor is doing, but not necessary.
Thanks again.

Jim.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

OK, sorry.
If you want to try again later, just ask for.

If you want, I could make some change to the code in order to force the sensor to send always a dummy value.
If you Tx receives this value, then at least you should know that the communication works. The issue would then be in the way the RPM is capture.
If the TX does not receive this value, then there should be something wrong in the link with the Rx.
At least this would help to locate the issue.
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

If you want to go to the trouble, I will give it one more try.
In the meantime, If I get enough enthusiasm back, I will try connecting the sensor to a D4R-11 receiver which I have on the bench that has a proven telemetry link to the tx. It currently has a FrSky normal precision vario connected and working in a test set up in my Taranis X9D Plus.
I could disconnect that and connect the openTxsensor.
I am not at all confident, but at least that would eliminate the D8 as the source of the offending problem.
I might also do the reverse: connect the functional FrSky vario to the D8 that I have been using to prove if that has full functioning telemetry.
I don't know at this stage, I'm losing confidence.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

Ok, I will prepare a whole set of oXs files that should just provide a dummy field.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

what is the arduino pin that you connected to your Rx. Is it D4 or D2?
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

mstrens wrote: Wed Feb 19, 2020 10:09 am what is the arduino pin that you connected to your Rx. Is it D4 or D2?
D4.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: RPM resolution?

Post by mstrens »

Here all the files your need for this test.
Just unzip it in a new directory (don't reuse any previous because there are some changes in different files.
Check that openXsensor.ino file is in a directory named openXsensor (if not rename the directory).
Open file openXsensor.ino. It should open arduino ide with many tabs.
You do not have to make changes.
Just compile and flash.

It should send 2 dummy values (fix):
RPM = 1000
Temp1 = 20

If you keep Arduino connected to USB PC, it is even possible to see what it is sending. I can explain later if you do not get data on Tx
Attachments
openXsensor.zip
(305.47 KiB) Downloaded 262 times
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

Michael,

I just plugged my normal precision FrSky vario into the D8R-11 receiver that I have been trying to get the openXsensor to work with.
The vario works perfectly, as designed.
This demonstrates that there is nothing wrong with the telemetry link between receiver and my Taranis X9D Plus.
Which further suggest, by deduction, the openXsensor is at fault. Perhaps the sketch has one small error?
I hasten to report this, as it seems to me you are wasting your time making up a special sketch to try and demonstrate what we already know; the openXsensor and my tx. and not communicating with each other.

Jim
I made a short video of the FrSky vario beeping away nicely, if you should require proof of the above. I can post it on Vimeo and provide a link here.
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

Too late; you have already compiled a test for me.
Since you have gone to that trouble, I will compile and load it anyway.
I don't think it will work. I do hope I am wrong though!
Endorphin
Posts: 167
Joined: Tue Jan 26, 2016 7:46 pm
Country: Australia

Re: RPM resolution?

Post by Endorphin »

Success!
The tx. has discovered two new sensors. RPM and temp1.
RPM showing as 6000.
That proves the telemetry link is ok. As did my test with the FrSky vario reported above.
What next?
Must be a code error, no?
I am in your hands now Michael, as the saying goes.

Post Reply

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