All, I am writing the code for a compact 6DOF attitude controller for Arduino and request assistance to write an entirely quaternion-based control algorithm which takes an input quaternion from the user, compares this value to the observed quaternion via sensors to generate an error quaternion, and corrects for this error by generating an output quaternion to the actuators. I looked through many sites and read several academic papers on the topic. I understand it is possible, if not better than converting back to Cartesian-space, yet have not found an example of code where the quaternion-based control is implemented. If you agree, I believe it will be most beneficial to make such an Arduino-friendly code readily available to the younger engineers so that they may pursue more exciting projects.
Has anyone done any work in this area or know of any examples of code similar to the one proposed above?