Introduction: The Making of a DIY Brushless Gimbal With Arduino

This is a story of my third project with cheap gyro and Arduino.

After the earlier two projects, Easy Inverted Pendulum and 3D Calligraphy, I have thought of making Camera Gimbal with Arduino. Then I had three policies for the project.

  • Equipped with standard camera bigger than GoPro
  • Simple as possible with no special device nor kit
  • Bootstrap: Refer to fewer websites as possible and finish with no imitation

At the start of the project, I had intention of making 2-axis gimbal with Servo Motors. But it has been made clear that it is difficult to see adequate performance using Servo Motor. Consequently a 3-axis gimbal with Brushless Motors and Arduino has been made. INTRODUCTION VIDEO below shows the effectiveness of the DIY gimbal. In the video, pretty noise would be heard suddenly. It is left without any reduction to show strengths and weaknesses of the gimbal. Arbitrary film editing is avoided.



It seems that the DIY 3-axis gimbal in this video provides enough compensation for practical use. But it was not easy to make it of this level. For example, I have met with difficulties below.

  • Controlling Brushless Motor adequately with Arduino alone
  • Getting a precision frame of gimbal by using rather poor tool
  • Resolving the disturbance of SPI interface between gyros and Arduino
  • Settling frame chattering
  • Adding intended and smoothPAN or TILT to good compensation

The first problem above is a matter of programming. In contrast the second one is a pure hardware matter. And the remaining ones are found in intersection of both matters.

Also four problems except for the first one have been encountered when the second axis was added to the single axis gimbal. It means that the core of the program of multi-axis gimbal here is not different from the single axis one. But the good frame for multi-axis one requires much more efforts to be gotten than single axis one.


Here "How to make the DIY single axis Brushless Gimbal with Arduino" is told in detail in a later step. But it is rather a special topic to tell the whole story about the process of development a DIY camera gimbal with Arduino of level high enough for practical use. The story is as follows.

  • An important point to make a gimbal with gyro
  • DIY single axis gimbal with cheap Brush DC Motor
  • DIY single axis gimbal with Servo Motor
  • DIY single axis gimbal with Brushless DC Motor
  • Multi-axis controlled
  • Effectiveness of the DIY gimbal
  • Unresolved problems for improvement

"How to ..." is told in Step 6 to 10 mostly. And the minimum work in it might be able to be done just referring to content in Step 10 after watching DCUMENTARY (12) in Step 9. On the other hand the performance of the DIY 3-axis gimbal would be seen approximately after watching INTRODUCTION VIDEO above, DCUMENTARY (15) in Step 12 and DCUMENTARY (17) in Step 13.


By the way, another project entitled "Brushless Gimbal with Arduino" has been posted to Instructables in last year. It provided me the "good resource for a starting point". But its approach contrasts with mine. The difference between them would be told in Step 5.


I hope the attached videos and pictures would compensate for my poor English. The Japanese version of this instructable has three more steps additionally.

Step 1: An Important Matter—Which Side Is Gyro Attached To?

Motion of a rigid body in space can be described with two independent elements; rotation and parallel translation. The former can be cancelled out or compensated by an instrument called gimbal. A camera mounted on the innermost gimbal could be free from rotary motion when the support of the gimbal moved, even though it might not be free from parallel shift. Hence for the gimbal driven by motor, angle (or posture) of camera becomes the important information to keep it still.

We have several alternatives to estimate the angle of object in motion. Here cheap gyro module(s) is/are used. The angular velocity of the object can be measured by gyro. And Arduino translates it into estimated degree of angle shift of the object. Now we have the next alternatives for the new matter which side of gimbal the gyro is attached to.

(1) Attaching gyro to the "camera side" (attaching it to the camera mount)

(2) Attaching gyro to the "support side" (attaching it to the handle base)


The most different point between them is whether the feedback of the intentional rotation of the motor controlling the gimbal is gotten or not. When attaching gyro to (1) camera side, intentional motion is not distinguished from un-intentional one and just the sum of them is measured. On the other hand when attaching gyro to (2) support side, only the un-intentional rotation is measured but intentional one is not. Hence they have good and bad points respectively as below.

(1) Attaching gyro to the camera side (attaching it to thetop (or rotor) of the motor)

  • Strategy: When the camera rotates a little bit, drive the motor to cancel out it immediately.
  • Merits: It is not needed to estimate the angle correctly. (So it is not needed to know how much the motor rotates its spindle.)
  • Demerits: The camera vibrates easily unless the motor is controlled adequately.

(2) Attaching gyro to the support side (attaching it to thebase (or stator) of the motor)

  • Strategy: When the support rotates, estimate the degree and rotate motor as much as that to the reverse direction correctly.
  • Merits: Vibration caused by the feedback of motor rotation never occurs.
  • Demerits: The correct estimates are needed for both rotation of the support and camera.


