Magnetic encoder and brushless gimbal controller

- from my blog hobbyuav,com.

For the techpod 2.0, I want to have a high precision camera gimbal capable of continuous rotation in two axis. I have always likes the brushless gimbals that are so popular today. The control and drive systems are very nice but are not setup for continuous 360 degree rotation. furthermore the IMU algorithm is very CPU intensive and prone to needing the gyros calibrated frequently etc.

I decided to replace the IMU with a AS5048B  rotary magnetic  encoder for position feedback.  The  AS5048B outputs the 14 bit absolute position of a magnet rotated near the IC. After you include noise, it is good for about 0.06 degrees of accuracy.  Here is a short video of it going from 90.5 degrees to -90.5 degrees every 10 seconds.

Here is a quick hack of the brushless gimbal software.

_BruGi+AS5048

Views: 5312


Moderator
Comment by Roberto Navoni on September 16, 2013 at 1:43am

Hi Wayne , 

great job , but where in the code there is your implementation ? I don't found the patch in the zip code in the link.

best

Roberto

Comment by Magnus Persson on September 16, 2013 at 4:04am
Hello How do you Connect it ?
Any more picture?
Thanks
Comment by Rob_Lefebvre on September 16, 2013 at 6:14am

Really interesting work Wayne.  Can you show the mechanics of the encoder hookup?  I'm curious to see what you did.

You must still be using an IMU on the camera mount plate, no?  I think the encoder will definitely help the control systme design, but I'm pretty sure you need an IMU still.


Moderator
Comment by Roberto Navoni on September 16, 2013 at 9:41am

I agree with Robert about the need of IMU ,too ... 

Comment by Martin on September 16, 2013 at 10:11am

The autopilot already has an IMU. The encoder provides the position relative to the autopilot. Would using an IMU on the camera provide better control and smoother operation?

Comment by Rob_Lefebvre on September 16, 2013 at 10:27am

Yes, because it helps to make the gimbal correct for any mechanical slop in the gimbal structure, as well as movement in the vibration damping system.


100KM
Comment by wayne garris on September 16, 2013 at 12:01pm

@evreyone,

 thanks, this is just a small part of a greater system I am building. This will make you think differently about your autopilot and camera setup. It could also lead to some interesting setups not utilized. setups such as mounting the autopilot to the camera while using the angle difference to estimate the aircraft attitude. you could use the autopilot to control the camera instead of having 2 IMUs on board. You can hard mount it to something stable like a bench and use it for aiming a camera or aiming an antenna.

@Guy,

point taken, however these problems can be eliminated by mounting the AP and camera on the same vibration isolated mount. The possibility of using only a gyro strapped to the camera to dampen vibrations etc becomes apparent, eliminating the need for a full IMU sensor and algorithm.

  

@robert,

TY! mostly I crammed this into the code right before the PID is calculated.

"


/////////////////////////////////////
//read encoder
//////////////////////////////////////
Wire.beginTransmission(ADDRESS); //starts communication with cmps03
Wire.write(255); //Sends the register we wish to read
Wire.endTransmission();

Wire.requestFrom(ADDRESS, 2); //requests high byte
while(Wire.available() < 2); //while there is a byte to receive
highByte= Wire.read(); //reads the byte as an integer
lowByte = Wire.read();
byte lowBytemask = lowByte & B00111111;
//lowByte = lowBytemask;
unsigned int bearing = (highByte6)+lowByte;
angle[PITCH] = (((float)bearing * 0.02197265625)-180.0)* 1000;

"

I over wrote the variable " angle[PITCH] " with the encoder angle. after it was working I then could start commenting out the IMU related code. Now thats a hack ;-)

@Magnus,

Its connected to the IMU port on the BruGIAOI board. connected 5v, ground, SDA and SCL. It goes through a level translator first then to the encoder. more pictures will be coming as i develop the gimbal further. 

@R_Lefebvre,

There is a close up at the end of the video. I will be publishing the CAD files for 3D printing your own when i am more settled on the design. As for needing an IMU, there is no reason you cant put this in a normal RC aircraft and have your self a look around without an IMU. If you want to stabilize, you can use gyro + encoder, full blown IMU not needed. If you want stabilization and SPOI you would need full IMU + GPS (autopilot). Also if it is mounted to a bench or a known position.

@Martin

 you could utilize an SPI or I2C connection between AP and camera control. Heck you could even marry the two on a single board. IMUs have many drawbacks, given the choice between an IMU and an encoder to measure the relative angle of two planes, the choice is simple.

@R_Lefebrvre

 There are obvious drawbacks to IMUs.  One basic guiding principle in robotics is the more sensors the better. Biologics enjoy a plurality of sensors, why not our creations? (IMU + encoder) > (IMU) == 1.

Comment by Mattia For on January 22, 2014 at 8:16am

Hi wayne,

i'm interested in your application of encoder instead of usin IMU. i've 2 questions:

1) how do you control the motor;

2) how can i improve your work adding 2 axis

TY for your attention

Comment by OG on December 10, 2015 at 9:21am

if your looking for AS5048 encoder on PCB easy to DIY mount  on new or existing project. found here on the cheep.

http://mymobilemms.com/OFFTHEGRIDWATER.CA/BRUSHLESS-GIMBALS/Control...

Comment by Martin A. Martinsen on February 22, 2016 at 4:13pm

Hey Wayne and others.
Did you find any motors that has encoder and is allowing to use slip ring?

Martin 

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2017   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service