iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.09k stars 1.46k forks source link

HMC5883 MAG=UNAVAILABLE on Flip32AIO flashed with custom inav 1.7.1 #1861

Closed georgekucher closed 7 years ago

georgekucher commented 7 years ago

Hello guys! I'm trying to connect my external HMC5883 compass to FC through I2C bus for a week, but no luck((( Here is some output:

status

System Uptime: 1348 seconds Voltage: 1 * 0.1V (1S battery - NOT PRESENT) CPU Clock=72MHz, GYRO=MPU6050, ACC=MPU6050.n, BARO=MS5611 Sensor status: GYRO=OK, ACC=OK, MAG=UNAVAILABLE, BARO=OK, SONAR=NONE, GPS=NONE Stack size: 2048, Stack address: 0x20005000 I2C Errors: 0, config size: 1674, max available config: 2048 System load: 4, cycle time: 2004, PID rate: 499, RX rate: 49, System rate: 9

dump

INAV/NAZE 1.7.1 Jun 12 2017 / 19:32:46 (48e1feff)

mixer QUADX

mmix reset

servo 0 1000 2000 1500 100 -1 servo 1 1000 2000 1500 100 -1 servo 2 1000 2000 1500 100 -1 servo 3 1000 2000 1500 100 -1 servo 4 1000 2000 1500 100 -1 servo 5 1000 2000 1500 100 -1 servo 6 1000 2000 1500 100 -1 servo 7 1000 2000 1500 100 -1 smix reset

