Effacer les filtres
Effacer les filtres

Integral velocity to get angle

2 vues (au cours des 30 derniers jours)
Dekel Mashiach
Dekel Mashiach le 17 Mai 2022
Modifié(e) : Torsten le 17 Mai 2022
I'm trying to get the angle from mpu6050... anyone can help?
clear all; clc;
port = 'COM9'; %
board = 'Uno'; %
a = arduino(port,board,'Libraries', 'I2C'); %
fprintf("Connected")
imu = mpu6050(a);
while(1)
velocity = readAngularVelocity(imu);
angle = integral(velocity,time) %need to fix
pause(3)
end
  3 commentaires
Dekel Mashiach
Dekel Mashiach le 17 Mai 2022
velocity is an array, and I need to get the angle (he is also an array)
Torsten
Torsten le 17 Mai 2022
Modifié(e) : Torsten le 17 Mai 2022
Maybe
angle = trapz(time,velocity)
if "angle" is the integral of "velocity" with respect to "time" and "time" is an array of the same size as "velocity".

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB Support Package for Arduino Hardware dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by