Commit Graph

3438 Commits

Author SHA1 Message Date
crossa ed319ce5d5 1. Add comment written in English
2. Rewrite and rebase pca9685 driver
3. Try to fix issue when push the stick of channel 3 to the maxmum position, 0uswill be output to channel 1, should be maxmum pwm signal
4. Fix the code style
2017-07-13 16:53:28 +02:00
crossa ea2a3acbd8 This driver has been tested and finished first flight
Now I've fixed style of the code
2017-07-13 16:53:28 +02:00
crossa c89351c453 Add PWM output driver with raspberry pi+pca9685 module 2017-07-13 16:53:28 +02:00
crossa 4839e5cd19 Fix code style 2017-07-13 16:53:28 +02:00
crossa 7b108eb879 Reading the pwm signal from shared image.
Both 8 channels PPM encoder and 8 channels revicer are required.
Before launch px4, ppmdeocde programe should be launched.
To download ppmdecode programe,
visit https://github.com/crossa/raspberry-pi-px4firmware.
Pxfmini and navio are not popular autopilot hardware in china,
I can handly to purchase it.
So that I use raspberry pi to build autopilot separately.
This dirver help us to decode ppm single to pwm and pushlish it
2017-07-13 16:53:28 +02:00
David Sidrane fc30f2906f mpu9250:Use a cpu speed independant _reset_wait generations.
This change first pushes out the _reset_wait by 100 Ms.
   which is about 3 time longer then the code take to execute.

   Then it does the reset of the accel, gyro and mag and
   the ends the wait by setting _reset_wait to now+10 us.
2017-07-11 09:51:31 +02:00
David Sidrane 3f0d26c949 mpu6000:Support different clock freq per IC type 2017-07-11 09:51:31 +02:00
David Sidrane 3c42c8f7fa mpu9520:Use maximum clock rate
The MPU9250 and MPU6500 buth support 1 Mhz and 20 Mhz. Buy upping the clocc we will get the maximum clock rate the driver
   supports that is <= 20 Mhz. This will boost the FMUv4Pro SPI speed to 11.25 Mhz (it was half that)
2017-07-11 09:51:31 +02:00
David Sidrane 22d0ea15de px4fmu-v3:Add ICM20608 aliased to the PX4_SPIDEV_ACCEL_MAG to the v3 build
The Pixkhawk mini was not chip selecting the ICM20608 as it did
   not define PX4_SPIDEV_ICM_20608. This allow the fmu V2 rc code
   to init the ICM20608.
2017-07-11 09:49:22 +02:00
David Sidrane 195468bf06 px4fmuv4pro:Init GPIO_VDD_3V3_SENSORS_EN off at reset
Insure a 0.0 voltage initial condition on VDD_3V3_SENSORS
  By starting the GPIO_VDD_3V3_SENSORS_EN, low and deferring
  the GPIO init of the slave selects and drdy signals until
  board_app_initialize. We get ~ 180 ms of power off time
  with 0.00 voltage applied to the sensors.
2017-07-11 08:34:26 +02:00
Lorenz Meier c89bd5c8fd HMC5883: Fix range setup 2017-07-10 08:32:19 +02:00
Daniel Agar 585984fa0c fmuservo increase stack 2017-07-09 18:02:55 +02:00
Lorenz Meier 80461fad6b Camera trigger: Support triggering one image immediately.
This allows to re-enable the distance trigger and immediately take a picture. This is helpful to ensure survey areas are covered on entry and exit.
2017-07-09 14:49:21 +02:00
Daniel Agar f45b9048aa GPS driver increase stack (244 bytes left) 2017-07-09 13:09:22 +02:00
Daniel Agar e303c2ad89 eagle tree airspeed allow negative differential pressure 2017-07-08 21:54:04 +02:00
Lorenz Meier 24ffada340 MPU9250: Hold off from reboot a little longer. Fixes #7555 2017-07-08 16:38:18 +02:00
Lorenz Meier 9cd93dcf03 MPU9250: Fix boot on Pixhawk Mini
This requires further investigation. Hotfix.
2017-07-08 16:31:12 +02:00
David Sidrane f722614ec0 mpu9250:Stop per counter on failed read 2017-07-08 15:37:46 +02:00
David Sidrane fbf6532c25 mpu9250:reset the mag on the reset operation
This commit fixed a bug were the mag was orphened on a reset.
   That resulted in MAG timeouts on reset or test operations and
   left the mag in a broken state.
2017-07-08 15:37:46 +02:00
David Sidrane 8bd044e80e mpu9250:mag rework the setup to veify HW first
If the setup is unsucessful fo not register the devices or
   allocate resources.
2017-07-08 15:37:46 +02:00
David Sidrane aec109ac2c mpu9250:mag restructure to have proper retires for setup
We want to setup the mag interface with retries and report
  failurs.

  Move retry logic to contol point, instead of hiding re-reading
  the ID in ak8963_check_id.

  Allow it to fail once to overcome a read of 0 on firt read.
  after 2 failure report error to console and reset the
  mpu9250's I2C master (SPI to I2C bridge)

  The same retry logic is used on the ak8963_read_adjustments
  with a reset of the I2C master module after 5 fails. If it
  fails fter 10 retires. Disabel the mad and report the failure
  on the console, stating it is disabled.
