hi there everyone welcome back to my channel today we can take a look at how to calibrate
your dji drones gimbal manually using a python script now please note this does not support
all dji drones and i'll show you which drones are supported in the video that follows if you like
the content that i'm making please consider to subscribe it really helps out the channel
now there's going to be quite a few steps i'm going to list them all in the description below
but the first step is you have to download python just type in python download and google and you'll
find your link that you need to go to now once on the site go to the download page and on the
download page you're going to select the one for your system and this is now specifically for
windows i'm running a windows 10 machine therefore i'm just going to download the file that i require
next you're going to have to download py serial and this is a quite a tricky one
because once you've downloaded you need to have another file to uncompress it
so go to the pgy or py serial site and then once you're on the site click on download files
and you will be showing the options available in this case you're going to see this one p y serial
at the bottom that's 3.5 dot t a r dot g z that's the file that we need to download now once we've
downloaded the file we're going to need a file to be able to extract it since this is a dot our
gz file we'll need a unzipping or uncompressed program that can handle it in my opinion the 7zip
program is probably the best it's freeware so just type in 7-zip go to the site click the one that
you require in my case a 64-bit version now we're not done yet we still need to download the dji
firmware tools file very simple go to google type in dji firmware tools and the odgs one is going
to be the probably the one that's going to pop up first on github click on the link and just confirm
that it is the correct one you can see the files that i've got on my screen and on the right side
there's a code option click on that and then you can download the zip file now this is the actual
files that we'll be using to run the actual calibration
python and py serial will just be used to enable us to use the files in this folder or zip file
so once it's downloaded we have to go to our downloads directory and we're going to start
unzipping and uncompressing the files but before we continue we need to install python first
so go to your downloads directory and double click the python.exe and it's going to start installing
it and then wait for it to complete now in my case i've already got it installed but it's an older
version so i'm just going to proceed with the upgrade process it's not going to take too long
but i'll just fast forward this little section so it doesn't waste too much time after that's
done we need to unzip the files in the correct location so go to your downloads directory or just
go to your c drive first create a dgi folder i've already done that and in that directory you
are going to put your files so in your downloads directory you can go and unzip or just go to 7-zip
and then extract the files to the same location once that's done you're going to get your py
serial directory and you can do the same with the firmware tools now once that's done go into the
py serial directory you'll see there's a dot tar directory go inside that and then extract the data
file once extracted you need to take or copy the file in my case i'm just going to cut or move
the file to the directory that i created on my c drive called dgi so cut the file in my case and
then go to c drive go to the dji directory because it's already there i'm just going to replace it
so in this case replace everything so i've got the latest files there and then i'm going to do
the exact same thing with the firmware files so i've already unzipped it just connect the entire
directory just as it is cut it move it to my dji direction my c drive and then i should be ready
to start the process now open the dji folder after you're done extracting it or replacing it and then
inside you're going to find a file that is called comm underscore og underscore service underscore
tools just check that's there if it's there right click on it and then open with a notepad
as you guys can see i've just right clicked selected open with i'm not gonna always use it
and this is going to show us all of the supported drones so this little text file you see over here
i typically copy the contents out of it so i can work with it but if you scroll through it
you're going to see a list of all the drones that this firmware tools is going to support
so it's always a good thing if you're just doing one drone obviously just use the model
number you want in my case i want to save all of it so i'm just going to add a new window
copy all of the model numbers or drone serial codes so in this case just highlight all of them
and then i'm going to copy it to another file the advantage of doing this is is that
i'll be able to put the commands and everything else in the other file without having to work
on the actual config file remember you don't want to make changes to this file
because you're going to mess up the whole firmware tools so i'm just going to copy it out
paste into another file and in this case i'll be looking at a mavic 2 code so i've got other
drones here as well but i'm going to do the first test on the mavic 2 one and later i'm going to do
it on the mavic air 2 as well as the a1 i've done it on a spark as well and if you look at the list
there's quite a number of other drones now what you need to do is you need to open the command
prompt in administrator mode and once you've done that you need to navigate to your dji directory
now remember the reason we did this on the c drive is to make it easy so just type in cd backslash
enter and then you can type in dar to see what's in the in the folder then you can type in dgi
firmware tools and you can navigate to that directory now the idea is to go to the dji
firmware tools directory because that is where the com underscore og underscore service underscore 2
file is that is the script that we're going to initiate with the additional com ports as well
as your drone model number to be able to perform the gimbal calibration now if you
guys find the content useful please remember to press the subscribe button and also the like if
there's anything you guys would like me to do specifically or unclear on please mention it
in the comments below so i can follow up and make sure everyone's on the same page
now with regards to the gimbal calibration remember i said i was going to do the mavic 2 pro
first and the way you do this is you're gonna have to hook up your drone to your pc and once that's
done you need to get the correct com port and you do this by going to the device manager you do
this by right click on the pc clicking the manage option box and then you're going to see there is a
device manager option once you click on that just scroll down until you can see the ports location
or the option and you'll just take note of what the port number is in this case you can see the
port number is number 12 therefore i need to go to my script and change the port number to number 12.
i also need to change the drone model number so it matches the mavic 2 mavic 2 zoom drone
in the beginning we copied all the model numbers out into a separate text file
so in this case i'm just going to copy the example files from the description in this video below
and that's the script for the actual cable calibration then i'm going to take a look at what
model number my drone is you can see here it's wm240 i'm going to copy that and put it into my
script as you can see i just pasted into the same text document makes life so much easier and you
can just replace the files in this case com12 and wm240 and you'll see there are two scripts to run
first you could copy the top one which is the joint one and you're going to run
it in your command prompt so just if you copy it you can just right click in the command prompt
and press enter once you press it you'll see the gimbal start to rotate and perform its calibration
but remember it's not doing a full calibration you still need to run the other script as well
i always run the first script twice just to confirm that everything is running properly
because typically i'm busy with the script as well as maybe starting off with the second script as
well i just want to make sure everything runs properly you'll notice that there's going to be
an area that pops up at the bottom it doesn't get the feedback from the script as it would like with
a spark or the older drones but it still triggers the calibration as you can see so here i'm just
running it again just to make sure everything runs properly and the gimbal is nice and clear nothing
was obstructing it once i know the gimbal calibration is complete or can do the whole
process it's fine to do the second script so you can just go to your text document right click the
script copy and right click and then you can just run it from there second script typically takes
like two or three seconds to just get started as you can see there it starts to tilt and pivot
the second script takes a bit longer than the first one so don't don't be worried too much
if it takes up to 30 seconds to complete but in most cases you should be done within 15 seconds
just one thing to note just because the calibration has stopped moving the gimbal
doesn't mean it's done so in this case look at the camera it was still moving left right up down
but at the end you can see that it did a bit of a small little movement as if it was powering down
so in this case the calibration is now complete and i'll show you how it works with a mavic air ii
so exactly the same thing you take a look at your documentation you make sure you got the correct
com port as well as the drone model number and then you will just replace it in your script so
in this case i've already copied it and pasted it into another document
and makes it quite easy because all i need to do is just copy paste the command and i can run
it quite easily you can save it on your machine maybe for future use as well
but in this case it's such an easy process to go through that you can easily just swap out model
numbers as well as port numbers whenever you connect a new drone to your machine so the air
2 has a very similar process how it runs through with like the mavic 2 but as soon as you go to the
other drones like the air 1 and the spock you'll see the process changes slightly so i hope this
helps you guys please remember if there's anything that's unclear just post it in the comments below
and hopefully i can help you guys out please enjoy the rest of the video i'm just going
to show you how the calibration completes on the mavic air 2 as well as the mavic a1
you