-
Notifications
You must be signed in to change notification settings - Fork 18k
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
AP_InertialSensor: Murata SCH16T IMU #26876
base: master
Are you sure you want to change the base?
Conversation
Hi @dakejahl, Thanks for this. I'll leave it for others to answer your questions but I've noticed a couple of small things that will need fixing:
Thanks again |
62727a0
to
0eded27
Compare
18b2691
to
2a1da7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main thing you need to do is restructure to use register_periodic_callback rather than creating a new thread
Alright I am using register_periodic_callback now, for the time delays between states I am using adjust_periodic_callback to set the next callback time, is this the correct way to do it? Should I even use the drdy pin? I don't see any examples of IMU drivers using it with an interrupt callback for scheduling the read |
and yes those two functions are the correct way to adjust the period if you need to |
11017c6
to
de107a1
Compare
@andyp1per Thanks for the help with this. I've tested this successfully and am ready for final review. You can ignore the hwdef file since those changes are just for testing. If there's anything else in the driver to change let me know. If it looks good I'll rebase on master and re-commit each file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to converge on filters and speeds suitable for ArduPIlot
_registers[0] = RegisterConfig(CTRL_FILT_RATE, FILTER_68HZ); // 68Hz -- default | ||
_registers[1] = RegisterConfig(CTRL_FILT_ACC12, FILTER_68HZ); // 68Hz -- default | ||
_registers[2] = RegisterConfig(CTRL_FILT_ACC3, FILTER_68HZ); // 68Hz -- default | ||
_registers[3] = RegisterConfig(CTRL_RATE, RATE_300DPS_1475HZ); // +/- 300 deg/s, 1600 LSB/(deg/s) -- default, Decimation 8, 1475Hz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You really want to read at the highest rate you can if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I validate CPU usage? In PX4 1475Hz uses 15% CPU. My concern is higher update rates means more CPU and higher required SPI rate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see by building with --enable-stats and looking at @SYS/threads.txt
@andyp1per I agree with you on the update rate and filter settings, we need to do more testing to determine the best settings. I could create a parameter that configures the rate and filter settings, is this an acceptable thing to do in ardupilot? In PX4 some drivers expose parameters so the user can tweak things like this. We're developing this driver for Murata, but we don't have it integrated into a product yet so our flight testing has been limited. We flew it on PX4 and it worked well. The other consideration is SPI bus speed, at higher update rates we'd need to increase the bus speed, but right now on my frame it's external with kinda long wires. Ideally I'd like to get this merged just to get it in and we can come back to fine tuning the settings once we have it properly integrated on a frame. Does this work? |
289d6f5
to
ae78619
Compare
Generally we don't want to do it like that - we want evidence that it works successfully on a flying vehicle complete with a log. Don't want to include code that isn't going to practically work 😄 |
Ping @dakejahl .... got some dataflash logs from a flying Copter? |
@peterbarker thanks for the follow up. No I don't have any logs yet. This driver integration has fallen to the bottom of my priority list. We're waiting on some higher range versions of the chip anyway, which are more suitable for drones |
Still need to validate on hardware. I can't tell if the IMU driver is running or not, is there anyway to quickly validate sensors on the bench? Using
hal.console->printf()
andprintf()
doesn't output anything on the debug uart.Any suggestions for the best way to validate a new IMU?
You can see where I added printfs at. I'm taking off for the day but when I'm back I'll keep looking around.