These differences are important for motor choice. When the gyro is attached to the (2) support side, both degrees of angles of the top and the base of the motor have to be estimated correctly. Therefore Servo or Stepper Motor is likely to be used, which could control the angle directly.

On the other hand, when the gyro is attached to the (1) camera side, just the rotation of the top of the motor should be restricted from the fixed viewpoint at somewhere outside. Then the degree of this rotation does not have to be estimated necessarily. So the cheap Brush DC Motor might work.

Now it appears that the (1) camera side is better to attach gyro to, from point of view of either freedom of motor choice or less efforts needed to estimate the correct degrees of angles.

Step 2: Can Be Cheap Brush DC Motor Applied to Gimbal?

Some cheap Brush DC Motor might work for the gimbal when the gyro is attached to the (1) camera side. But the spindle of this kind of motor would turn at higher speed for gimbal. Therefore gear or pulley is needed to reduce speed properly.

Here a simple inverted pendulum robot ever made is used like a single axis gimbal to see whether Brush DC Motor could be applied to camera gimbal. With a modified program for gimbal this robot can give rough compensation against the rotation of its support. Though it is not so bad, large vibration occurs, which cannot be resolved by the standard countermeasure. You can see detail in DOCUMENTARY (1) below.


[DOCUMENTARY (1)] Single Axis Gimbal with Brush DC Motor


Backlash of the reduce gears causes this persistent vibration. It is needed to know at every moment whether gears mesh or not to resolve it. But it is not easy to know it in real time.

As lowering sensor sensitivity this vibration is able to be weakened. (See DOCUMENTARY (2) below.) But the gimbal is left uncontrolled while gears do not mesh. Hence a precision reduce gears such as no backlash is felt is needed to apply cheap Brush DC Motor to camera gimbal. But it seems too hard to get such gears in this project.


[DOCUMENTARY (2)] Modified Single Axis Gimbal with Brush DC Motor

Step 3: Making Single Axis Servo Gimbal (Part 1)

In this step and the next, Servo Motor is tried out for a single axis camera gimbal.

In Step 1 it is described that Servo Motor could work in either case where gyro is attached to (1) camera side or (2) support side of gimbal. In this step gyro is attached to the (1) camera side. Though it is not required to know the correct degrees of angles in this case necessarily, two alternative strategies were adopted respectively. The results observed are as follows.

  • The strategy, "turning motor as much as estimated degree of rotation of the support of gimbal to the reverse direction," cannot cancel out the rotation enough.
  • The other strategy, "turning motor until cancelling out camera rotation," results in delayed compensation or vibration of camera mount.
  • Therefore it is not easy to decide how much Servo turns.


The former strategy above is prepared for the gyro attached to the (2) support side. Though it is thought to work as well for the gyro attached to the (1) camera side intuitively, it compensates only the half of rotation on reflection.

On the other hand the latter strategy is prepared for the case where gyro is attached to (1) camera side. Here Servo Motor receives directly the degree of angle to turn. So it is not easy to control angular velocity or acceleration.

By changing the degree to turn gradually, we can control angular velocity to some extent. But we would meet with vibration in higher speed or delayed compensation in lower speed easily.

The advantage of Servo Motor is correct turning with the degree received. Therefore when using Servo Motor it should be better that the gyro is attached to the (2) support side from the viewpoint of efficiency of control, where the vibration caused by feedback could not be observed.

Step 4: Making Single Axis Servo Gimbal (Part 2)

In the previous step we have learned that it is not better attaching gyro to (1) camera side when using Servo Motor. So Servo Motor is tried out again with attaching gyro to (2) support side. The results observed are as follows.

  • Servo Motor is not good where quick acceleration or deceleration is needed
  • Especially it needs more time upon deceleration to stop
  • It is difficult to change acceleration or deceleration of each Servo Motor


The figure above shows the change in the angular velocity of a Servo Motor from start to finish. There four different angles with 8, 15, 30 and 60 degrees are given and four lines in this figure represent these angles respectively. The slope of each line shows angular acceleration. We can know acceleration from start and deceleration to stop. So the figure tells us as follows.

  • The acceleration from start to maximum speed is almost constant and common to all angles given.
  • On the other hand the deceleration to stop is dropping stepwise but the pattern is similar to each other angle given.
  • Therefore the time required to stop from maximum speed is about two or three times longer than the time needed to reach maximum speed from start.
  • When the given angle is less than 15 degrees, the maximum speed of this motor is never reached from start to finish.


The first three points above mean that Servo Motor executes stopping motion more carefully than to starting. And the last point above means that Servo Motor cannot respond quickly enough to irregular change of angle. So it tells us that rotating speed (as maximum speed in steady turning), one of the most popular performance measure of Servo Motor, is not so critical in this project.