feature -RX_PPM feature -VBAT feature -RX_SERIAL feature -MOTOR_STOP feature -SERVO_TILT feature -SOFTSERIAL feature -GPS feature -TELEMETRY feature -CURRENT_METER feature -3D feature -RX_PARALLEL_PWM feature -RX_MSP feature -RSSI_ADC feature -LED_STRIP feature -DASHBOARD feature -BLACKBOX feature -CHANNEL_FORWARDING feature -TRANSPONDER feature -AIRMODE feature -SUPEREXPO feature -VTX feature -RX_SPI feature -SOFTSPI feature -PWM_SERVO_DRIVER feature -PWM_OUTPUT_ENABLE feature -OSD feature RX_PPM feature VBAT beeper GYRO_CALIBRATED beeper HW_FAILURE beeper RX_LOST beeper RX_LOST_LANDING beeper DISARMING beeper ARMING beeper ARMING_GPS_FIX beeper BAT_CRIT_LOW beeper BAT_LOW beeper GPS_STATUS beeper RX_SET beeper ACTION_SUCCESS beeper ACTION_FAIL beeper READY_BEEP beeper MULTI_BEEPS beeper DISARM_REPEAT beeper ARMED beeper SYSTEM_INIT beeper ON_USB beeper LAUNCH_MODE map AETR1234 serial 0 1 115200 38400 0 115200 serial 1 0 115200 38400 0 115200 led 0 0,0::C:0 led 1 0,0::C:0 led 2 0,0::C:0 led 3 0,0::C:0 led 4 0,0::C:0 led 5 0,0::C:0 led 6 0,0::C:0 led 7 0,0::C:0 led 8 0,0::C:0 led 9 0,0::C:0 led 10 0,0::C:0 led 11 0,0::C:0 led 12 0,0::C:0 led 13 0,0::C:0 led 14 0,0::C:0 led 15 0,0::C:0 led 16 0,0::C:0 led 17 0,0::C:0 led 18 0,0::C:0 led 19 0,0::C:0 led 20 0,0::C:0 led 21 0,0::C:0 led 22 0,0::C:0 led 23 0,0::C:0 led 24 0,0::C:0 led 25 0,0::C:0 led 26 0,0::C:0 led 27 0,0::C:0 led 28 0,0::C:0 led 29 0,0::C:0 led 30 0,0::C:0 led 31 0,0::C:0 color 0 0,0,0 color 1 0,255,255 color 2 0,0,255 color 3 30,0,255 color 4 60,0,255 color 5 90,0,255 color 6 120,0,255 color 7 150,0,255 color 8 180,0,255 color 9 210,0,255 color 10 240,0,255 color 11 270,0,255 color 12 300,0,255 color 13 330,0,255 color 14 0,0,0 color 15 0,0,0 mode_color 0 0 1 mode_color 0 1 11 mode_color 0 2 2 mode_color 0 3 13 mode_color 0 4 10 mode_color 0 5 3 mode_color 1 0 5 mode_color 1 1 11 mode_color 1 2 3 mode_color 1 3 13 mode_color 1 4 10 mode_color 1 5 3 mode_color 2 0 10 mode_color 2 1 11 mode_color 2 2 4 mode_color 2 3 13 mode_color 2 4 10 mode_color 2 5 3 mode_color 3 0 8 mode_color 3 1 11 mode_color 3 2 4 mode_color 3 3 13 mode_color 3 4 10 mode_color 3 5 3 mode_color 4 0 7 mode_color 4 1 11 mode_color 4 2 3 mode_color 4 3 13 mode_color 4 4 10 mode_color 4 5 3 mode_color 5 0 9 mode_color 5 1 11 mode_color 5 2 2 mode_color 5 3 13 mode_color 5 4 10 mode_color 5 5 3 mode_color 6 0 6 mode_color 6 1 10 mode_color 6 2 1 mode_color 6 3 0 mode_color 6 4 0 mode_color 6 5 2 mode_color 6 6 3 mode_color 6 7 6 mode_color 6 8 0 mode_color 6 9 0 mode_color 6 10 0 aux 0 0 0 900 900 aux 1 0 0 900 900 aux 2 0 0 900 900 aux 3 0 0 900 900 aux 4 0 0 900 900 aux 5 0 0 900 900 aux 6 0 0 900 900 aux 7 0 0 900 900 aux 8 0 0 900 900 aux 9 0 0 900 900 aux 10 0 0 900 900 aux 11 0 0 900 900 aux 12 0 0 900 900 aux 13 0 0 900 900 aux 14 0 0 900 900 aux 15 0 0 900 900 aux 16 0 0 900 900 aux 17 0 0 900 900 aux 18 0 0 900 900 aux 19 0 0 900 900 adjrange 0 0 0 900 900 0 0 adjrange 1 0 0 900 900 0 0 adjrange 2 0 0 900 900 0 0 adjrange 3 0 0 900 900 0 0 adjrange 4 0 0 900 900 0 0 adjrange 5 0 0 900 900 0 0 adjrange 6 0 0 900 900 0 0 adjrange 7 0 0 900 900 0 0 adjrange 8 0 0 900 900 0 0 adjrange 9 0 0 900 900 0 0 adjrange 10 0 0 900 900 0 0 adjrange 11 0 0 900 900 0 0 rxrange 0 1000 2000 rxrange 1 1000 2000 rxrange 2 1000 2000 rxrange 3 1000 2000 set looptime = 2000 set gyro_sync = OFF set gyro_sync_denom = 2 set align_gyro = DEFAULT set gyro_hardware_lpf = 42HZ set gyro_lpf_hz = 60 set moron_threshold = 32 set align_acc = DEFAULT set acc_hardware = MPU6050 set acc_lpf_hz = 15 set acczero_x = 0 set acczero_y = 0 set acczero_z = 0 set accgain_x = 4096 set accgain_y = 4096 set accgain_z = 4096 set align_mag = DEFAULT set mag_hardware = HMC5883 set mag_declination = 0 set magzero_x = 0 set magzero_y = 0 set magzero_z = 0 set mag_calibration_time = 30 set baro_hardware = MS5611 set baro_use_median_filter = ON set mid_rc = 1500 set min_check = 1100 set max_check = 1900 set rssi_channel = 0 set rssi_scale = 30 set rssi_invert = OFF set rc_smoothing = ON set rx_min_usec = 885 set rx_max_usec = 2115 set min_throttle = 1150 set max_throttle = 1850 set min_command = 1000 set motor_pwm_rate = 400 set motor_pwm_protocol = STANDARD set failsafe_delay = 5 set failsafe_recovery_delay = 5 set failsafe_off_delay = 200 set failsafe_throttle = 1000 set failsafe_throttle_low_delay = 100 set failsafe_procedure = SET-THR set failsafe_stick_threshold = 50 set failsafe_fw_roll_angle = -200 set failsafe_fw_pitch_angle = 100 set failsafe_fw_yaw_rate = -45 set align_board_roll = 0 set align_board_pitch = 0 set align_board_yaw = 0 set gimbal_mode = NORMAL set battery_capacity = 0 set vbat_scale = 110 set vbat_max_cell_voltage = 43 set vbat_min_cell_voltage = 33 set vbat_warning_cell_voltage = 35 set current_meter_scale = 400 set current_meter_offset = 0 set multiwii_current_meter_output = OFF set current_meter_type = ADC set yaw_motor_direction = 1 set yaw_jump_prevention_limit = 200 set 3d_deadband_low = 1406 set 3d_deadband_high = 1514 set 3d_neutral = 1460 set servo_center_pulse = 1500 set servo_pwm_rate = 50 set servo_lpf_hz = 20 set flaperon_throw_offset = 200 set tri_unarmed_servo = ON set reboot_character = 82 set imu_dcm_kp = 2500 set imu_dcm_ki = 50 set imu_dcm_kp_mag = 10000 set imu_dcm_ki_mag = 0 set small_angle = 25 set fixed_wing_auto_arm = OFF set disarm_kill_switch = ON set auto_disarm_delay = 5 set gps_provider = UBLOX set gps_sbas_mode = NONE set gps_dyn_model = AIR_1G set gps_auto_config = ON set gps_auto_baud = ON set gps_min_sats = 6 set deadband = 5 set yaw_deadband = 5 set pos_hold_deadband = 20 set alt_hold_deadband = 50 set 3d_deadband_throttle = 50 set fw_autotune_overshoot_time = 100 set fw_autotune_undershoot_time = 200 set fw_autotune_threshold = 50 set fw_autotune_ff_to_p_gain = 10 set fw_autotune_ff_to_i_tc = 600 set inav_gravity_cal_tolerance = 5 set inav_use_gps_velned = ON set inav_gps_delay = 200 set inav_reset_altitude = FIRST_ARM set inav_max_sonar_altitude = 200 set inav_w_z_sonar_p = 3.500 set inav_w_z_sonar_v = 6.100 set inav_w_z_baro_p = 0.350 set inav_w_z_gps_p = 0.200 set inav_w_z_gps_v = 0.500 set inav_w_xy_gps_p = 1.000 set inav_w_xy_gps_v = 2.000 set inav_w_z_res_v = 0.500 set inav_w_xy_res_v = 0.500 set inav_w_acc_bias = 0.010 set inav_max_eph_epv = 1000.000 set inav_baro_epv = 100.000 set nav_disarm_on_landing = OFF set nav_use_midthr_for_althold = OFF set nav_extra_arming_safety = ON set nav_user_control_mode = ATTI set nav_position_timeout = 5 set nav_wp_radius = 100 set nav_wp_safe_distance = 10000 set nav_auto_speed = 300 set nav_auto_climb_rate = 500 set nav_manual_speed = 500 set nav_manual_climb_rate = 200 set nav_landing_speed = 200 set nav_land_slowdown_minalt = 500 set nav_land_slowdown_maxalt = 2000 set nav_emerg_landing_speed = 500 set nav_min_rth_distance = 500 set nav_rth_climb_first = ON set nav_rth_climb_ignore_emerg = OFF set nav_rth_tail_first = OFF set nav_rth_allow_landing = ON set nav_rth_alt_mode = AT_LEAST set nav_rth_abort_threshold = 50000 set nav_rth_altitude = 1000 set nav_mc_bank_angle = 30 set nav_mc_hover_thr = 1500 set nav_mc_auto_disarm_delay = 2000 set nav_fw_cruise_thr = 1400 set nav_fw_min_thr = 1200 set nav_fw_max_thr = 1700 set nav_fw_bank_angle = 20 set nav_fw_climb_angle = 20 set nav_fw_dive_angle = 15 set nav_fw_pitch2thr = 10 set nav_fw_loiter_radius = 5000 set nav_fw_launch_velocity = 300 set nav_fw_launch_accel = 1863 set nav_fw_launch_max_angle = 45 set nav_fw_launch_detect_time = 40 set nav_fw_launch_thr = 1700 set nav_fw_launch_idle_thr = 1000 set nav_fw_launch_motor_delay = 500 set nav_fw_launch_spinup_time = 100 set nav_fw_launch_timeout = 5000 set nav_fw_launch_climb_angle = 18 set telemetry_switch = OFF set telemetry_inversion = OFF set frsky_default_latitude = 0.000 set frsky_default_longitude = 0.000 set frsky_coordinates_format = 0 set frsky_unit = IMPERIAL set frsky_vfas_precision = 0 set frsky_vfas_cell_voltage = OFF set hott_alarm_sound_interval = 5 set ibus_telemetry_type = 0 set ltm_update_rate = NORMAL set ledstrip_visual_beeper = OFF set i2c_overclock = OFF set debug_mode = NONE set acc_task_frequency = 500 set attitude_task_frequency = 250 set async_mode = NONE set throttle_tilt_comp_str = 0 set input_filtering_mode = OFF set mode_range_logic_operator = OR profile 1

