Hi guys. I'm a final student in Mechanical Engineering and for Mechatronics course my group made a 2 axis gimbal with arduino from scratch.

There are some other similar projects (such as this and this) but they're either too complex, or they use commercially avaiable controllers.

We made everything from spare parts and believe the performance isn't perfect only because the motors aren't ideal.

Anyway, here's the list of material we used:

-Arduino Uno board;

-2 DC brushless motors;

-GY-80 sensor (accelerometer+gyro);

-3D printer (but you can use anything else, ofc);
-LEDs, buttons, breadboard (or ideally a PCB), and wires.

Step 1: Sensor

As mentioned we used a GY-80, but you can use any sensor that has a gyro+accelerometer.

We first tried to use only the accelerometer but soon realized it was too sensitive to movement.

The gyro alone could not be used aswell since it drifts.

So after some investigation we found 2 ways of fusing the two:

  1. Using an kalman filter, which theoretically is ideal but also very computationally exigent;
  2. Using a simple complementary filter.

The second option worked fairly well (see graph), and we went with it.

Step 2: Actuactor

With our arduino and our sensor, we had to get some actuactors.

The only motors avaiable other than servos were small 12V DC brushless motors, (Mclennan 400-0961) equipped with a gearbox. These aren't ideal, but you work with what you got. Outer rotor DC motors would be better.

We used a H-bridge for each (specifically L293D). That allowed us to change the motor direction easily and with no concern about the motor's kickback.

Step 3: Electronics

Notice the FSM (finite state machine) of the project. The user should be able to turn the gimbal ON and OFF, and also calibrate the angle of the camera, so that it doesn't necesserly stay fixed at 0º pitch and 0º roll. See the pic of the FSM.

So there are three states: working normally (a green led is on), off (red led on) and calibrating (yellow led is blinking). There are two buttons, one to turn it on/off and other to get it to calibrate.

Since making these fully portable was one of our objectives, we decided to use two sets of batteries:

  1. A 12V battery (in reality is a 9V battery welded to 2x3V batteries) to power the motors;
  2. A 9V battery to power the arduino Uno board.

You can see the scheme of the circuit (made using this) and the picture of the real version. We used an breadboard because no PCB was avaiable.

Step 4: 3D Model

A 3D printer was available and we decided to use it. Working with SolidWorks we created, through many iterations, different parts that would latter be printed. We also bought an acrylic case for the arduino board.

We used my GoPro replica (SJCAM 4000), assembled and we were good to code.

The CAD parts are available at grabcad.

Step 5: Code

There are several libraries avaiable to communicate with the accelerometer and the gyro. We used this two: gyro and accelerometer. Both sites are in polish, but the libraries have nice examples easily understood.

Coding itself was fairly straight forward. I'll let you enjoy the challenge, but feel free to contact me if you need any help.

About the controllers, DC motors are intuitively controlled with PD, but since our motors are quite slow, we decided to use PD for the roll and PID for the pitch. This made this angle a bit oscilatory but much faster.

The graph shows the motor input vs the angle. Saturation is present but the angle error is never considerable.

Step 6: Assembly and Test

As you can see in the video above, the motors are quite slow and therefore the performance is not great.

Nevertheless, the concept was proven: no noise, fast responding system with satisfactory performance, potentially improved with the usage of more suitable motors.

I hope you enjoyed this instructable (it was my first). Feel free to ask me anything.

<p>And to give you tips, </p><p>show how you connected it, show how you soldered it, what type of wire, all step by step. Tel more and show more dear.</p><p>In my eye`s almost nobody will build it like the way it now is, take the classes we give here on INSTRUCTABLES. How to make the best IBLE.</p><p>But these are all tips for the future ibles you will make for us:-)</p><p>And take a note! this is my opinion and ONLY sugestions. OKE??</p><p>WannaDuino, The Real LiVe.</p>
<p>In section 3 you can see the wiring diagram.<br>Nevertheless I agree with you, it could be more detailed.</p><p>Cheers!</p>
<p>it's awesome, thanx for sharing,</p><p>But the stuttering, is that because of these motors?</p><p>and what other motors would you suggest dear friend?</p>
<p>Thank you. Yes, the motors aren't fast enough. <br>Most likely brushless DC motors, which are also better looking.</p>
<p>Update rule of angle = k * angle_gyro + (1-k) * angle_accel is actually a particular case of Kalman filter when there is no information about gimbal and motors (Kalman filter would adjust constant k automatically, but it can be done manually quite well). So you are not loosing much by this simplified formula, and definitely saving a lot of time in computations - which is better in this case.<br><br>But you won't be able to reach reasonable stabilization quality with geared DC motors. Only certain BLDCs can provide fast enough reaction and high enough torque at the same time</p>
<p>I agree with you in both statements. Unfortunatly this were the motors avaiable. They had quite good torque but the reaction was just too slow. I also recommend using Brushless DC motors for this project!</p>
<p>That's an awesome design, I hope y'all get an A on your project!</p>
<p>Thank you! We actually did :)</p>

About This Instructable




Bio: Soon to be mechanical engineer!
More by Milor_D:2 Axis Gimbal With Arduino 
Add instructable to: