it does for example
void setAlpha(float a);
void setBeta(float b);
void setGyroMeasError(float gme);
void setKp(float p);
void setKi(float i);
You need to learn algorithms (not the detailed math) but how they generally work. then...
Yes this works! That's wonderful! Pitch and roll are my my gain goal, but I will probably also have a magnetometer on the board, so I can try to feed that data into the Reefwing AHRS as well. I'm guessing just the raw xyz values from the...
Ok had a chance to play with this. Unfortunately didn;t have a Mpu6500 handy but did have a 9250. This example works but I did have to make a mod to the AHRS lib:
#include "mpu9250.h"
/* Mpu9250 object */
bfs::Mpu9250 imu;
#include...
The convergence speed of the filters depend on setting the gains correctly. The ones used probably are giving you that slow response. They can be changed but would have to optimize them.
Right now in the middle of updating another library so...
This is a bit beyond my limits I'm afraid. Perhaps time to find some one a bit more skillfull than myself to tie this one together.
I was just wondering. Was my observation about the Mahony and Medgwick filters not being well suited for tracking...
I may give this a try today but just looking at your sketch a couple of things pop out.
1. You do not need to define the structure in the body of the sketch - its already defined in imutypes.h.
2. you need to populate the structure. For...
I got the Madgwick and Mahony filters running icw Brian's MPU6500 library (added both files in case a future user might find them helpful). But the roll, pitch and heading are very slow responsive. I guess these algorithms are best suited for low...
I will give you a hint. After you get the data from Brian's library you will have to cast it into a data struct which reefwing is looking for:
struct SensorData {
float ax, ay, az;
float gx, gy, gz;
float mx, my, mz;
uint32_t...
This method sounds great to me as well. Juist need to get my head around how to change the code along these lines; feeding imu data from the invensense library into the mahonyahrs library. Bottomline; I'm not much of a programmer... You don't...
I started off with an example from the Reefwing6500 library. The example code you posted in earlier post gave me this error;
Compilation error: 'MPU6500' does not name a type
I connected the IMU and using library underneath I've managed to make...
Sorry for the slow response... unfortunately I haven't been able to connect to the MPU6500 using the Reefwing MPU6500 library.
Just for the basic connection check I'm using this code;
#include <ReefwingMPU6050.h>
ReefwingMPU6050 imu;
void...
If you look at the source file for the MPU65x0 it is only supporting SPI. However, if you use the https://github.com/Reefwing-Software/Reefwing-MPU6050/tree/main MPU6050 library that supports I2C. You would just have to modify the start of the...
Yes this compiles. Thank you so much!
Now the next step... The example connects using SPI. I was hoping to connect using I2C. According to the library documentation this should be possible, but I can't find any examples that show how...
Don't know anything about that particular library. Typically I use @brtaylors library to get data from the 6500: https://github.com/bolderflight/invensense-imu and use either Mahoney or Madgwick filter libraries...
I got curious about the Reefwing library and it actually looks rather interesting. So I decided to check it out.
The issue is that the library defines board types that are supported and it is not configured for the Teensies only arduino...
Hi there,
I'm looking for a library that can calculate roll, pitch, yaw and heading angles using the MPU6500 IMU and that is compatible with Teensy 4.1.
I found the Reefwing AHRS library. There's an example patch for the MPU6500 and MKR boards...
Probably best to keep it simple and use just 1 power bank having ordinary 5V USB power output with 1 USB cable.
Every power bank is different. None come with reliable tech specs. Even the claimed battery capacity is usually just a made up...
My experience is, that it can work if consumption is not too low. Writing to microSD is usually sufficient to keep powerbank on.
I trick I also did is to run Teenys4.2 from LiPo and attach it via adafruit backpack (id 2124) to powerbank (outdoor...
Found the original thread and the article Paul posted if you all are interested:
Article: https://dorkbotpdx.org/blog/paul/battery_pack_load/
Thread: https://forum.pjrc.com/index.php?threads/portable-power-supply.24476/
The one issue that I can think of is many power banks will turn off if the power used is below some threshold. In the Teensy 3.1/3.2 era, I recall Paul had published a circuit that would draw just enough extra power to keep the power bank happy...
Thanks! I'm running 4 I2C sensors (gyro, 2 magnetometers and a clock), so 150mA should be plenty. So then 3.3 is the preferred way to go, right?
(sorry I failed to mention Teensy (4.1) version - I've corrected it above)
You don't say which Teensy you propose to use, but if T4.x I believe that 150mA should be available for your sensors.
If the sensors can be powered from 3.3v then that should be fine. It also overcomes the potential need to step voltage up/down...
Hi there,
I had a hardware question. I aim to build a small data collector to take with me on a biking trip. I want to use a powerbank as the power source. Simplest would be to just power the Teensy 4.1 using a powerbank (5v) and then powering...
Try change this
sprintf(FileName, "%04d_%02d_%02d.csv",
(RTC.getYear(),
(RTC.getMonth(),
(RTC.getDay());
to this
sprintf(FileName, "%04d_%02d_%02d.csv",
(RTC.getYear())...
Still getting this error though;
Compilation error: expected ')' before ';' token
So I'm guessing something is wrong with my syntax...?
The attached code is not the full code. Just what's relevant for this issue. But put a closing line in...
Ok but I need to get the date information from my I2C clock while running my code in the field. So somehow 'year()' needs to point to - be replaced by - RTC.getYear() I think
I thought I did understand. Or not really (sprintf/C is somewhat of a mystery to me), but at least I thought my small adaptation of your code was correct. But apparently I'm doing something wrong. Sorry. Also understand you're not going to...
or this
char FileName[27] = "N_YYYY-MM-DD_NNN.csv";
sprintf(FileName, "N_%04d_%02d_%02d_%03d.csv",
ID,
year(),
month(),
day(),
FileNumber);
// populate ID
if (someval ==...
one way
char FileName[25] = "YYYY-MM-DD_NN.csv";
sprintf(FileName, "%04d_%02d_%02d_%02d.csv",
year(),
month(),
day(),
DataID);
// if you are using SDFat you can also add date/time...
Ok great! Thank you so much. I was considering to write (possibly multiple session per day) in the same file each day. It's more of a safety measure than that I need a very strict separation of data. But great to have the code at hand if I change...
Hi there. I'm stuck trying to figure out how to generate a different filename every day.
I came across this topic:
https://forum.pjrc.com/index.php?threads/sd-card-filename-struggles.60084/
But I'm not sure how to apply that to my aim. I guess...
Followed instructions in topic underneath and now have two compass sensors running simultaneously on two I2C busses on a Teensy 4.1
https://forum.arduino.cc/t/how-to-use-i2c-sda2-and-scl2-on-stm32f103c8tb-with-my-compass-hmc5883l/1001527/8
Hi there. I'm trying to use two I2C sensors (HW-246 GY-271) simultaneously. From what I've read it should be possible to have the two sensors connected to the same pins on the Arduino. I also have a Teensy, which has multiple I2C pins. But the...