
Vielleicht kriegen die das ja bald auch irgendwie hin, das es trotz "Arm"-Switch funzt, solange werde ich dann auf Telemetry verzichten - das sind mir meine Pranken wert.
Hi Felix,ronco hat geschrieben:Hi,
das drotek board hat ja en ISP anschluss .. da kann man an pin 12
sehe nur nicht wo da pin 1 ist .. also wie der ausgerichtet ist .. aber da musste halt messen.
VTG = VCC
gruß
Felix
Code: Alles auswählen
/********************************************************************/
/**** powermeter (battery capacity monitoring) ****/
/********************************************************************/
/* enable monitoring of the power consumption from battery (think of mAh)
allows to set alarm value in GUI or via LCD
Two options:
1 - soft: - (good results +-5% for plush and mystery ESCs @ 2S and 3S, not good with SuperSimple ESC
00. relies on your combo of battery type (Voltage, cpacity), ESC, ESC settings, motors, props and multiwii cycle time
01. set POWERMETER soft. Uses PLEVELSCALE = 50, PLEVELDIV = PLEVELDIVSOFT = 5000
0. output is a value that linearily scales to power (mAh)
1. get voltage reading right first
2. start with freshly charged battery
3. go fly your typical flight (routine and duration)
4. at end connect to GUI or LCD and read the power value; write it down (example 4711)
5. charge battery, write down amount of energy needed (example 722 mAh)
6. compute alarm value for desired power threshold (example 750 mAh : alarm = 4711 / 722 * 750)
7. set alarm value in GUI or LCD
8. enjoy your new battery alarm - possibly repeat steps 2 .. 7
9. if you want the numbers to represent your mAh value, you must change PLEVELDIV
2 - hard: - (uses hardware sensor, after configuration gives reasonable results
00. uses analog pin 2 to read voltage output from sensor.
01. set POWERMETER hard. Uses PLEVELSCALE = 50
02. install low path filter for 25 Hz to sensor input
03. check your average cycle time. If not close to 3ms, then you must change PLEVELDIV accordingly
1. compute PLEVELDIV for your sensor (see below for insturctions)
2. set PLEVELDIVSOFT to 5000 ( to use LOG_VALUES for individual motor comparison)
3. attach, set PSENSORNULL and PINT2mA
4. configure, compile, upload, set alarm value in GUI or LCD
3. enjoy true readings of mAh consumed
set POWERMETER to "soft" (1) or "hard" (2) depending on sensor you want to utilize */
//#define POWERMETER_SOFT
#define POWERMETER_HARD
/* the sum of all powermeters ranges from [0:60000 e4] theoretically.
the alarm level from eeprom is out of [0:255], so we multipy alarm level with PLEVELSCALE and with 1e4 before comparing
PLEVELSCALE is the step size you can use to set alarm */
#define PLEVELSCALE 50 // if you change this value for other granularity, you must search for comments in code to change accordingly
/* larger PLEVELDIV will get you smaller value for power (mAh equivalent) */
//#define PLEVELDIV 5000 // default for soft - if you lower PLEVELDIV, beware of overrun in uint32 pMeter
#define PLEVELDIVSOFT 5000 // PLEVELDIV // for soft always equal to PLEVELDIV; for hard set to 5000
#define PLEVELDIV 1143L // originalwert 1361L // to convert the sum into mAh divide by this value
/*mein Sensor hat 28mV/A
arduino analog resolution is 4.9mV per unit; units from [0..1023]
sampling rate 20ms, approx 18000 micro seconds
PLEVELDIV = 28 / 4.9 * 10e6 / 18000 * 3600 / 1000 = 1143L
/* amploc 25A sensor has 37mV/A
arduino analog resolution is 4.9mV per unit; units from [0..1023]
sampling rate 20ms, approx 19977 micro seconds
PLEVELDIV = 37 / 4.9 * 10e6 / 18000 * 3600 / 1000 = 1361L
set to analogRead() value for zero current */
#define PSENSORNULL 512 // for I=0A my sensor gives 1/2 Vss; that is approx 2.49Volt // Nullpunkt einstellen
//#define PSENSORNULL 510 // for I=0A my sensor gives 1/2 Vss; that is approx 2.49Volt
//#define PINT2mA 13 // for telemtry display: one integer step on arduino analog translates to mA (example 4.9 / 37 * 100
#define PINT2mA 17.5 // for telemtry display: one integer step on arduino analog translates to mA (example 4.9 / 28 * 100
Klar kann man auch SiLabs-Chips flashen, wird seit einiger Zeit für den BL-Umbau von Mini-Helis (Blade mCPx) erfolgreich gemacht.Scotch hat geschrieben: ...
Aber das liegt wohl an den SiLabs Chip die kann man wohl nicht Flaschen.