Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • brtaylor's Avatar
    Yesterday, 11:55 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    I use the UBX-NAV-PVT packet in my uBlox library: https://github.com/bolderflight/UBLOX The baud is selectable in the library.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    Yesterday, 10:35 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    The one thing to watch out for is that the version of the 7 state EKF on github only updates the magetometer in combination with an accelerometer update.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    Yesterday, 10:34 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    In his thesis, he is keeping the magnetometer from affecting the pitch and roll channels. The issue is that the accelerometer is affecting the yaw channel.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    Yesterday, 09:44 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Some interesting observations so far: 1. I can reproduce the drift that Don and Mike are seeing if I "fly" the IMU by hand. I'm using a book clamped to a work table to set the initial alignment with and I can compare...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    Yesterday, 05:36 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Thanks for the thoughts on tuning! I'll have to investigate that more. I'll also be interested to hear what you and Mike find as you play with the filter. When you're checking margins, is it similar to control laws...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    Yesterday, 02:31 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    That makes sense to me. I'm modeling the process noise as only gyro covariance. In reality, there are some unmodeled dynamics and other effects (possibly even gyro rate saturation if you really move the sensor hard)....
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    Yesterday, 01:13 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Interesting. I'm not seeing drift, but I also haven't tried rapid movement yet. Any suggestions for tuning to help constrain it?
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-18-2018, 08:59 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    I haven’t, but i could do more testing (different IMUs, microcontrollers, etc).
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-18-2018, 08:21 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    I just pushed a function to GitHub that should work.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-18-2018, 07:41 PM
    brtaylor replied to a thread uNav INS in General Discussion
    My thought process for the INS is to extend the 7 state EKF (https://github.com/bolderflight/uNavAHRS) integrating to NED velocities and NED positions (from a starting location). The measurement update would be the NED...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-18-2018, 07:26 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    FYI, I've cleaned up the 7 state library and pushed it to GitHub: https://github.com/bolderflight/uNavAHRS
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-18-2018, 04:51 PM
    I don't know of a good way to check the hardware over SPI. It's returning -1, which means the code isn't talking to the board at all. Your listed pinout looks good. Looking at the schematic for the Sparkfun breakout, I...
    7 replies | 256 view(s)
  • brtaylor's Avatar
    01-18-2018, 04:34 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Yes, that's correct.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-18-2018, 03:31 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Funny, I combined it into a single step in the 7 state version of the EKF. I still need to work through whether one approach would be more technically correct than the other.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-18-2018, 03:29 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Thanks! I co-taught a course on navigation filters for a few years and am planning on doing something with all this code. I'm thinking derivations alongside examples that can be run to demonstrate the theory. Break it...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-18-2018, 02:11 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Attached is the 7 state EKF that I derived. Per the discussion earlier, this one is using doubles instead of floats as a test. The performance isn't bad, for me running a Teensy 3.6 at a CPU of 240 MHz and a MPU-9250...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-17-2018, 07:08 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    The attached is updated. I *think* the equations are correct now, but it's still a work in progress.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-17-2018, 06:48 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Just processing speed; however, the literature recommends using as high of precision as possible for Kalman filters. Trying doubles might be worth a shot, I haven't checked to see if we're hitting any issues that way.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-17-2018, 06:08 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    While deriving a 7 state EKF, I found some errors with my 4 state EKF attached above. Standby for a fix.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-17-2018, 12:16 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    That's interesting, I'll have to look into whether I'm over-running the frame or not.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-17-2018, 12:15 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Attached is one more version of the 4 state EKF. This is the same as above, except using measured heading for a magnetometer measurement update instead of Matthew Watson's approach. I also added the measured heading as...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-16-2018, 10:23 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Attached is a preliminary 4 state EKF. I developed the time update and accel measurement update. The magnetometer measurement update is from Matthew Watson's thesis. Right now, I take two minutes during initialization...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-16-2018, 06:21 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Hi Mike, Can you email me the thesis that this code is from as well? brian.taylor(at)bolderflight.com I re-derived the 4 state EKF equations and implemented them from scratch. I take a couple minutes of IMU data...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-13-2018, 09:49 PM
    brtaylor replied to a thread uNav INS in General Discussion
    I'm not 100% sure how the 15 state EKF is only working with 3 of the 4 quaternion states, so I would guess that you would want to do: 4 state, 10 state, and 15 state. Seems like it would be a good buildup. As I've...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-13-2018, 06:35 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    For this filter, the absolute heading accuracy is only as good as the heading given by the magnetometer, which is only as good as the magnetometer calibration. The filter is initializing with a heading value, using the...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-12-2018, 05:43 PM
    Your comments in the code aren't really matching what's coded. But your code, as is, runs fine for me with just the MPU-9250 attached. I think what's going on is that you're forgetting to set all of the slave select...
    7 replies | 256 view(s)
  • brtaylor's Avatar
    01-12-2018, 04:00 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    In the MPU-9250 library I transform the data so the gyro, accel, and mag are all on a NED system.
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-11-2018, 07:09 PM
    I would use analogWrite instead of the Servo library. I've successfully used this on servos requiring the smaller range that you mention with up to a 800 Hz refresh rate. Plus, you can send all of the servo commands...
    5 replies | 138 view(s)
  • brtaylor's Avatar
    01-11-2018, 06:29 PM
    brtaylor replied to a thread uNav INS in General Discussion
    Here are a couple of good references describing the different levels of coupling: http://www.insidegnss.com/auto/JanFeb07GNSSSolutions%20(secured).pdf...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-11-2018, 06:05 PM
    brtaylor replied to a thread uNav INS in General Discussion
    It's checking the serial buffer, parsing any serial data, and checking to see whether there is a complete GPS packet there. It will return "true" on the loop when a complete packet has been fully read and parsed off the...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-11-2018, 05:57 PM
    brtaylor replied to a thread uNav INS in General Discussion
    Hi Don, interesting discussion. My understanding is that it really depends on the dynamics of the vehicle and how well they're captured with your system equation used in the Kalman filter. In making a library, my...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-10-2018, 02:01 PM
    You should be able to use the following with the most current version of the MPU-9250 library: https://github.com/bolderflight/MPU9250 MPU9250 IMU(Wire,0x68); void setup() { Wire.setSCL(47); ...
    157 replies | 34993 view(s)
  • brtaylor's Avatar
    01-08-2018, 08:45 PM
    brtaylor replied to a thread uNav INS in General Discussion
    I agree, I've started working on a framework for that in the MPU-9250 library, but haven't pushed it to github yet. The idea being that you could grab the IMU data at different levels of processing (uncompensated data...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-07-2018, 05:22 PM
    brtaylor replied to a thread uNav INS in General Discussion
    Hi Don, - The code was originally developed using a 1 Hz GPS, but I currently use a 5 Hz unit. - Yes, the EKF uses LLA position and NED velocities from the GPS. - The EKF time update is run at whatever rate the...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-06-2018, 05:58 PM
    brtaylor replied to a thread uNav INS in General Discussion
    Awesome data, thanks! That'll really help inform some of the calibration programs on the MPU-9250 as well; looks like I should be using a longer time period for computing gyro bias for instance.
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-06-2018, 05:54 PM
    brtaylor replied to a thread uNav INS in General Discussion
    Probably not, if I recall correctly the MTK chipset only gives one GPS velocity measurement instead of a NED velocity.
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-06-2018, 05:52 PM
    brtaylor replied to a thread uNav INS in General Discussion
    That's a really good question and one that I would have to defer for the time being and think about more. My initial guess would be to apply the GPS measurement update to the IMU data closest in time to it and then...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-05-2018, 09:09 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Hi Fernando, This library doesn't output position. The 15 state EKF (https://forum.pjrc.com/threads/48856-uNav-INS) does, but it's not meant to go for more than a few seconds without a GPS update. You can google for...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-05-2018, 08:12 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Yes, I plan to continue working on and debugging this library. I recently did a little tuning, the process noise seemed to be set by default way too low for the potential dynamics between time updates. I increased the...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-03-2018, 07:19 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Also, I have a beta of the INS port uploaded and available to play with: https://forum.pjrc.com/threads/48856-uNav-INS?p=163880#post163880
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-03-2018, 07:18 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    I agree. I originally had the magnetometers updating at 10 Hz (an SRD of 9 for a 100 Hz time update, or 4 for a 50 Hz time update). The original Power PC code had a 50 Hz time update and 10 Hz measurement update. The...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-03-2018, 07:14 PM
    brtaylor started a thread uNav INS in General Discussion
    All, I've ported the University of Minnesota 15 state EKF to Arduino: https://github.com/bolderflight/uNavINS Beware, it's currently very beta and a work in progress. This filter was designed by Adhika Lie at the...
    37 replies | 1116 view(s)
  • brtaylor's Avatar
    01-02-2018, 08:26 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Yeah, I'll try to post the 15 state EKF in the next couple days. Was going to post it last week, but noticed some weird bugs. It's still buggy, but something to play with and start from. I'm not sure about the 7...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    01-02-2018, 04:47 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Hi Mike, in the original code (https://github.com/UASLab/OpenFlight/blob/master/FlightCode/navigation/micronav_ahrs.c), be is magnetometer offset and K_G is magnetometer scale factor. I neglected those terms in the port...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-31-2017, 10:51 PM
    brtaylor replied to a thread uBlox Library in General Discussion
    Hi Don, I'm currently using this one: https://hobbyking.com/en_us/ublox-micro-m8n-gps-compass-module-1pc.html But I would recommend buying this:...
    16 replies | 4495 view(s)
  • brtaylor's Avatar
    12-30-2017, 05:43 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    @mjs513, Thanks for running that calibration test. Seems like the more conservative approach is to calibrate at the desired full scale range. @hw99, I estimate both an offset and a scale factor for the calibration....
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-30-2017, 01:42 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Hi Mike, I debated with myself about that and ended up putting the accel and gyro at their lowest ranges for calibration. It really depends on the error sources. If we consider the source of the error to be the MEMS...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-29-2017, 11:16 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Hi Don, This is my recommendation for the calibration: https://forum.pjrc.com/threads/37891-MPU-9250-Teensy-Library?p=163250&viewfull=1#post163250 Hope that helps. Brian
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-29-2017, 04:42 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Thanks for the code and for trying out the filter! I can reproduce the issue with a Teensy 3.6 on I2C; I have a Teensy 3.2 sitting here and I'm sure I could reproduce it there as well. The issue is that by default we...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-28-2017, 03:55 PM
    FYI, if you're looking for a BME280 library, I have one here: https://github.com/bolderflight/BME280 From your scanner results, looks like the Teensy is able to see both devices.
    6 replies | 356 view(s)
  • brtaylor's Avatar
    12-27-2017, 11:14 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Can you post or send your code so I can test it? Thanks! Brian
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-27-2017, 11:07 PM
    My code isn't that smart. Eventually, I'd like to do something like a gauss newton sphere fitting model, but I was running into other error sources for that, so for now I'm just using the min and max values measured in...
    157 replies | 34993 view(s)
  • brtaylor's Avatar
    12-27-2017, 11:02 PM
    You won't be able to estimate both a bias and a scale factor unless you do both the positive and negative direction for each axis; you would only be able to estimate one of those by either attributing all error as a...
    157 replies | 34993 view(s)
  • brtaylor's Avatar
    12-27-2017, 03:13 PM
    Sure, I keep meaning to make a video of it, but haven't gotten around yet with the holidays. First, the gyros are calibrated during the begin function. All that's needed for a good gyro calibration is that the IMU is...
    157 replies | 34993 view(s)
  • brtaylor's Avatar
    12-17-2017, 08:39 PM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Hi Mike, Sure, here's the references: https://www.dropbox.com/s/gyliyofmq82c14g/04106325.pdf?dl=0 https://www.dropbox.com/s/x9q8lgsds3c6ypo/04215066.pdf?dl=0 Not much detailed information, but the only...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-17-2017, 02:28 AM
    brtaylor replied to a thread uNav AHRS in General Discussion
    Hi Mike, I just tried it out with a Teensy 3.5 on I2C, performance is a little slower, but the example runs fine. Silly question, do you have your interrupt going from the INT pin on the MPU-9250 to Pin 1 on the...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-16-2017, 12:11 AM
    brtaylor started a thread uNav AHRS in General Discussion
    Hi all, I ported the uNav Attitude and Heading Reference System (AHRS), which is a 7 state Extended Kalman Filter (EKF) used to estimate attitude and heading from IMU data, to work well as an Arduino library. ...
    175 replies | 6217 view(s)
  • brtaylor's Avatar
    12-13-2017, 08:10 PM
    One more update, I've added methods to calibrate the accelerometer and magnetometer. Methods to get and set the estimated bias and scale factor for each axis have also been added, which should make it easy to store your...
    157 replies | 34993 view(s)
  • brtaylor's Avatar
    12-12-2017, 02:01 AM
    You were close...this works: #include "RotaryEncoder.h" RotaryEncoder encoder = {RotaryEncoder(7, 8), RotaryEncoder(9, 10), RotaryEncoder(11, 12), ...
    2 replies | 254 view(s)
  • brtaylor's Avatar
    12-11-2017, 11:45 PM
    Minor update. The MPU-9250 library now estimates the gyro biases during the begin function and removes them during sensor reading. Additionally, you can call estimateGyroBias() to estimate and use new gyro biases. There...
    157 replies | 34993 view(s)
  • brtaylor's Avatar
    12-09-2017, 10:43 PM
    We’re a spinoff from the University of Minnesota UAS Research Labs and we’re developing a low-latency, deterministic, scalable flight control system. The UAS Research Labs primarily uses drones as a low cost means for...
    0 replies | 250 view(s)
  • brtaylor's Avatar
    12-02-2017, 01:26 AM
    Some news on the MPU-9250 library. It's been updated and should work with non-Teensy devices. In addition to Teensy, I'm also testing the library with the Ladybug STM32 board. The library methods have changed to better...
    157 replies | 34993 view(s)
  • brtaylor's Avatar
    12-02-2017, 01:18 AM
    ArduinoJson works well if you'd like to use JSON formatted strings for configuring your software. You'd still have to figure out a method for sending those strings, but it can help with the serialization and...
    14 replies | 989 view(s)
  • brtaylor's Avatar
    12-01-2017, 02:58 PM
    micros and elapsedMicros work well for this. https://www.pjrc.com/teensy/td_timing_millis.html https://www.pjrc.com/teensy/td_timing_elaspedMillis.html
    3 replies | 320 view(s)
  • brtaylor's Avatar
    11-27-2017, 07:30 PM
    I'll be doing a lot of work on the MPU-9250 library within the next couple weeks and will look into adding the wake on motion interrupt feature. Brian
    157 replies | 34993 view(s)
No More Results
About brtaylor

Basic Information

About brtaylor
Location:
Portland, OR

Statistics


Total Posts
Total Posts
234
Posts Per Day
0.35
Last Post
uNav AHRS Yesterday 11:55 PM
General Information
Last Activity
Yesterday 11:55 PM
Join Date
03-21-2016