The careful deceleration of Servo Motor to stop is thought to intend to avoid risk of vibration. But this careful deceleration spoils quick response needed for camera gimbal. We can see both delayed starting and dropping deceleration to stopping of Servo Motor in the DOCUMENTARY (3).


[DOCUMENTARY (3)] Testing Tracking Speed of Servo Motor


Camera gimbal must compensate against irregular rotation of its support. Hence the motor driving it is required not only higher maximum speed but also enough acceleration and deceleration for quick tracking.

From this point of view Servo Motor is thought to be too much careful for avoiding the risk of vibration at the expense of acceleration and deceleration. Though the extent of this trade-off depends on each model of Servo Motor, none provides enough compensation which I have tested. In the DOCUMENTARY (4) below the best Servo Motor among them is used, which has smaller body, higher speed and quicker response. But we cannot recognize that it works adequately in the video.


[DOCUMENTARY (4)] The Final Test of Single Axis Servo Gimbal

Step 5: The Articles of DIY Brushless Gimbal in Web

In the previous step it has been made clear that Servo Motor would hardly provide enough compensation for gimbal. So Brushless Motor is considered to be applied to gimbal instead of Servo Motor.

But I had never seen Brushless motor and no special knowledge about it at that time. So I bought a relatively inexpensive one ($22.75) for a research. But I found no paper like manual but a motor in the package. Then I got little information added to use it.


Now that things had come to this pass, I referred to websites to search useful information to use Brushless Motor. I found a considerable number of articles and videos about DIY with Brushless Motor. And I knew that special device named ESC or Gimbal Controller is used to drive each Brushless Motor in general.

On the other hand no special device would be used in this project as described in Introduction. Only Arduino should be used to control gimbal. Hence I focused on a rare article featured in Instructables in which neither ESC nor Gimbal Controller is used. Its title "Brushless Gimbal with Arduino" hits the mark of my project. But it is a pity that the gimbal shown in it does not seem to work adequately so the authors say, "we never got the gimbal we were looking for”.

However, their article introduces some other articles consulted. And one of them shows how to rotate Brushless Motor using Arduino (by eLABZ). It gave my project the starting point at that time. The detail of the consulted article will described in the next step. Here the first article referring to it is mentioned.


This article in Instructables describes an earlier project executed by two students belong to a university in US. There seems to be three points in common between their project and mine.

  • Both of us want to make a camera gimbal with Brushless Motor work well without special Gimbal Controller.
  • In short we would use only Arduino to control gimbal.
  • But we cannot find no similar project which meets either of these two requirements except ours.

On the other hand their project is different from mine as follows.

  • They use GoPro as mounted camera.
  • They use ready-made set on the market as frame and motors
  • They use the program provided in other website to rotate Brushless Motor
  • They use a special device as gyro module (a MPU6050 carrier)
  • They use the program provided by others to exploit this module


Both of us share a goal (Driving Brushless Motor Adequately by Using Arduino Alone without Special Controller) and a situation recognition (Finding No Article Achieving This Goal for Camera Gimbal). And they use rather positively both existing programs provided by others and ready-made set sold on the market.

This approach seems like a strategy such as "Achieving a Unique Objective with Help of Others" or "Getting a General Function with Special Materials or Methodologies". At that time I brought the term in my mind impressively, Horizontal Divisions of Labor (*).

(*) I had heard that Horizontal Divisions of Labor harass Japanese Industry which has advantage in Vertical Integration. The third policy described in Introduction, "Bootstrap: Refer to less websites and finish with no imitation", is felt nearer Vertical Integration than Horizontal Divisions of Labor.


Back to topic, in the article in Instructables introduced here a special gyro module is used, which has MPU6050 sensor. This sensor has a special and very powerful function named DMP (Digital Motion Processor). This function provides not only greater noise reduction than standard gyro sensor but also estimate of 3D rotary coordinate system (*1) in real time (*2).

(*1) It is not a rotation around a fixed axis on gyro but a rotation of 3D coordinate system in the fixed system.

(*2) This is not an easy calculation. Hence a famous freeware working in PC, Processing, is used not in real time in my earlier project.

Though the sensor with DMP is amazing, it would be "special device" at the present moment. Therefore I decided not using the module with this sensor in this project. By the way a popular motor driver, L298, is used in this project, which is employed in the article above. I am grateful to the authors of this article.

Step 6: Rotating Brushless Motor Using Existing Programs

Going back to my project, "How to ..." is described here for the first time in this instructable.

In the article mentioned in the previous step authors rotate Brushless Motor by using Arduino. There they refer to an earlier article written by eLABZ. And they use the program provided in it. In the consulted article the author eLABZ explains how to make a Stroboscope with Brushless Motor took out of an old DVD drive.

