Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Converting Acceleration to output values

 

...

                                       Image Removed 

So we want to output our acceleration to the Arduino. For that we need to convert it back to the Body frame, because our gyroscope is part of the copter and measuring the accelerations in the body frame.

Firstly, we subtract the gravity from the acceleration ONCE AGAIN, because the gyroscope somehow wants that? I don't really know, it's weird like that. After that we once again translate the accelerations with a rotational matrix (as seen in Hoeger). Afterwards we Scale the values to fit the output of the gyroscope which outputs values between -16384 and 16383 (for whatever reason?). Now we have the acceleration that the Arduino wants (seeing this, I might have discovered a small error. The acceleration of the arduino might also measure some part of the rotational accelerations, so I might have to look into that. For now, TODO!)

Update: I realized a small mistake in the planning of the quadcopter (or maybe the simulation): The gyroscope is actually shifted by 45° to the left. This means that, instead of the axes being on top of the four arms of the rotors, the axes are actually between the arms. To compensate this mistake, I have added a small model of a rotation around the z-axis of 45°. This is a relative easy addition to the outputs - I did not update the whole simulation to accommodate this little oversight:

 Image Added