# VHDL code for line rotation with angle from gyro and accelerometer from VGA

1. ## VHDL code for line rotation with angle from gyro and accelerometer from VGA

Dear Gurus or/and just good guys , is there any code in vhdl for rotate lines with data from MPU6050 ? I successfully connect MPU6050 with I2C and can filter with Kalman filter now i want to show rotated line accourding to gyro and accelerometer from VGA monitor .. Pls help to find it searched 2 days in internet. but no luck..(

•

2. ## Re: VHDL code for line rotation with angle from gyro and accelerometer from VGA

Elaborate on what you mean by "rotate lines". Maybe you should give an example of what you are attempting to do.

3. ## Re: VHDL code for line rotation with angle from gyro and accelerometer from VGA

it is like airplane pilot monitor to keep horizon , like in video https://www.youtube.com/watch?v=XIpf-7q-ZDQ

•

4. ## Re: VHDL code for line rotation with angle from gyro and accelerometer from VGA

Originally Posted by abimann
Dear Gurus or/and just good guys , is there any code in vhdl for rotate lines with data from MPU6050 ? I successfully connect MPU6050 with I2C and can filter with Kalman filter now i want to show rotated line accourding to gyro and accelerometer from VGA monitor .. Pls help to find it searched 2 days in internet. but no luck..(
Hi,

it is just Math in 3D space. See for example these links:

https://en.wikipedia.org/wiki/Rotation_matrix

http://mathworld.wolfram.com/RotationMatrix.html

http://www.mathpages.com/home/kmath593/kmath593.htm

http://www.euclideanspace.com/maths/...tion/index.htm

For trigonometric function you can use "CORDIC" algorithm (code on GitHub also as free IP cores).

Then you must write these math rules (for rotations) in VHDL or Verilog (or just look for existing code).

Regards

•

5. ## Re: VHDL code for line rotation with angle from gyro and accelerometer from VGA

Find one way , in a book "Learning by examples using VHDL" Richard E. Haskel and Darrin M. Hanna

6. ## Re: VHDL code for line rotation with angle from gyro and accelerometer from VGA

Originally Posted by abimann
Find one way , in a book "Learning by examples using VHDL" Richard E. Haskel and Darrin M. Hanna
Hello,

could you give an URL to this book (I don't know this publication), it seems to be interesting for me?

Kind Regards.

•

8. ## Re: VHDL code for line rotation with angle from gyro and accelerometer from VGA

Originally Posted by abimann
Find one way , in a book "Learning by examples using VHDL" Richard E. Haskel and Darrin M. Hanna
Hello,

I read all the "Table of contents" for this book (from link given by TricyDicky), but I wasn;t able to find any topic or example related to your problem.

For solution of problem "rotation plane or line in 3D space" you need to solve few issues:

1) Find solution of calculating trigonometric functions (this may be solved by CORDIC algorithm)
2) Find way of doing basic 4 arithmetic operations on float/or double numbers (DSP blocks or IP cores for FPU)
3) Write equotations of rotation in any HDL language and solve them (data for rotation parametres are taken from gyro and accelometer)
4) Make visualisation of rotated planes/lines comparing to the "frame of reference" (i mean x,y,z axies) - VGA or HDMI image generator

I didn't find any of these subjects in reffered by you book?

Regards

9. ## Re: VHDL code for line rotation with angle from gyro and accelerometer from VGA

Not that.. Learning By Example Using VHDL Advanced Digital Design With a NEXUS 2tm FPGA Board. Autors: Richard E. Haskell Darrin M. Hanna .. page number #228.. Plotting a line.. Here is needed to make case operator ..

--[[ ]]--