As far as I know (*), this is the only article that contains the full array of information to rotate Brushless Motor by using Arduino alone. This article is constructed of 3 sections. (*I found another video right now. It has just the minimum information.)

  1. Learning fundamental knowledge of (3-phase) Brushless Motor
  2. Rotating Brushless Motor by using Arduino
  3. Putting materials together to get Stroboscope


In the second section above two alternative programs for Arduino are provided to rotate Brushless Motor. I read them and its commentary with an illustration in the article. And I understood that I should just supply three AC voltages which phases are shifted by 120 degrees to the three wires with Brushless Motor in no particular order. Indeed the Brushless Motor I have bought rotates easily with Arduino and an imitation program, which contains the only lines to supply these three voltages to the motor. The DOCUMENTARY (5) shows the Brushless Motor rotates with Arduino only.


[DOCUMENTARY (5)] Rotating 3-Phase Brushless Motor with Arduino and AC Square Wave


Here I explain how to rotate Brushless Motor by using Arduino UNO. You need to get a 3-Phase Brushless Motor. I think it has three wires.

  1. Connect these wires to pin 9, 10 and 11 on Arduino UNO in no particular order
  2. Download the two pdf files attached at the end of this step to your PC
  3. Open them in proper reader application
  4. Copy the whole of text in either of them
  5. Paste the copy to IDE for Arduino and correct misprints
  6. Upload corrected program to Arduino using IDE

Each of these programs is based on the original one provided by eLABZ. A high-torque-type motor for gimbal would rotate immediately at upload finished. On the other hand some high-speed-type for RC model might not rotate with the power from Arduino. Then some outer battery and motor driver IC should be used. In the DOCUMENTARY (6) below outer batteries and driver IC are used. In the former half of this video a high-torque-type is rotated and in the latter a high-speed-type is rotated respectively.


[DOCUMENTARY (6)] Rotating Two Types of Brushless Motor with Arduino, Outer Batteries and Sine Wave AC

Step 7: Testing a Single Axis Brushless Gimbal Using Existing Program

In the previous step we saw that simple programs uploaded to Arduino can rotate Brushless Motor easily. These programs imitate the core of existing programs written by eLABZ. The uploaded programs can be seen once downloading the pdf files attached to the end of the previous step. We can control rotational speed of motor to some extent by changing the value of the variable motorDelayActual in line 1 in these programs.

Here a test bench as a single axis Brushless Gimbal with Arduino is made. And the program for this test bench is prepared also based on one used in the previous step. Please note that the rotational angle of motor is not measured as well as the case with a cheap Brush DC Motor in Step 2. Hence gyro should be attached to the (1) camera side and some proper countermeasure is required to prevent vibration. The DOCUMENTARY (7) below shows the performance of this test bench controlled by the program with standard countermeasure to vibration.


[DOCUMENTARY (7)] Single Axis Brushless Gimbal Using 3-Phase Sine Wave AC


The test bench can compensate the rotation of its support (or base) roughly in the video above. But some problems are shown as follows.

  • Delayed starting for compensation
  • Unsteady rotation under compensating (pulsatory motion)
  • Some vibration remaining at stopping

So the program uploaded undergoes repeated improvements and tests to resolve these problems. The DOCUMENTARY (8) below shows the performance of the test bench controlled by the finally improved program.


[DOCUMENTARY (8)] Improved Brushless Gimbal Using 3-Phase Sine Wave AC


The improved program can weaken the problems above at some extent. But it could not seem to work well for the camera gimbal. Also the gimbal with it could hardly work better than Servo Gimbal in Step 4.

Step 8: Copernican Revolution and Brushless As Servo

In Step 5 an article in Instructables is introduced, which describes a challenge to get a 2-axis Brushless Gimbal controlled by Arduino. This challenge is supported by an existing program provided by eLABZ. But as authors recognizing, it is a pity that the gimbal gotten there does not seem to work adequately.

In the previous step I imitated the same original program provided by eLABZ and applied it to the single axis Brushless Gimbal. But it has never worked well in spite of executing any improvements I could think of.

Indeed it is written in the article about the original program that "this circuit was designed for a rather simple application (...) – the load is so light (...). If (...) your motor does not have Hall-effect sensors (many BLDC motors do), then this simplified circuit is not suitable for your application."


At the end of my resources, as dejectedly gazing at the gimbal working, it seemed to be quite unreliable as yet. I almost gave up. Then an idea hit me, "The most important here is not to rotate the motor quickly or smoothly but to keep it stopping tightly at the point".

It was felt a revolutionary shift of the goal for me. So I drew a figure simplifying Brushless Motor, and based on it I calculated the best operation to maximize the stopping power of motor at arbitrary angle (*1). Next, I prepared a whole new program to execute the operation and uploaded it to Arduino. Then I saw the Brushless Motor was kept stopping at the objective angle very strongly as never seen (*2). And changing the angle given, the Brushless Motor rotated immediately and stopped at the changed angle tightly again.