set mc_p_pitch = 40 set mc_i_pitch = 30 set mc_d_pitch = 23 set mc_p_roll = 40 set mc_i_roll = 30 set mc_d_roll = 23 set mc_p_yaw = 85 set mc_i_yaw = 45 set mc_d_yaw = 0 set mc_p_level = 20 set mc_i_level = 15 set mc_d_level = 75 set fw_p_pitch = 5 set fw_i_pitch = 7 set fw_ff_pitch = 50 set fw_p_roll = 5 set fw_i_roll = 7 set fw_ff_roll = 50 set fw_p_yaw = 6 set fw_i_yaw = 10 set fw_ff_yaw = 60 set fw_p_level = 20 set fw_i_level = 5 set fw_d_level = 75 set max_angle_inclination_rll = 300 set max_angle_inclination_pit = 300 set dterm_lpf_hz = 40 set yaw_lpf_hz = 30 set dterm_setpoint_weight = 0.000 set fw_iterm_throw_limit = 165 set fw_reference_airspeed = 1000.000 set fw_turn_assist_yaw_gain = 1.000 set pidsum_limit = 500 set yaw_p_limit = 300 set iterm_ignore_threshold = 200 set yaw_iterm_ignore_threshold = 50 set rate_accel_limit_roll_pitch = 0 set rate_accel_limit_yaw = 10000 set heading_hold_rate_limit = 90 set nav_mc_pos_z_p = 50 set nav_mc_pos_z_i = 0 set nav_mc_pos_z_d = 0 set nav_mc_vel_z_p = 100 set nav_mc_vel_z_i = 50 set nav_mc_vel_z_d = 10 set nav_mc_pos_xy_p = 65 set nav_mc_pos_xy_i = 120 set nav_mc_pos_xy_d = 10 set nav_mc_vel_xy_p = 180 set nav_mc_vel_xy_i = 15 set nav_mc_vel_xy_d = 100 set nav_fw_pos_z_p = 50 set nav_fw_pos_z_i = 0 set nav_fw_pos_z_d = 0 set nav_fw_pos_xy_p = 75 set nav_fw_pos_xy_i = 5 set nav_fw_pos_xy_d = 8 set rc_expo = 70 set rc_yaw_expo = 20 set thr_mid = 50 set thr_expo = 0 set roll_rate = 20 set pitch_rate = 20 set yaw_rate = 20 set tpa_rate = 0 set tpa_breakpoint = 1500

