Commit Graph

75 Commits

Author SHA1 Message Date
Euan 31f238849c Add support for A200S V4.1, add alternative DC Cal, expose I2C for LSM6DS3
Adds support for A200S V4.1
Move A200S V4 to its own folder.
Expose I2C for LSM6DS3 to allow other devices on the same I2C bus. (It is now setup the same as the other IMUs)

Add alternative DC Calibration routine for Low side shunt hardware with very high mosfet output capacitance. The usual calibration routine causes an offset in the current calibration at high voltage from the capacitance discharging through the motor inductance when the single phase goes low. The alternative routine switches all phases at 50% to give a clean V0 state. This routine should not be run while the motor is spinning, so automatic calibration on startup is disabled when this routine is selected.
2023-09-26 10:07:06 +01:00
Lukáš Hrázký ae571ab0fa imu: Fix lsm6ds3 HIGH Accel filter configuration for LPF2
According to datasheet, these are the bits of the CTRL8_XL register:
7: LPF2_XL_EN
6: HPCF_XL1
5: HPCF_XL0
4: HP_REF_MODE
3: INPUT_COMPOSITE
2: HP_SLOPE_XL_EN
1: 0
0: LOW_PASS_ON_6D

The code was setting bits 6 and 5, while according to the define names
and comments, it intended to set bit 7 (LPF2_XL_EN = 0b1) and bit 6
(HPCF_XL = 0b10).
2023-08-13 12:20:14 +02:00
Lukáš Hrázký cdaf477fee imu: Fix lsm6ds3 applying filters
The i2c_bb_tx_rx() function was transmitting only the register address,
not the value to set, resulting in only reading the value.

Also adds a missing return value check for one of the calls.
2023-08-13 12:20:14 +02:00
Benjamin Vedder c46da32e61 Fixed warning and some tweaks 2023-03-11 10:18:32 +01:00
Dado Mista 0ad321a186 Support for IMU_FILTER_MEDIUM/HIGH in LSM6DS3TR-C IMUs
Hardware filtering functionality imported from tested 5.3v6 release.
TR-C variant has highly configurable filtering, this patch
implements a basic ODR/4 or ODR/9 filtering for the common IMU
sampling rates (400Hz..1600Hz)

IMU_FILTER_LOW: ODR/2 (same as standard fw6.0 behavior)
IMU_FILTER_MEDIUM: ODR/4 lowpass filtering
IMu_FILTER_HIGH: ODR/9 filtering (default in fw5.3v6 release)