(*1) I learned fundamental knowledge of Brushless Motor by referring to an article in the site of Ijima-san (in Japanese). Though it is similar to the article by eLABZ in Step 6, an additional topic is mentioned about alternative connections, Y or Delta. Every Brushless Motor used in this project has Y connection. (At first I had the wrong idea that each motor had Delta connection. But later I found Y connection in the motor disassembled. I appreciate Ramirez_MecaUPQ's question.)

(*2) The earliest calculation was based on the assignment of slots (coils) explained in the site of Ijima-san. But no torque was gotten. After research I found a manual to build Brushless Motor kit (in Japanese). It taught me that there are alternatives among Y or Delta connections.


The new operation and program could make a Brushless Motor work like as a Servo Motor. So they were modified to be able to cooperate with gyro. The DOCUMENTARY (9) shows they work well on the test bench and suggests much better performance could be expected than Servo Gimbal.


[DOCUMENTARY (9)] Brushless Motor Made Work Like as Servo Motor

Step 9: Making a Precision Single Axis Brushless Gimbal With Arduino

The new operation introduced in the previous step would make it possible to get a Brushless Gimbal with Arduino of practical use. Now a Brushless Motor can work like as a Servo.

In this operation gyro can be attached to the (2) support side. The test bench prepared in Step 7 becomes a new single axis Brushless Gimbal under this operation. In the DOCUMENTARY (10) below the new gimbal equipped with a camera is tested.


[DOCUMENTARY (10)] The First Brushless Gimbal Operated by the New Program


In the video above we can see the performance of the new single axis Brushless Gimbal from two viewpoints like DOCUMENTARY (4) in Step 4 with Servo Gimbal. Now we can recognize that the new Brushless Gimbal works better than Servo Gimbal in Step 4 though the new one has some rough compensations as yet. Fortunately we have still several rooms for improvement such as value selection for parameter set in the program.

Also we can get some additional data by attaching another gyro to the (1) camera side of the gimbal. Indeed comparing data from both gyros I have understood there are three matters remaining.

  • Time lag at the start or the end of compensation
  • Attenuating shake at the start or the end of compensation
  • Angular shift after compensation: Uncompensated shift remaining

Among these three matters the second would be resolved by the standard PD control using the added gyro in the operation newly. Also the third is thought to be resolved by giving proper values for parameter set or using the added gyro. In the DOCUMENTARY (11) below we can see the effectiveness of exploiting the added gyro in the operation.


[DOCUMENTARY (11)] Effectiveness of Exploiting Added Gyro in the New Operation


In the video above we can recognize that each of the three matters seen in the previous video (10) can be much improved respectively by exploiting the gyro added. And we have still other rooms to improve.

For example the power supplied to the motor is about 5V in these videos above though the recommended voltage is 11 to 15V. In the DOCUMENTARY (12) below four more AA batteries are added to supply enough power to the motor and the values of parameter set are adjusted.


[DCUMENTARY (12)] Effectiveness of Adequate Power Supply to Motor


In the video above we can see that the first problem, "Time lag at the start or the end of compensation", is weakened so much under the enough power supplied. Now we should move from the stage using the test bench as single axis gimbal to the next stage making 2-axis gimbal of practical use.

Step 10: How to Make the Single Axis Brushless Gimbal With Arduino

Before moving the next stage where 2-axis gimbal is made, I show here how to get the DIY single axis Brushless Gimbal with Arduino which works in the DCUMENTARY (12) in the previous step. To avoid the long recipe I suppose readers here have enough experience with Arduino and gyro such as my earlier project.



  • 3-phase Brushless Motor for gimbal (x1): Limited to 14-pole, 12-slot (Though both Y and Delta connection are acceptable, assignment of slots have to be same as the figure shown in this manual.)
  • Arduino UNO (x1)
  • L3GD20 gyro chip carriers (x2): SPI interface with 4 lines (*1)
  • AA batteries (x4-8)
  • L298 motor driver (x1)
  • Plates (x2): For the support of gimbal and the camera mount
  • Others: Popular stuff for work with Arduino

(*1) I used Akizuki’s carrierhere. I know another L3GD20 carrier produced by Pololu. The latter is available also outside Japan. If it were used instead of the former, the picture with schematic above should be viewed.


[Program (or Sketch)]

  • Download the pdf file attached at the end of this step
  • Open it in a proper reader application
  • Copy the whole of text in it
  • Paste the copy to IDE for Arduino and correct misprints
  • Upload corrected program to Arduino using IDE
  • Though this sketch is optimized for Delta connection, it is applicable for Y connection
  • The sign of output of the secondary gyro at the (1) camera side depends on the manner to attach it
  • If the gimbal does not stop nor compensate but rotates the wrong direction (*1), try the last point of "Wiring" below first
  • If the gimbal still does not work well, the two lines commented out in this program should be made effective instead of commenting out the alternative two lines, A and B
  • If the gimbal still does not work well, try the last point of "Wiring" below again



  • See the figure at the top of this step and follow it
  • Three wires with Brushless Motor are connected to pin 3, 5 and 6 on Arduino UNO in arbitrary order
  • If the gimbal does not stop nor compensate but rotates the wrong direction (*2), change this connection appropriately

(*1, *2) To make the gimbal work well, both of outputs of gyros and wiring have to be set correct. Sometimes the output of gyro might become abnormal in spite of correct setting. Then cut the power off to Arduino and gyros once.



  • Reset Arduino
  • Don't touch the gimbal for 6-10 seconds: Keep both gyros still


The rough flow of the program in the attached pdf file below could be understood by seeing it on a block-by-block basis. On the other hand the details of some blocks might be not so clear. It needs much more steps to explain them. If many requests were gotten in future they might be told in another story.

Step 11: Making the 2-Axis Brushless Gimbal With Arduino

We have gotten the single axis Brushless Gimbal with Arduino on a test bench, which works as expected at the start of this project. Now the multi-axis gimbal of practical use should be made. Here 2-axis Brushless Gimbal with Arduino is made and tested.

It compensates un-intended rotation around two axes: TILT (looking up/down) and ROLL (rotating horizontal line). It needs two motors and six pins with PWM. So in this step a richer Arduino board, MEGA, is used instead of UNO. The main materials to build the frame of this gimbal are plastic plates and stainless steel brackets. The former plate is a goods for hobby named "Universal Plate". It has many regular pinholes and needs no special tool to be cut and so on.


The next two points take much time to build the frame.

  • Hunting good material for camera mount
  • Installing a pair of pin and pinhole for the TILT axis

In the former, some steel flat bar with regular pinholes is looked for, which is suitable both to the center of gravity of the camera and to the existing pinholes on the frame. On the other hand the latter work is required to be equipped with a camera bigger than GoPro.

Generally a Brushless Motor works as a good pair of pin and pinhole on arbitrary axis. It supports a cantilever by itself. So an ultra-lightweight camera like GoPro could be mounted on a cantilever with few problems. But cantilever could not support a bigger camera well. Hence a pair of pin and pinhole should be installed on the axis at the opposite side of the motor across the camera. The pin, pinhole and the motor should provide a good pair of fulcrums on the TILT axis to rotate camera smoothly without little backlash.


Once the frame is built, the 2-axis Brushless Gimbal with an augmented program for two axes becomes available to test. This naive gimbal has two problems as follows. The detail and the cause of them, and the countermeasures to these problems are described in the final step.

  • Chattering of the frame
  • Biased output from gyro to Arduino: Disturbance on SPI interface

Most of electrical components of the gimbal made here are plugged into a solderless breadboard and connected to Arduino, gyro or motors by jumper wires as yet.

In the DCUMENTARY (13) below we can see the 2-axis gimbal tested here is working, which is given some countermeasures to the problems above and allowed intentional TILTing additionally. In this video the gimbal seems to work well.


[DCUMENTARY (13)] 2-Axis Brushless Gimbal with Arduino Working (1)


On the other hand, in the DCUMENTARY (14) below, we can observe not only the gimbal working but also film shot by the camera on the gimbal in one picture. This video shows that there remains some room to improve for the compensation to ROLL (rotating horizontal line).

[DCUMENTARY (14)] 2-Axis Brushless Gimbal with Arduino Working (2)

Step 12: Making the 3-Axis Brushless Gimbal With Arduino

The two problems met in making the 2-axis gimbal in the previous step, Gimbal Chattering and SPI Disturbance, are able to be weakened by some conventional symptomatic treatments. Their details are described in the final step. And the room to improve observed in DCUMENTARY (14) could be resolved or reduced by adjusting values of parameter set in the program.

So here, the third Brushless Motor is attached additionally to the top of the frame of the gimbal, which could compensate un-intentional rotation around the axis for PAN (looking at right/left) newly. Next, electrical components are moved from a breadboard to a DIY Shield for Arduino MEGA.

At the same time, the program is augmented again to compensate the un-intentional PAN and to allow the intentional PANing. And the values of parameter set in the program are adjusted to reduce the room for improvement observed in DCUMENTARY (14). Now the DIY 3-axis Brushless Gimbal with Arduino for practical use has been gotten. Its performance can be seen in the DCUMENTARY (15).


[DCUMENTARY (15)] 3-axis Brushless Gimbal with Arduino Working


In the video above the camera mounted on the 3-axis gimbal shoots itself in front of a mirror. We can see both the gimbal working and the stability of mounted camera. As comparing this video with the DCUMENTARY (14) in the previous step, it is clear that the compensation for un-intentional ROLL is much improved in this step. This is the moment to go out with the gimbal and shoot various scenes to see its performance.

Step 13: Shooting With DIY 3-Axis Brushless Gimbal

We can see new matters in outdoor shooting, which are met with hardly in indoor testing. Therefore the values of parameter set are needed to be adjusted repeatedly again by shooting after shooting. We can see the films shot for this adjusting in the DCUMENTARY (16) below. There we should remember that a gimbal cancels out some rotation but it does not compensate any parallel shifts. Hence the vertical (up-and-down) motion in walking is not subject to compensation in the videos below.


[MAKING VIDEO (16)] Films Shot in Outdoor for Fine Adjusting


In the adjusting above, the main issue is the adequate compensation for the un-intentional ROLL. Watching a horizontal line in distant view in the video above, the degree of its rotational stability is different between scenes (shot under different values for parameter set).

The DCUMENTARY (17) below is a film shot in the adjusting also. It is good to see the performance of the gimbal adjusting here, because it has more stable compositions where the motion of horizontal line is observed well and it has a scene of battery is dead suddenly.

[DCUMENTARY (17)] Film Shot in Outdoor for Fine Adjusting (Shooting Forward/Backward)


On the other hand the six videos below are films shot with some adjusted values for parameter set. In the first one, SAMPLE (1), intentional PANing is used so frequently that we can see its effect well. The second SAMPLE (2) is uncut video shot by going up and down the stairs at a quick pace. And the rest videos, SAMPLE (3) to (6), have scenes shot under so various conditions that they would give us good information to estimate the efficiency of the DIY camera gimbal gotten in this project.


[SAMPLE (1)] Effect of Intentional PANing (Turning 540 Degrees)


[SAMPLE (2)] Up and Down Stairs (From Running to Quick Steps: Uncut)

[SAMPLE (2-a)] Up and Down Stairs (with Arduino DUE instead MEGA)


[SAMPLE (3)] Walking in a Park (Flowers and Persons)


[SAMPLE (4)] Walking on Dirt Path in Woods


[SAMPLE (5)] Uncut of the Gimbal Working from Power On to Off


[SAMPLE (6)] Low Angle Shooting

Step 14: Room for More Improvement

I have shown a story getting the DIY 3-axis Brushless Gimbal with Arduino of practical use. As searching web, there are few sites which describe driving Brushless Motor using only Arduino without other special devices. And it is a pity that the rare program provided in a precious article describing it has turned out to be unsuitable for the camera gimbal. (See Step 7.) Therefore I have prepared a new program independently and developed the DIY gimbal in order of single, two- and three- axis while augmenting the program.

The policies shown in Introduction, finishing this project with no imitation and no special device, seem to be kept finally. On the other hand I don't know the merits and demerits of this DIY gimbal well because I have not seen camera gimbal except for it. Here I describe the left room for improvement at the end of story.


(1) High Frequency Noise [: Resolved]

The program prepared in Step 8 makes Brushless Motor have strong torque in stopping or rotating. But the operated motor generates noise around 500Hz continuously. This noise has little negative effect to the picture of video. But recorded sound is so contaminated by it.

(* Added: )

It was found that the coils in Brushless Motor generate this noise by PWM pulse applied. The noise can be shifted into non-audible range (31kHz) with making the frequency of the pulse higher. It can be done in Step10 by correcting two points below. I appreciate the comments of EricL50 and ThaddeusW3.

Change Arduino-pin assignment in both the wiring and the sample program.

  • Pin8 > 5
  • Pin9 > 6
  • Pin5 > 9
  • Pin6 > 10

Add four lines below in “setup { }” in the sample program.

  • TCCR1B &= B11111000;
  • TCCR1B |= B00000001;
  • TCCR2B &= B11111000;
  • TCCR2B |= B00000001;

The video "Sample (7)" below was shot with the modified sketch. The high-pitched loud noise cannot be heard in it. The values of parameters in the sketch should be adjusted again to keep good compensation in this modification. There seems to be room for it still. The next video "Sample (8)" was shot with adjusted parameters. We can recognize higher stability even though shot in a high wind.


[SAMPLE (7)] Noise Eliminated

[SAMPLE (8)] Parameter Adjusted for Noise Eliminated Version


And long Shots for 15 minutes: TEST(1), TEST(2), TEST(3)


(2) Chattering of the Gimbal Frame [: Almost Resolved with Arduino DUE]

I met with the persistent chatter vibration of frame in the stage where the 2-axis gimbal of practical use was made from the single axis test bench. In contrast to the noise above, this chattering negatively effects picture. In the video shot with this chattering, the shape of object undulates. Though I do not know the accurate frequency of the chattering it is felt like about 50Hz. As touching some point of the frame by a finger, this chattering stops immediately. But it would disturb gimbal working.


[DCUMENTARY (18)] Disturbed Picture Caused by Gimbal Chattering


Though the root cause of this persistent chattering is not clear, the function of vibration damper in the sketch to compensate unintended tilting causes it. In this project the chattering is reduced by some conventional symptomatic treatments as follows. But more drastic measures are required for the fundamental solution such as improving frame rigidity and so on.

  • Adjusting values for parameter set in the program: Loosening compensation a little
  • Lowering power: Decreasing supply voltage to motor (7.5V) at two thirds of the lower level recommended one (11 to 15V)
  • Increasing size of the handle and attaching some brackets to it: Absorbing the vibration by the palm or changing the natural frequency of the gimbal by clutching bigger handle with brackets tightly.


(* Added in May 2018: )

I have described that we may be able to solve the insistent chattering or vibration with using Arduino DUE instead of Arduino MEGA. See the comments of the_3d6 and the replies for them. (They were posted about 11 months ago.) DUE has a 32-bit ARM core and its clock speed is 84MHz, though MEGA has a 8-bit AVR core and its clock speed is 16MHz. I also found that it is easy to change the PWM frequency on DUE. And fortunately in L298N, a motor driver IC, the minimum input voltage at HIGH status is 2.3V. Hence DUE, 3.3V board, can work without logic level shifter. However pin 50, 51 and 52 on DUE are not assigned for SPI, though these pins can be used for SPI on MEGA. Hence additional wiring is required on the DIY motor driver shield gotten in Step 12 to try DUE newly for 3-axis gimbal. After that, I tried DUE with my gimbal and found that the insistent chattering or vibration can be much reduced or almost disappeared but the ad hoc parameter set for MEGA should be changed for DUE. I recommend DIY makers should begin with DUE instead of MEGA when building a multi-axis brushless gimbal.

[SAMPLE (9)] With Arduino DUE instead MEGA (Parameter Adjusted)


The horizon shot with gimbal tells us how good it is working.


(3) Un-intentional ROLL Still Remaining [: Almost Resolved with Arduino DUE]

When seen from the outside, the DIY gimbal seems to compensate enough against the un-intentional rotation of its support. But seen from the mounted camera, the rotational stability of a horizontal line is not perfect. It is thought important to improve it that the following matters are resolved.

  • Inappropriate values for parameter set in the program: Loosening compensation to reduce the gimbal chattering
  • Insufficient power supply: Decreasing supply voltage to motor at two thirds of the recommended one to reduce the gimbal chattering
  • Discrepant coordinate system between gyros and frame of gimbal

The first two matters come from the conventional countermeasure against the gimbal chattering. Then the fundamental solution to the chattering is required here also. On the other hand the last matter concerns the calibration of gyro.

The program prepared to control the gimbal in this project is assuming that all four gyros and frame of gimbal have the same coordinate system (or the same three orthogonal axes). But in reality, each of them should be thought specific (*) and the three axes of each system would not be orthogonal strictly. It is possible to know the posture of each system of gyros comparing with the system of the frame. But it does not seem to be so easy and its cost-effectiveness is not clear. Hence it has not been executed in this project as yet.

(*) No special measuring or adjusting has not been done when the four gyros were attached to the frame of the 3-axis gimbal.

(* Added in May 2018: )

The lens axis of the camera in the gimbal is not always parallel to the shaft of the roll motor or Z-axis of the main gyro to compensate camera rolling. And this gyro is attached off-set on the special shield on Arduino at the back side of gimbal. See the pictures in Step 12. They are considered explicitly in the sketches for the video "Sample (7)" and the later. Though this revision could contribute to an obstinate vibration, a faster controller Arduino DUE can settle it. See the video "Sample (9)" above.


(4) Disturbance on SPI interface

The outputs of gyros are transmitted to Arduino by SPI interface in this project. Though it is used for a short range communication between digital devices, there ought to be no problem within three feet of distance. Indeed few matters has been met with while the electrical materials are plugged into a breadboard and connected to Arduino by jumper wires. But after replacing these jumper wires with ribbon cables, the behavior of the gimbal has become abnormal.

For a while (some days) the cause has not been unknown at all. Through a considerable process of trial and error it was made clear that SPI interface is sometimes disturbed when some special lines is put close. Especially the disturbance occurs very often when Clock-line (SCK) is brought near Output-line (MISO). No article which describes such a phenomenon has been able to be found. Hence it is thought that this is a specific problem between Arduino and the gyro sensor used here. Though the true cause has not been known, the problem can be resolved by choice the proper combination of bundled wires.

Move It

Second Prize in the
Move It