2017-07-08 15:37:46 +02:00
David Sidrane 270dd5282a mpu9250:Add modify checked register api
Provide an API for the mag to use read-modify-write
2017-07-08 15:37:46 +02:00
David Sidrane ef67b75057 mpu9250:Added comment on BYPASSING the internal i2c master bridge 2017-07-08 15:37:46 +02:00
David Sidrane c3addd931c mpu9250:Issue error on console when a device fails to take initialization
On initialization, if after 3 retries to re-init the mpu9250 from
   the checked registers values, it fails. Ensure thath the fact the
   driver is exitting is logged to console.
2017-07-08 15:37:46 +02:00
David Sidrane 3272cc62d4 mpu9250: Do a reasonable post chip init validations, reporting errors
Check that the mpu9250's configured registers match the settings
   written to them. Attempt to fix any that do not up to 3 times.
   printing erros to the console on mismatches and returning
   faliure if after 3 attempts the any of the values are
   still wrong.
2017-07-08 15:37:46 +02:00
David Sidrane 7e293ab1d3 mpu9250:Fix errant comment 2017-07-08 15:37:46 +02:00
David Sidrane 5a53d92f22 mpu9250:Remove foklore delays
Remove delays on each register write in the
   reset function. Leaving only the delay
   following chip reset prior to configurations.
2017-07-08 15:37:46 +02:00
David Sidrane b4d23a3f2c mpu9250:Rmove magic number, add ACCEL_RANGE_G 2017-07-08 15:37:46 +02:00
Julian Oes 9854fc0d84 Set timestamp with vehicle commands
The vehicle_command uORB messages had the timestamp unset at 0.
2017-07-08 11:52:23 +02:00
David Sidrane 6eff7deb7e Extend the delay ensure post reset pulse delayed.
Given the original poster's comment that "It happens very consistently for us." I suspect the motor spin observed in https://github.com/PX4/Firmware/issues/7457 is not caused by the original issue of slow decay on the PWM pins at reset, but the post reset pulse of 3.1 Ms arriving in a window that the ESC considers it valid.

The results from testing, indicated that the if the PWM pins were clamped low for > 300 Ms, prior to reset the motors did not spin. This would delay the the post reset pulse of 3.1 Ms out by > 300 Ms. 

This change delays the reset and therefore the pulse by at least 400 Ms.
2017-07-08 10:51:43 +02:00
David Sidrane 65d8b5c9cd px4fmu-v4:Insure the discharge of the pins PWM pins on rest.
On resets invoked from system (not boot) insure we establish a low
  output state (discharge the pins) on PWM pins before they become
  inputs.
2017-07-08 10:51:43 +02:00
Lorenz Meier f7ba70a032 MPU6K driver: Ensure that default range is always 16g by default 2017-07-06 22:15:53 +02:00
Daniel Agar eb067291bf airspeed sensors apply offset separately 2017-07-06 10:05:07 -04:00
Daniel Agar c45d369004 ms5525 use int64 for calculation 2017-07-06 10:05:07 -04:00
Daniel Agar 95eaac6876 bmp280 properly cleanup if failed 2017-07-06 10:05:07 -04:00
Daniel Agar 32068dcd17 px4io increase stack 2017-07-06 10:05:07 -04:00
Daniel Agar 73d9358b1d meas_airspeed rename to ms4525_airspeed 2017-07-06 10:05:07 -04:00
Daniel Agar 7029be87c0 MS5525 differential pressure driver 2017-07-06 10:05:07 -04:00
Nicolae Rosia 2092770361 Integrator: fix comparison
Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
2017-07-06 08:48:44 +02:00
Daniel Agar af5256c454 GPS ublox add dynamic model parameter 2017-06-30 08:02:25 +02:00
Daniel Agar 40d40330b8 delete unused pio 2017-06-29 03:23:39 -10:00
David Sidrane fc25213811 auav-x21:Delete PX4_I2C_BUS_ONBOARD 2017-06-29 07:59:56 +05:30
Julien Lecoeur 7929287f73 Fix -Werror=format-truncation on GCC 7
Fix formatting

Check snprintf return for error AND overflow
2017-06-26 15:50:44 +02:00
Julien Lecoeur 06c6a0cdec Fix -Werror=implicit-fallthrough errors on GCC7 2017-06-26 15:50:44 +02:00
Daniel Agar ca480ff868 ms4525 treat max temperature as an error 2017-06-24 22:40:51 +02:00
Daniel Agar 6a443765a5 cmake only include mavlink where used 2017-06-19 20:24:09 +02:00
Beat Küng 410e822775 px4fmu-v4pro board_config: swap BRICK1 with BRICK2
problem: previously when connecting power to Power 1, commander refused
to arm (no power source error), and when connecting to Power 2, arming
works, but power consumption was not measured (& shown in QGC).
Swapping Brick1 with Brick2 makes sure both works when connecting to
power 1.

Ideally we will have support for both power sources (including fail-over)
2017-06-19 16:52:41 +02:00
Lorenz Meier 0a8b9061cf SDP3x driver: Minor cleanup in driver 2017-06-19 09:26:27 +02:00
Beat Küng 90df55123b lps25h_spi.cpp: remove MAGIOCGEXTERNAL ioctl
Because it's a baro driver, not a mag.
2017-06-14 19:53:07 +02:00
Beat Küng ce7d8d2270 sensor_mag.msg: add is_external flag & set it in the mag drivers
With this we don't have to use the ioctl MAGIOCGEXTERNAL, which does not
work on POSIX (eg. RPi).
2017-06-14 19:53:07 +02:00