Signed-off-by: Dado Mista <dadomista@gmail.com>
2023-03-02 07:57:34 -08:00
Benjamin Vedder 26c97f7624 Made chVTGetSystemTimeX consistent everywhere 2022-12-14 19:48:26 +01:00
Benjamin Vedder e9d2fe967e
Pass gyro in radians per second to read callback 2022-11-19 07:38:58 +01:00
Benjamin Vedder b8e8952e32 Moved ahrs-parameters into attitude info, added ahrs-functions and imu callback to vesc_if 2022-11-19 00:09:54 +01:00
Mitch Lustig 00c03fa5bb Add Gyro filter 2022-11-15 01:47:52 -08:00
Benjamin Vedder ff427594e9 Added COMM_SET_APPCONF_NO_STORE and only restart app and IMU when needed 2022-10-30 14:48:22 +01:00
Benjamin Vedder 3dbd21820e Added terminal command to read internal imu type 2022-10-30 14:05:04 +01:00
Mitch Lustig dd7e5f70b5 Split accel filter by axis 2022-10-09 10:27:04 -07:00
Mitch Lustig 1c4d4a88c1 Add accel filter 2022-09-27 21:30:15 -07:00
Benjamin Vedder 05c76a3886 Added new hardwares 2022-09-03 09:36:56 +02:00
Mitch Lustig 5e61b94230 Set lsm6ds3 odr nearest to configured frequency 2022-07-19 22:27:02 -07:00
Dado Mista bcf8c80311 Added support for TR-C variant of LSM6DS3 IMU
Signed-off-by: Dado Mista <dadomista@gmail.com>
2022-05-24 10:18:23 -07:00
Benjamin Vedder dcb0b47f94 Added support for lsm6dso32 imu 2022-05-22 15:37:57 +02:00
Mitch Lustig 458febdad1 Increase bmi160 output data rates to match oversampling 2022-05-01 19:39:53 -07:00
Benjamin Vedder f06574fbdd Added 60_75_mk2 2022-04-26 02:37:43 +02:00
Benjamin Vedder de09850ec0 Congfigurable i2c_bb bitrate 2022-04-19 17:21:19 +02:00
Benjamin Vedder 615dc52007
Merge branch 'master' into configurable_gyro_and_accel_filters 2022-04-19 16:05:27 +02:00
Benjamin Vedder 349e133b51
Merge pull request #474 from Mitchlol/use_magnetometer
Allow users to enable/disable magnetometer
2022-04-19 16:03:19 +02:00
Mitch Lustig 430ec56965 Make magnetometer user configurable 2022-04-17 13:19:35 -07:00
Mitch Lustig a041a3b952 Add support for configuring IMU onboard filters 2022-04-15 21:31:03 -07:00
Mitch Lustig b312e94e02 Improve sleep timing for bmi160 & lsm6ds3 2022-04-15 19:46:29 -07:00
Kenn Sebesta cf6f32332d [Utils] Update the header includes 2022-03-23 20:25:37 -04:00
Benjamin Vedder e9295f5c61 Added function to set the IMU yaw for drift compensation 2022-03-09 23:35:06 +01:00
Benjamin Vedder 18a683fc7d Lisp updates, imu refactoring and rate check 2022-02-28 14:29:59 +01:00
Benjamin Vedder 9c484d01e4 Decreased stack sizes to save ram 2022-01-16 21:57:12 +01:00
Kenn Sebesta bec06ac85a [Utils] Change convenience multiplication factors into convenience MACROs 2021-10-13 14:18:05 -04:00
Kenn Sebesta aeb5d74488 [Utils] Use convenience macros for deg/rad conversions 2021-10-13 11:52:04 -04:00
Benjamin Vedder 583f712424
Merge pull request #350 from dimpolo/mpu_status_fix
Fix wrong status in mpu_status terminal command
2021-10-10 18:04:37 +02:00
dimpolo 27782f23c3
Fix wrong status in mpu_status terminal command 2021-10-07 22:55:00 +02:00
Benjamin Vedder 31d524f7fa Made local functions static 2021-08-22 12:05:08 +02:00
Benjamin Vedder 91a19fa8b3 IMU improvements 2021-08-22 11:51:03 +02:00
Benjamin Vedder 7c6f1dd612 Added fusion IMU filter 2021-08-19 18:48:23 +02:00
Benjamin Vedder ff94d2481a BMI160 SPI fixes 2021-06-26 15:12:30 +02:00
Mitch Lustig 1edad098a3 Match ODR to imu hz 2020-08-25 18:02:19 -07:00
Mitch Lustig 0073c57d59 Increase BMI160 output data rate
VESC tool allows users to set IMU update frequency up to 1khz, but if the BMI160 output data rate is only 200hz, then this option is useless (and performance at 1khz is much better than 200hz).
2020-08-23 21:34:20 -07:00
Mitch Lustig 349361ba36 Fix noisy IMU signal
LSM6DS3 was writing to the output registers at the same time as reads were happening, causing scrambled data.
2020-08-14 20:13:32 -07:00
Benjamin Vedder 0b6ccb17f9 some cleanup 2020-07-21 08:50:09 +02:00
Esben Rasmussen 5ebaf3d853 fixed mu_init_bmi160 to imu_init_bmi160_i2c 2020-07-03 11:43:09 +02:00
Esben Rasmussen f91bd849e4 even more autoformat stuff 2020-07-02 12:44:52 +02:00
Esben Rasmussen 6114f87996 more autoformat stuff 2020-07-02 12:40:56 +02:00
Esben Rasmussen 8ca85d26d5 fixing autoformat issues
Kept a few corrections
2020-07-02 12:26:28 +02:00
Esben Rasmussen 66d9bcac7f Added BMI160 SPI support 2020-07-02 12:00:12 +02:00
Mitch Lustig 2a1c8ddc67 LSM6DS3 Cleanup 2020-05-29 16:49:33 -07:00
Mitch Lustig b827ad855b Finish up lsm6ds3 2020-05-29 16:39:03 -07:00
Mitch Lustig 976413887b Working LSM6DS3 needs lil work but its 3 am and i need to save progress 2020-05-29 03:10:43 -07:00
Benjamin Vedder 939634b9a2
Merge pull request #165 from jxltom/feature/fix-warnings
Fix warnings in Travis tests
2020-05-11 20:39:46 +02:00