Skip to content
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

Euler angles Range #6

Closed
veeresh-dammur opened this issue Jul 25, 2021 · 4 comments
Closed

Euler angles Range #6

veeresh-dammur opened this issue Jul 25, 2021 · 4 comments

Comments

@veeresh-dammur
Copy link

Hi,
Thanks for the nice repo. I would like to ask about the Euler angle ranges obtained from MPU9250. Do you get the orientation values between -180 to +180 degrees on each Euler axes (yaw, roll, pitch)?

@thecountoftuscany
Copy link
Owner

Please refer quat_to_ypr() function in pyteapot.py. Yaw and roll angles are obtained with the math.atan2() function, which returns angles in [-pi, pi]. Pitch is obtained with math.asin(), which returns angles in [-pi/2, pi/2] (refer this page)

thecountoftuscany added a commit that referenced this issue Jul 25, 2021
Mentioned in issues #4 , #6. Pitch should be calculated by asin(), not sin()
@thecountoftuscany
Copy link
Owner

thecountoftuscany commented Jul 25, 2021

Also note that, as mentioned in the readme, this repo assumes that orientation data has been calculated already (for example, using this code) and is only concerned with visualizing that orientation. In case your algorithm calculates quaternions, this repo contains a function that converts that to yaw, pitch, roll angles as mentioned in my previous response. In case it provides yaw, pitch, roll angles, the sensor fusion implementation used defines the ranges.

@veeresh-dammur
Copy link
Author

Just off the topic of the created issue, Currently, we are using BNO055 in one of our projects. The IMU is placed next to the dc motor due to space constraints within the hardware setup. Due to motors vibrations, we are applying a low pass filter on quaternion values read from this script. We have set 5 Hz as a cut-off frequency of the filter. We have also placed IMU on Sorbothane (damping material) to minimize the vibrations. However, we are still selling the error in the orientation.

What could be done to reduce the impact of motor vibrations on IMU both from a software and hardware point of view? Any inputs are highly appreciated!

@thecountoftuscany
Copy link
Owner

Apart from what you have already mentioned, I can only think of a few things:

  • Try to apply filters on the raw accelerometer and/or gyroscope measurements and then apply sensor fusion instead of applying filters on the quaternions fused from noisy measurements since that is a highly non-linear operation. I don't know if the particular IMU you are working with has a library that lets you readily do this, although the datasheet should help you implement this on your own using standard libraries (eg. you should be able to find libraries for TWI (aka I2C), SPI, or whatever interface that IMU uses)
  • Maybe also try to characterize the motor vibration frequency(ies?) and set the cut off frequency for your filter accordingly?
  • (Digital) Signal Processing is a huge domain in itself: try to find a better filter for this particular use case. However, this is not my area of expertise and hence cannot recommend something for this
  • Read up on standard methods for vibration isolation. The wikipedia page could be a start. You can find some good review papers on the topic too.
    Also it depends on what you mean by "error in orientation". In general, IMUs (ones based on accel+mag+gyro) tend to drift. You can increase accuracy or reduce drift by using better sensors (or better sensor fusion techniques) but in the end, this is unavoidable without fusing with additional sensors. Try to figure out if the problem you are referring to is indeed because of the vibration (eg, look at orientation without keeping it close to the motor). That's all I can say for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants