Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixracer Issues #3544

Closed
4 tasks done
RomanBapst opened this issue Jan 19, 2016 · 20 comments
Closed
4 tasks done

Pixracer Issues #3544

RomanBapst opened this issue Jan 19, 2016 · 20 comments

Comments

@RomanBapst
Copy link
Contributor

  • gps and mag cable are not wired correctly (on the DF13 side)
  • need I2C splitter with power for e.g. airspeed sensor
  • rc calibration is lost sometimes (sombody needs to confirm this)
  • PREFLIGHT FAIL: AIRSPEED SENSOR MISSING
    NOT ARMING: Configuration error (airspeed sensor was calibrated before)
@LorenzMeier
Copy link
Member

@Tumbili We need to work out what is going on with your airspeed sensor.

@LorenzMeier
Copy link
Member

@kd0aij Could you maybe create a splitter cable for your GPS and see if you can get GPS with Mag plus airspeed to work?

@kd0aij
Copy link
Contributor

kd0aij commented Jan 24, 2016

next on my list :)

@kd0aij
Copy link
Contributor

kd0aij commented Jan 24, 2016

I have 3DR GPS + mag, RGB LED and airspeed sensor working on R12, with all I2Cs in parallel on the GPS connector.
Booted several times USB only and power module only with no problems.
"tests sensors" reports "tests: command not found" though.

@pkocmoud
Copy link
Contributor

I can confirm using the current master (commit 6eac78d)

tests sensors
nsh: tests: command not found

@kd0aij
Copy link
Contributor

kd0aij commented Jan 24, 2016

I haven't been able to figure out why "tests" shows up in nsh help, but the command can't be found. It doesn't appear in help when built for FMUv2, so that's a clue that perhaps it's been removed from some configuration file that I don't know about and haven't been able to find with grep.

@LorenzMeier
Copy link
Member

The result also is printed if not enough memory is remaining (and the tests command has massive RAM requirements). We probably need to trim it down and that's all.

@kd0aij
Copy link
Contributor

kd0aij commented Jan 25, 2016

I noticed that builitn_commands.c calls for 60,000 bytes of stack, and there certainly isn't that much free RAM.
Reduced the stack requirement by a factor of 10 to 6000 and "tests all" runs without hanging.
"tests sensors" output looks ok too. (in src/systemcmds/tests/CMakeLists.txt)

@kd0aij
Copy link
Contributor

kd0aij commented Jan 25, 2016

Still have observed no failures of RGB LED or 3DR digital airspeed sensor.

@kd0aij
Copy link
Contributor

kd0aij commented Jan 25, 2016

This shows the problem with I2C on the PixRacer. The airspeed sensor and RGB LED are powered with Vdd=5V, hence a valid logic high level is 3.5V. But the bus master is generating valid levels for Vdd=3.3V and SCL/SDA are never reaching a valid high level for the 5V devices. Reducing Vdd to 4.6V alleviates the problem by reducing VIH to .7*4.6=3.22V but there is very little noise margin in that case.

Logic thresholds obtained from I2C spec here (sec 3.1.2 and fig 38): http://www.nxp.com/documents/user_manual/UM10204.pdf

scl

@LorenzMeier
Copy link
Member

@kd0aij If you raise your pull-up current (adding additional pull-ups), does it fix the issue? Your point regarding the reference manual makes perfect sense and its the kind of well-researched issue that really advances insight.

I would like to understand why this works on Pixhawk though (even if it might be marginal). So until I do, I'm not yet convinced we found the root cause.

@kd0aij
Copy link
Contributor

kd0aij commented Jan 26, 2016

Testing with PH1 shows that the variance of diff_pressure (using QGC, units specified as "float") increases from about 20 with USB power to about 100 when powered by the 3DR power module.
Could this indicate communication errors resulting from poor noise margin on the I2C bus, becoming worse at higher values of VDD for the MS4525DO sensor?
SCL and SDA levels look identical to those for the PixRacer, but there appears to be less undershoot on the falling edges.

scl_ph1

@pkocmoud
Copy link
Contributor

image
Airspeed Sensor Vcc 3.3v

@pkocmoud
Copy link
Contributor

image
Airspeed Sensor Vcc 5.0v

@pkocmoud
Copy link
Contributor

Using meas_airspeed info, Read errors almost disappear with a Sensor VCC below 4.7v. At 5.0v I see 1000s of read errors per minute. Above 4.7v at the sensor and meas_airspeed start routinely fails to start due to sensor not being detected. I have ordered some i2c level shifters to try as an additional test.

@pkocmoud
Copy link
Contributor

image
Airspeed Sensor Vcc 5.0v with the 120R resistors added to the i2c data lines.

@pkocmoud
Copy link
Contributor

The intermittent detection of the sensor when attempting to start the "meas_airspeed start" still exists with the 120R resistors added at 5V. When it does start, read errors persist.
At 3.3V Detection is 100% and read errors were 1 in 7000 reads.

@pkocmoud
Copy link
Contributor

image
Airspeed Sensor Vcc 3.3v with the 120R resistors added to the i2c data lines.

@LorenzMeier
Copy link
Member

So conclusion: Wrong design of the airspeed sensor breakout, its missing a PCA type I2C shifter from 3.3V to 5V. There might be more to it, but we can safely say that this is a critical contributor. Nothing looks wrong on the Pixracer schematic.

@LorenzMeier
Copy link
Member

I'm closing this since no Pixracer issue. I filed a new one:
pixhawk/Hardware#55

@kd0aij @pkocmoud Thanks for the scope shots!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants