Help on reading MPU6050 module

Here we can discuss about the problem found
Post Reply
jctcba
Posts: 7
Joined: Sat Apr 17, 2021 8:31 pm
Has thanked: 8 times
Been thanked: 7 times

Help on reading MPU6050 module

Post by jctcba »

First of all, I apologize in advance if this topic (query) is misplaced in this part of the forum, because it's not properly an "error"...

My name is Juan. I’m trying to get the MPU6050 orientation sensor sample program to work (https://sites.google.com/site/annexwifi ... ts/mpu6050).

I find a line that has the following content:

i2c.readregray MPU6050SlaveAddress, MPU6050_REG_ACCEL_XOUT_H, 14, IMU_data() ' read all registers in one shot

where the function “i2c.readregarray” does not work, and reading the help (Annex WiFi RDS Help Version 1.42)

I understand that this function “i2c.readregarray” has been removed.

I have searched for a way to replace that function with another in the help, on the Annex site and in this Forum, but due to my limited knowledge I have not been able to find the solution.

My intention is to place an ESP computer in an experimental rocket, the computer would control the vector altitude through the BMP280 module, and would be in charge of recording it, and also of deploying two recovery systems. The height reached with previous vectors was around 500 meters, the current one is estimated to reach 700 meters with a single stage.

A small parachute is first deployed shortly after apogee (on detecting descent) to stabilize the fall vector and provide primary fall rate limitation. This is so as not to open the main chute at apogee, since even with a light wind, drift can be significant.

Once an appropriate height is reached (around 150-200 meters) it will deploy the main recovery system with an appropriately sized parachute. This is the mode currently used.

The next project, if I could implement the MPU6050 module, would be for this module to record vector acceleration. Upon reaching the point of detecting the beginning of the deceleration, it should control the separation of stages, detaching the first and performing the ignition of the second at the optimal moment "T1" to take full advantage of the inertial flight (not propelled) achieved by the first stage, turning on the second at the exact moment.

The first stage should also have a similar redundant computer that, as its main function, deploys the recovery system of that stage and that initiates the separation of stages and turns on the second in a time “T2” (T1+1s) in case of failure of the main computer of the second stage.

I've been able to read the barometric sensor (BMP280), the RTC module, and control the 2-line LCD, but I can't get the MPU to operate.

If someone could guide me on how to replace the "i2c.readregray" instruction, or how to read the MPU sensor, I would be very grateful. Greetings,

Juan.-
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: Help on reading MPU6050 module

Post by Electroguard »

Hi, although it may not be rocket science, perhaps a quick and simple solution could be to flash with the older version of firmware that does fully support all the functionality you need.
jctcba
Posts: 7
Joined: Sat Apr 17, 2021 8:31 pm
Has thanked: 8 times
Been thanked: 7 times

Re: Help on reading MPU6050 module

Post by jctcba »

:lol: :lol: :lol: Thanks, Electroguard!! I'm not a rocket scientist either, barely an enthusiast amateur...

You're brilliant. The solution some times is simplest than one think...

Additionally, yesterday came to me some light reading the comments on the removing of those instructions removed, when looking for older versions, in the notes of the releasing versions:

"Version 1.41 beta 12
Improved the VAL function to work with hex, octal and bin numbers
IO BUFFERS
- some internal fixes
- implemented the function IOBUFF.COPY
Implemented the function CONVERT.MAP
- Same as MAP function in Arduino
Editor page
- changes in the page autoresize that now is function of the aspect ratio
Removed these functions because redundant with the IO BUFFERS
- SPI.HEX$
- I2C.WRITEREGARRAY
- I2C.READREGARRAY
"

I'm thinking that the better solution -rather than doing a back-step- will be to learn using the IO BUFFERS. But, for now, I'll use the K.I.S.S. solution you gave me, to flash with the older version, meanwhile learning using the IO BUFFERS.

Again, many thanks Electroguard, for your time and solution!

Regards,

J.

P.S.: Apologizes because my bad English... it's not my mother's languaje...
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: Help on reading MPU6050 module

Post by Electroguard »

It is a very interesting project Juan, and seems well thought out - there may be some failures, but I hope you will eventually post your success in Projects. No need to relocate this thread though, cos it shows that bugs are sometimes unjustly blamed for peoples unexplained problems.

I don't know what sort of height you are hoping for, but what goes up must come down, so perhaps ability to somehow beam a last-second manual emergency chute release signal might prevent some costly shrapnel.
Post Reply