Any help is very needed

Ralf-W commented 7 years ago

Power from USB cable is not sufficient to drive external MAG (+GPS). Did you connect an external 5V supply? Did you try to exchange Rx and Tx cables from MAG on I2C connector? Was internal MAG detected correctly before you disconnected it mechanically?

Schalonsus commented 7 years ago

Is it 3.3V or 5V Mag board?

DzikuVx commented 7 years ago

I also suspect it might be USB power connected. Onboard voltage stabilizer might be not strong enough, or even not powered when working only on USB.

georgekucher commented 7 years ago

First of all I have no internal MAG, that's why I bought this board http://www.robotpark.com/image/data/PRO/91457/GY_271_ELECTRONIC_COMPASS.pdf As you can see, it is 3-5V. Today I've tried to connect 4S lipo to my FC, but no luck. Also I tried supplying MAG with 3.3V and 5V. Connect external 5V (Power Bank) to FC and to MAG (when it was connected to 5V supply) Voltage is present on MAG in every case. But it is still UNAVAILABLE in configurator. And of course I've tried to swap SDA SCL lines, no luck. Maybe you know something about "i2c_overclock" setting? Should it be on or off? P.S. I had familiar troubles with connecting my BT-GPS module to FC. But as I found out it was a soft problem. I rebuilt custom FW (with NMEA protocol) and it worked. But here - I'm out of ideas. Wish I had oscilloscope, but now it's only multimeter((

