Skip to content
Snippets Groups Projects
Verified Commit 214156b4 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

fix(logg): error in current calibration

parent f50ff25c
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,7 @@
#define SEN0098_VCC 5 // Supply voltage of the current sensors
#define SEN0098_SENSI 40.0 // Chip ACS758LCB-050B-PFF-T
#define SEN0098_QUIESCENT_FACTOR 0.5 // Bidirectional chip-> V_IOUTQ = 0.5*VCC
#define SEN0098_OFFSET 0.007 // [FIXME] VERIFY!
#define SEN0098_OFFSET 0.0122 // Manually set so current is 0 when no current
#define GEAR_RATIO 0.1 // Gear ratio between motor and wings
......
......@@ -42,8 +42,8 @@ void GetPsu(byte vol_pin, byte cur_pin, float &vol, float &cur) {
float GetCurrent(byte cur_pin) {
float volt_raw = (5.0 / 1023.0) * analogRead(cur_pin);
float volt = volt_raw * -gCUR_QOV + SEN0098_OFFSET; // Trimming value to make current equal to 0 when no current
return volt / gCUR_FACT; // Actual current
float volt = volt_raw - gCUR_QOV + SEN0098_OFFSET; // Trimming value to make current equal to 0 when no current
return volt / gCUR_FACT; // Actual current
}
// Measure the tension provided by the PSU
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment