Frage an die Experten:
Ich habe einen OpenXSensor zusammengestellt, der mir Vario,GPS und den Strom anzeigen soll. Dazu über ein Y-Kabel den FrSky Drehzahlsensor mit 2 Temp.Fühler angeschlossen.
Alles klappt prima bis auf die Stromanzeige. Bei der Sensorsuche wird zwar CURR als Sensor gefunden, aber kein Wert angezeigt (auch nicht bei laufenden Motor und leichtes abbremsen von Hand ).
Verbaut hatte ich zunächst einen ACS 785 100A bidirektional mit einer Einstellung
in der oXs_config.h :
// ***** 6.3 - Max number of Lipo cells to measure (and transmit to Tx) *****
#define NUMBEROFCELLS 6 // Put this line as comment or set value to 0 (zero) if you do not want to transmit cell voltages.
// ***** 6.4 - Current parameters *****
#define PIN_CURRENTSENSOR 8
#define MVOLT_AT_ZERO_AMP 2500 // in millivolt
#define MVOLT_PER_AMP 20 // in milliVolt per Amp
//#define RESISTOR_TO_GROUND_FOR_CURRENT 19.8 // put as comment or set to 0 if no divider is used
//#define RESISTOR_TO_CURRENT_SENSOR 39 // put as comment or set to 0 if no divider is used
Den ACS 785 ausgebaut und auf evtl. loses Kabel usw. untersucht, ohne Ergebnis. Meine Vermutung ,das Teil hat einen Schaden.
Dann einen ACS 712 30A eingebaut ,MVOLT_PER_AMP auf 66 eingestellt .
Ohne Erfolg .
Auf der Taranis hätte ich auch gerne folgende Werte noch angezeigt bekommen:
momentaner Strom A, verbrauchte Energie mAh und momentane Akkuspannung V.
Unten meine oXs_config.h . Wo habe ich etwas falsch eingestellt ?
Es wäre schön, wenn mal einer der Experten einen Blick darauf wirft.
Danke
Rüdiger
// --------- 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
//#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 *****
//#define PIN_VOLTAGE 0 , 1 , 2 , 8 , 8 , 8 // set this line as comment if no one voltage have to be measured, set a value to 8 for the voltage(s) not to be measured.
#define RESISTOR_TO_GROUND 12 , 20 , 30 , 19.8 , 50 , 60 // set value to 0 when no divider is used for a voltage, can contains decimals
#define RESISTOR_TO_VOLTAGE 50 , 100.1 , 200 , 39 , 500 , 600 // 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
#define SCALE_VOLTAGE 1.1 , 1 , 1 , 1.004, 1 , 1 // optionnal, can be negative, can have decimals
// ***** 6.3 - Max number of Lipo cells to measure (and transmit to Tx) *****
#define NUMBEROFCELLS 6 // Put this line as comment or set value to 0 (zero) if you do not want to transmit cell voltages.
// ***** 6.4 - Current parameters *****
#define PIN_CURRENTSENSOR 8
#define MVOLT_AT_ZERO_AMP 2500 // in millivolt
#define MVOLT_PER_AMP 66 // in milliVolt per Amp
//#define RESISTOR_TO_GROUND_FOR_CURRENT 19.8 // put as comment or set to 0 if no divider is used
//#define RESISTOR_TO_CURRENT_SENSOR 39 // put as comment or set to 0 if no divider is used
// --------- 7 - RPM (rotations per minute) settings ---------
//#define MEASURE_RPM
// --------- 8 - Persistent memory settings ---------
//#define SAVE_TO_EEPROM
//#define PIN_PUSHBUTTON 2 // default is 10 but my own device is 2
// --------- 9 - Data to transmit ---------
#define VSPEED_SOURCE BARO_AND_IMU // select between FIRST_BARO, SECOND_BARO , AVERAGE_FIRST_SECOND, AIRSPEED_COMPENSATED , BARO_AND_IMU or PPM_SELECTION
// ***** 9.1 - Frsky data *****
#define VFAS_SOURCE VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6
//#define FUEL_SOURCE VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6
//#define A3_SOURCE VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6
//#define A4_SOURCE VOLT_1 // select between VOLT_1, VOLT_2, VOLT_3 , VOLT_4, VOLT_5 , VOLT_6
#define ACCX_SOURCE PITCH // 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
#define ACCY_SOURCE ROLL // 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
#define ACCZ_SOURCE YAW // 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
//#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
//#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
// ***** 9.2 - Hott data *****
//#define BATTERY_1_SOURCE VOLT_4 // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6
//#define BATTERY_2_SOURCE VOLT_2 // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6
//#define MAIN_BATTERY_SOURCE VOLT_5 // select between VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6
//#define TEMPERATURE_1_SOURCE TEST_1 // select between TEST_1, TEST_2, TEST_3 , GLIDER_RATIO , SENSITIVITY , PPM
//#define TEMPERATURE_2_SOURCE PPM // select between TEST_1, TEST_2, TEST_3 , GLIDER_RATIO , SENSITIVITY, PPM
// ***** 9.3 - Multiplex data *****
#define SETUP_MULTIPLEX_DATA_TO_SEND \
3 , ALTIMETER , 1 , 1 , 0 , -16384 , 16383 , \
6 , VERTICAL_SPEED , 1 , 1 , 0, -500 , 500 , \
5 , REL_ALTIMETER , 1 , 1 , 0 , -16384 , 16383 , \
7 , CELL_TOT , 1 , 1 , 0 , -16384 , 16383 , \
8 , ALTIMETER_MAX , 1 , 1 , 0 , -16384 , 16383 , \
4 , VOLT_4 , 1 , 1 , 0 , -16384 , 16383 , \
9 , PPM , 1 , 1 , 0 , -16384 , 16383
// --------- 10 - Sequencer ---------
//#define SEQUENCE_OUTPUTS 0b100000
#define SEQUENCE_UNIT 100
#define SEQUENCE_m100 1 , 0b100000 , 1 , 0b000000 , 1 , 0b100000 , 1 , 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 , 8 , 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.
// --------- 11 - GPS ------------------------------------------------------------------------------------------------
#define GPS_INSTALLED // uncomment this line if a GPS is connected
//#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)
// --------- 12 - IMU 6050 --- (accelerometer + gyro -----------------------------------------------------------------
#define USE_6050 // uncomment this line if a IMU 6050 is connected
#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 ACC_OFFSET_X -160 // fill here the first value reported when DISPLAY_ACC_OFFSET is activated
#define ACC_OFFSET_Y -150 // fill here the second value reported when DISPLAY_ACC_OFFSET is activated
#define ACC_OFFSET_Z -1100 // fill here the third value reported when DISPLAY_ACC_OFFSET is activated
//#define DISPLAY_ACC_OFFSET // used ONLY in order to display the acceleration offset on pc terminal; KEEP AS COMMENT once offsets has been setup
// --------- xx - Reserved for developer. DEBUG must be activated here when we want to debug one or several functions in some other files. ---------
#define DEBUG
//#define DEBUG_BLINK // use by developper in order to blink the led without using uart for debugging
#define BASED_ON_AIRSPEED 0
#define BASED_ON_GPS_SPEED 1
#define AVERAGING_DELAY_MILLISEC AVERAGING_TOLERANCE * 100
#if defined( DISPLAY_ACC_OFFSET ) && defined( USE_6050 )
#define DEBUG
#endif
#define FIRST_BARO 1
#define SECOND_BARO 2
#define AVERAGE_FIRST_SECOND 4
#define AIRSPEED_COMPENSATED 3
#define BARO_AND_IMU 5
#define PPM_SELECTION 6
#include <Arduino.h>
struct ONE_MEASUREMENT {
uint8_t available ;
int32_t value ;
} ;
#define FRSKY_SPORT 1
#define FRSKY_HUB 2
#define FRSKY_SPORT_HUB 3
#define MULTIPLEX 4
#define HOTT 5
#define SECONDS_SINCE_T0 32
#define AVERAGE_VSPEED_SINCE_TO 33
#ifdef DEBUG
//#include "HardwareSerial.h"
#endif
#ifdef GPS_INSTALLED
//#include "HardwareSerial.h"
#endif
#endif// End define OXS_CONFIG_h