Thanks a lot for all your answers. Maybe there is something I missed?...

giacomo892 commented 7 years ago

Check if SDA SCL has some voltage when you power the module up (disconnected from the FC)

georgekucher commented 7 years ago

Yes it has almost the same voltage as its power supply VCC (3.3V if supplied 3.3V and 5V i suppled 5V)

giacomo892 commented 7 years ago

I you have an arduino lying around try to connect the mag to it and check if it is working :)

georgekucher commented 7 years ago

Sadly I have no arduino(( But maybe there is another way to check it? I have pl2303 board. And some other old hardware...

georgekucher commented 7 years ago

By the way. I read about some kind of pullups (4.7K resistors between SDA - VCC and SCL - VCC). May it help?

Allerhopp commented 7 years ago

Usually there are internal 1k pullups, you can measure them with a multimeter between SDA - VCC and SCL - VCC. If there are no internal pullups it is surely worth a try to add them.

georgekucher commented 7 years ago

there are 2.18kOhm & 2.18kOhm between them You mean measuring MAG board, right?

Allerhopp commented 7 years ago

OK. In my pov. it does not matter, where the pullups are. Presumably there are also pullups in your Flip32. Out of interest, can you measure the Flip pullups also? If there are also pullups and you can remove the MAG pullups easily ......

georgekucher commented 7 years ago

But I didn't put there any pullups...

Allerhopp commented 7 years ago

Sorry, for not being clear. My suggestion is, if there are pullups on both sides, to remove them on the mag, if this is possible. Then try again, if the mag is detected by the Flip. But i see only a little chance, this will do the job.

KiwiDavid commented 7 years ago

Hi, The HMC5883L is rated 3.6V max and is typically powered off a 3.3V regulator associated with the GPS chip. 5V on its supply is in excess of it's absolute max rating. The GPS will require an external battery to be powered up and I wouldn't expect the USB to run GPS and mag. If the GPS is active then so should the mag sensor be working as it draws only very small currents.

The pull-up resistors are not critical and are usually located nearer the host rather than the slave. The I2C bus is active low but passive (resistive) high. Provided the resistors are low enough in value to provide a fast +ve going edge for clock and data that is all that matters. The open drain outputs provide the active low signal. The resistors are driving the total bus capacitance - the more slave devices and bigger the layout the lower the resistors have to be in value. I doubt you would need to go under 2k2 even at 400kHz clock rate.

I'm having problems with my external mag sensor (on SPRacing F3) not being recognized but mine is temperature sensitive - it won't initialize under about 20C but is fine above that. I have a scope and logic analyzer and I can see that below 20C the host micro never addresses the mag sensor. If you make a small change in an unrelated setting and do a Save/Reboot does the mag sensor suddenly appear? (make sure the GPS is powered first.)

Cheers, David

KiwiDavid commented 7 years ago

Hi again, Sorry - I may have scared you - the mag device you have has a 5V to 3.3V regulator on the board so you can feed the supply pin with 5V but not directly on to the mag sensor chip itself. A word of caution - your circuit also has 3.3V to 5V non-inverting level translating. The host micro won't really like having 5V logic sent to it. The pull-ups are the 4k7 resistors but you may be better coming directly off the mag sensor and remove the two discrete logic translating FETs and the 4 resistors. This would make it basically the same as GPS/ mag sensor combo. I don't think you will have damaged anything because the currents would be limited but I think your micro would be expecting 3,3V logic rather than 5V. Cheers, David

georgekucher commented 7 years ago

Hello! I was at my friend's (he has an oscilloscope) and we measured signals at SDA, SCL pins at FC and MAG separately. So FC sends signals 500Hz (he might be wrong in calculations because his oscilloscope is analog and very old) but MAG sends nothing (straight line which is on VCC level 3.3V on both SDA and SCL pins). Does it mean that MAG is dead, or it is just waiting for some signal from FC to start work?? Also I measured pullups on FC, they are 1k both, so when I plug MAG, overall impedance is near 0k67 on each (SDA-VCC and SCL-VCC).

KiwiDavid commented 7 years ago

Hi, The I2C bus is common to the FC, gryo/acc, mag and baro (if fitted) so looking at the SDA or SCL on any device should see the total bus activity. If you don't see activity on the mag SDA and SCL lines then it's not connected. The FC is master and will send commands so even if the mag sensor was dead you would see activity unless the both lines were shorted to 3v3 but you have already confirmed you see bus signals elsewhere. Are you sure you have connected to the correct place? You still have the issue of the level translation being 5V outputs and not 3v3. Your mag widget is trying to pull the bus lines to 5V. I would at least remove the resistors from drain to 5V on your board and let the translation FETs share the FC's pullups but ideally you should remove all the level translation circuit. Good luck.

Cheers, David

georgekucher commented 7 years ago

Hello, As for wiring, I connected according to this diagram. Answering to your previous questions: It not appears after I make small change in config and save/reboot, even if it is ON pretty long. By the way, my GPS and MAG are the separate boards. And about 3.3V and 5V logic: Does my MAG board try to pull the logic levels to 5V even if it is powered with 3.3V? If so, could you please mark the components which should be removed, sadly I'm not very good electrician(( Here is the photo: GY-271

This would make it basically the same as GPS/ mag sensor combo.

Does it mean that I should set "GPSMAG" in configuration?

KiwiDavid commented 7 years ago

Hi, Well it's clearly marked for SDA and SCL so provided you have the correct connector and it's wired from SDA on the FC to SDA on the mag sensor and similarly for SCL you should be ok. Have you also selected the HMC5883 in the sensor list under the configuration tab?

Your mag board has level translation FETs to change the sensor's 3.3V output back up to 5V. These resistors will be trying to pull the whole I2C bus up to 5V but I suspect it will only reach about 3.9V when some of the input protection diodes on the other sensors and the micro begin to conduct and clamp the voltage. Ideally you need to remove the 4 parts marked 222 (2k2 resistors) and the 6pin IC (2x FETs). You then need to run a small wire (fine enamel wire) from pin 1 of the HMC5883 directly to the SCL output pin and another from pin 16 of the HMC5883 to the SDA output pin. Rather than try to solder to the sensor pins you can follow the track to the resistors or the pads of the 6 pin IC and solder from there. This will then leave you with a mag sensor powered off a 5V line but regulated down to 3.3V. It will have no pull-up resistors and hence will share those on the FC itself. Output level will be 3.3V as dictated by the FC's power supply. If your GPS is working don't change anything. Just make sure you have selected the mag sensor as mentioned above. Try this first if you haven't already - you may find it works without modifying the level translation circuitry. Good luck.

Cheers, David

georgekucher commented 7 years ago

Thanks for your answers, David. Yes I'm connecting exactly as you describe and setting HMC5883 in configuration from the start. And thanks for the detailed description of what I have to do. I will try and let you know. Have a nice day!

georgekucher commented 7 years ago

I did everything like you said and still nothing(((( The strange thing is that during all my attempts I never saw I2C errors, it's always zero

And there is no more voltage on MAG's SDA SCL pins (I suppose it should be so).

KiwiDavid commented 7 years ago

Hi George, It still seems like the SDA and SCL lines are not connecting. They should idle high at 3.3V and pulse low with I2C bus activity. On a busy line they will be low almost as much as they are high so if reading the average voltage they would be between about 1.6V and the 3.3V idle state. Is there any chance the mag module is not being earthed back to the same ground as the micro? That would cause some strange errors especially if measuring voltage at the mag sensor. Are the pins in the connector still there and not bent or broken off? You mentioned earlier your friend had seen bus activity but not on the mag module - this indicated that the module wasn't connected properly. You may be able to use a multimeter to check for continuity between the back of the FC's I2C port connector and the respective SDA and SCL on the mag module. Also check the ground for continuity. Do the continuity checks with no power connected. Please get back if you have any further information.

Cheers, David

georgekucher commented 7 years ago

Hi David, All connections are good. I even caught couple of I2C errors when connect SDA - SCL (or swapping them) while FC is powered ON, which means that pins on FC are correct (I2C). But no MAG was detected (still MAG=UNAVAILABLE). I've ordered an Arduino UNO and gonna to check the MAG with it. Is there any known models of external MAGs which are 100% working with my Flip32 FC (not very expensive)?

KiwiDavid commented 7 years ago

Hi George, This is not good. I can't imagine that the FC has anything to do with it. The sensor is stand-alone with no other circuitry associated with it and even the pull-up resistors are shared with the other sensors so they are in place and working. I checked the I2C bus speed on my SP Racing F3 iNav install (1.7.1) and it's running 400kHz. This is the top speed for the sensor but still within its spec. I don't know much about the Flip32 but I2C is I2C so if it's reading gryo/acc and baro (?) the mag sensor should be no problem. It may pay to ask the question on the general forum for recommended mag sensors but many people use the GPS/mag combo. This is no different - they are usually supplied by 5V and regulated down to 3.3V for GPS chipset and the mag sensor. GPS is usually connected to a UART and the sensor to I2C , It's just two chips sharing the same housing and regulator but otherwise separate. You should be able to find code for the UNO and I'm sure the part will run perfectly. Bad chips are very rare and are usually unwittingly abused rather than "bad". I also doubt there are many if any clones of these sensor chips.

Cheers, David

georgekucher commented 7 years ago

Thank you David for your answers.

KiwiDavid commented 7 years ago

Check out issue 1903 - just in case this relates to your board.

Cheers, David

digitalentity commented 7 years ago

@georgekucher cau you take a high-res photo of your compass chip? Would be good to check if it's indeed an HMC5883 or a pin-to-pin compatible part with incompatible software interface.

georgekucher commented 7 years ago

img_4015 img_4019 img_4021 img_4022 img_4024

giacomo892 commented 7 years ago

Also clean a bit the solder point :) That might help too! @georgekucher . Also those Flip32 AIO, which I had 2 of them, lasted like 10 minutes. I was even unable to make the first flight with them before the died.

georgekucher commented 7 years ago

I have two of them as well. First I've damaged a bit (its UBEC is dead and I have use externall 5V) but it flights ok for several months. Second I use for flashing and connecting new devices. As for my soldering skills, they are weak, but I have soldered & desoldered couple of times so won't help((

KiwiDavid commented 7 years ago

Hi George, Any chance of a direct close up looking down on the mag chip. I think DE is trying to establish if your mag chip is a Chinese ring-in rather than the Honeywell part which is supported by the software.

Cheers, David

georgekucher commented 7 years ago

I'll make a photo in after 3 hours. I finally read 1903 post and I hope that there is the problem... So fingers crossed))

georgekucher commented 7 years ago

img_0002

georgekucher commented 7 years ago

Hmm.. Seems like this is S883 or 5883 chip

georgekucher commented 7 years ago

img_0001 img_0003 couple more

georgekucher commented 7 years ago

May this code help me? It's from here

Redshifft commented 7 years ago

Yeah that's certainly not a HMC5883, I posted a picture here..https://github.com/iNavFlight/inav/issues/1903

What happened to the board ? It looks like you attacked it with a flame thrower :)

digitalentity commented 7 years ago

@georgekucher this is not a HMC5883L, looks more like QMC5883: image

digitalentity commented 7 years ago

I'm closing this issue since we tracked it down to an incompatible sensor chip. Further discussion should happen in the issue about supporting that chip #1903. @georgekucher you are more than welcome to help with testing new code that we can start writing now :smile:

georgekucher commented 7 years ago

Thanks for all your help. I'll be waiting go that feature to be ready to test. Besides I am ATQC, so testing is my job)))

Reyoking commented 4 years ago

I bought a HMC5883l and it had the MAG=UNAVAILABLE problem. got it working by changing the setting in configuration tab under magnetometer to QMC5883.