Dan Barkus

4/14 3d Printing and tuning

Tuesdays are the only week days that I have time to fly when it isn’t dark out and my replacement arm won’t be here until tomorrow.  I decided to try to print a replacement arm and see if I could fly with that.

The first arm I printed was made out of the same nylon that I used to print the rest of the parts on the quad.  I figured that it would be strong enough to support everything, but flexible enough not to snap in a crash.
20150415_005652 20150415_005841
The part ended up being a little more flexible than I had expected and just wouldn’t be stiff enough to avoid flexing due to changes in motor thrust.
I decided to try another print in PLA which is a much more stiff material, but snaps pretty easily when bent.
20150415_005937
This is the PLA arm attached to the quad.  It feels less stiff than the other arms and is slightly whiter in color, but I think it will hold up fine until I can swap it out with the replacement tomorrow.  It might be a good idea to have a couple of these handy if I ever go somewhere to fly where I won’t have access to a printer or parts supplier.

I spent the afternoon flying in the small parking lot in my back yard instead of at the field that I normally fly at.  I don’t have any video because I was just trying to tune everything in and there wasn’t much to look at.
Before tuning, the quad was very loose to respond to any stick movements.  It took a while for it to move to the desired position.  I ended up raising the the P-gain to almost double what it was before and now the quad snaps into place with the slightest stick movement.  This is what I wanted, but I lost some of the finer control that I had before.  To correct this, I set up the sticks on the controller to react exponentially instead of linearly.  Now larger movements of the sticks close to the center have less of an effect on the position of the craft.  This also helps with more precise altitude control and making the craft responsive without being jerky.

4/12 Fun at the park

It was just too nice of a day to not to go flying despite my replacement motor arm not having arrived yet.  I ended up super gluing the arm back together.  I was a bit skeptical at first, but after letting the glue set for about an hour, the arm felt just as strong as the unbroken ones.

GOPR0126 (0-09-03-05) GOPR0126 (0-01-26-00) GOPR0126 (0-04-31-18)

 

There were a lot of people at the park and a few of them were pretty interested in seeing a quadcopter flying around.  A few people approached me and asked to wear the headset while I flew around.  It felt neat to be showing people the fun part of this hobby rather than the evil that the media portrays it as.  I kind of felt like a tour guide showing people the view from the skies.

GOPR0126 (0-01-51-02)A few people I met at the park waving to their buddy wearing the headset.

I tried practicing more controlled filming of actually trying to record something instead of just flying around pointlessly.  It was pretty tough to precisely control the craft as it’s currently setup, so I’m going to try and tighten up the controls with some better PID tuning the next time I fly.

I also managed to crash again although in a much less exciting fashion than before.  I’m willing to share the video of this one because I think it does a good job of showing some of the limitations of the multirotor platform.

The quad sort of just dropped once I changed direction.  This is due to all the turbulence caused by the multiple propellers.  This effect happens more often when descending straight down, but can happen in cases like this when the quad’s momentum pushes it through the turbulence it is creating.

The above image shows this effect.  The more colorful areas are the areas of higher turbulence.  These areas usually have pockets where there is less air than in the surrounding areas.  Less air means less “grip” for the props and therefor less thrust causing it to almost fall out of the sky.

The crash most likely would not have caused any damage to the craft if it hadn’t landed directly on the arm that I glued back together breaking it in the same exact place.

4/10 Shenanigans and a Crash

One of my roommates had a miniature ghoul Halloween decoration that was meant to hang from the ceiling.  Naturally, we thought it would be a fun thing to hang from the quad by a long string.  Unfortunately, we didn’t have any fishing line, so we had to use thick green yarn and the effect of a floating ghoul was lost, but it was still a lot of fun to fly with the thing hanging thirty feet below the craft.

I tried the FPV setup for the first time while flying.  It was cool for a while, but I kept losing video feed for segments of a couple seconds at a time which is pretty scary considering all you can see for that time is static.  Needless to say, I didn’t wear the headset too long, because being able to see where you’re flying is kind of important.  I suspect that the placement of my antenna on the quad is to blame here.  I had tucked it away inside the frame to avoid it being damaged if I crashed and I believe that the carbon fiber frame is blocking a lot of the signal.  My roommates that were with me did enjoy wearing the headset though.  I can’t wait until I can get that working flawlessly so I can see the video that they were excited about.

I got a bit too confident in my flying and tried zipping around in a somewhat enclosed area next to a building.  It didn’t end too well and I managed to hit a wall at full speed.  I ended up breaking two props and one of the arms that connects the motor to the frame.  The craft was a bit too loose handling for the maneuvers that I was trying to do, and my piloting was not up to par to be able to properly control the craft in that situation.20150415_005158oops

4/4 FPV

The main problem with the current setup of the quadcopter was that I couldn’t see what the gopro was recording while I was flying.  This made it hard to tell what was in shot and if I was fully capturing what I needed to be able to reconstruct a 3d model.

The solution to this was an FPV setup.
20150404_18183320150404_181814 20150404_181825

 

The main additions here are the extra camera and the 5.8ghz cloverleaf antenna.  It’s possible to stream video directly from the gopro, however I found that there was some lag when both recording and streaming from the gopro at the same time.  In addition, I would have to remove the gopro from the protective case and didn’t want to put it in any more danger than I had to.
The additional antenna is due to the higher bandwidth required for video streaming.  It’s entirely possible to stream video over 2.4ghz (which the controls for the quad are broadcast over) but the 5ghz band has much less traffic and is less prone to interference.

20150404_185931 20150404_235759

Here is the viewing setup for the video.  The screen on the left can be inserted into a foam housing with a lens and turned into a fairly geeky looking headset.  The screen is a somewhat special type of screen called a no-blue screen.  Basically this means that if there is some sort of loss of video signal, the screen won’t immediatley go to a blue screen.  This allows for the signal to be picked up immediately again once it becomes available.  I set up the screen so that it could be used wither attached to the controller as a screen, or worn on the head like goggles.

20150404_231152 20150404_230829

Here’s the view of the screen on the left and the view through the goggles on the right.

 

3/31 Photogrammetry

I found some sections from the footage that looked like they might be good opportunities to try out photogrammetry.

First I had to remove the fish eye effect from the video, then export it as a bunch of still frames

Photos
This is what ends up coming out.  The original video clip was 6 seconds long.

Rotation
Here is the resulting 3d model constructed with those photos.  There’s still some distortion around the edges, but it’s passable for now.  It’s kind of impressive yet concerning that a model of this detail could be created from just six seconds of footage.  Here is a link to download the model files.

3/31 First Photos and videos

GOPR0119 (0-00-31-15) GOPR0119 (0-01-43-18) GOPR0119 (0-01-54-10) GOPR0119 (0-04-36-23) GOPR0120 (0-03-12-12)

Everything went really well.

The video had a bit more jello than I hoped it would.  It’s not too big of a deal but I’ll have to find a different material to put between the quad and the camera mount to fix it.  I think I could do some more tuning to help minimize the wobbling on descent and the tendency to wander when hovering, but both of those are manageable for the time being.  Other than those small things, the quad performed perfectly.  My flying needs a bit of practice to really get a hang of handling the thing, but that should be the fun part.

I uploaded the unedited videos from my three flights here. I’m hoping to get around to editing the best parts of them together at some point, but if anyone else wants to play around with the footage I’d love to see what you come up with.

3/30 Building a Gopro mount

There weren’t any existing gopro mounting solutions that really fit my setup, so I decided to create my own.  I needed it to fit the gopro in the protective case, so I planned to attach the gopro with those mounting holes.  I also wanted to include a second arm that could be used for any accessories down the line.
Gopro mount Gopro mount 2
I designed this in autocad after taking a few measurements and decided that it would work well.  The arms are a lot thicker than they need to be, but I really wanted to make sure they wouldn’t break during flight and drop the gopro.
20150330_233409 20150330_233425 20150330_233726
I 3d printed the part in the same filament I used for the other parts on the drone.  This would ensure that it’s strong enough to hold the gopro, but flexible enough not to snap if it gets hit.  I added some foam strips to where the mount would attach to the quad.  This should help dampen any vibrations that would cause the jello effect on the video.
20150331_023006
All assembled and mounted with gopro.  I have to say I’m really happy with the way it came out.  There’s plenty of room for the camera to be mounted at any downward angle, and about twenty degrees upwards as well.  The mounts are a little closer together than I had planned on, but I don’t think it’s the end of the world.  I also forgot to design the battery mounting piece that I intended to be part of this mount, so I still have to find a new way to mount the battery.  I’m hoping to get it in the air sometime tomorrow and get some on board video.

3/29 Flying at the field and more advanced tuning

I couldn’t get anyone to come with me to film, so there’s no video. 😦
I did get some very good results though and managed to get the quad mostly tuned in to a level where I’m able to fly it reasonably well.  It’s still not perfect, but boy is it fun to fly.  I had to really push it to its limits in order to get the most accurate PID tuning.  The quad was easily traveling around 35mph with the throttle on the controller limited to 70% and the pitch limited to 45°.  Obviously, this won’t be too helpful for photography, but sure is fun.  I did rediscover that I really need to figure out a new battery mounting solution though.  I was flying low to the ground at full speed and quickly pitched backwards to stop, but that pitching managed to launch the battery out the back of the quad and result in a pretty cool half flip directly into the ground.  This broke the two rear props, but could have been a lot worse.
20150330_103603

3/28 Part 2: basic tuning

With this not being a pre-built quad, it’s needs to be tuned in to the motors and ESC’s as well as the weight distribution.  This is the most hated part of building a quad from what I could gather.  And from experience, I can confirm it isn’t the most fun.  I’ll go through a basic rundown of what this involves, but there are still aspects of it that I don’t understand, so I’ll try to link some helpful info.

PID tuning

“A proportional-integral-derivative controller (PID controller) is a control loop feedback mechanism (controller) widely used in industrial control systems. A PID controller calculates an error value as the difference between a measured process variable and a desired setpoint.”
There’s the Wikipedia definition.  Basically, there’s some lag between the time it takes for the signal to be received by the ESC and the time it takes the motor so spin up to that speed.  The more the FC knows about this lag, the better it can compensate for it.

This graph shows an untuned PID controller.  The blue line is the desired response form the device and the purple line is the actual response.  In the terms of quadcopters, this results in a very shaky flight as the FC is constantly trying to correct for the incorrect response from the motors.

This is the graph of a fairly well tuned PID controller.  Once again, the blue line is the desired response and the purple (now black) line shows the actual response.  It is much closer to the desired response and eliminates the wiggling problem.

First attempt at tuning

I tried to do some basic tuning in my room right after building the quad, but there just wasn’t enough room to get any results.  In addition, autolevling has to be turned off for accurate tuning and after a close call with my face, I decided I’d resume tuning tomorrow.

3/28 The controller and receiver

20150330_103244 20150330_103208

Somehow the controller arrived today after still not having the shipping information updated.  Either way, I’m just happy it’s here.  I forgot to take a picture of the receiver before I installed it, so that’s why it’s covered in wires and zip ties.  The controller is honestly my favorite part of the whole project so far.  It has a nice heft to it and way more options than I know what to do with at the moment.  But the real appeal to me is the menu and screen.  I’ll post a video of it when I get a chance, but the interface with the controller is just remarkably retro in the best possible way.

Assembly (also 3/28)

20150328_23583020150330_103149

 

I was too excited to start putting things together and kinda forgot to take pictures…  Most of the assembly was figuring out the best place to put parts and just making sure to plug all the wires into the right ports.  Wiring is fairly simple, there are ports on the receiver for each possible input, and those plug into the corresponding ports on the flight controller.  The ESCs plug into the motors, then wiring harness, and the corresponding motor ports on the flight controller.  Power from the battery goes to the ESC’s where it is split between the motors and a lower voltage signal to power the flight controller.  The flight controller then passes the power down to the receiver.

All the wires are secured with zip ties for easy removal if I decide to rearrange things.  I printed a standoff for the flight controller to make mounting easier and double as a place to manage the wires form the ESCs.  I also zip tied down the receiver and battery.  I’m hoping to find a better solution, but for now, all I have a zip ties.  Because of the battery being under the quad, I had to print attachments to raise the landing gear.

3/27 Another Batch of Parts

IMG_0693

They’re finally here (mostly).  I still need the controller and receiver, but this is the big package I was waiting for.  The controller has an ETA of 4/22 and the tracking info hasn’t been updated in over a week, so I don’t really know whats up with that, but hopefully it will arrive early.

Electronic Speed Controllers (ESCs)
IMG_0696 IMG_0698

The ESC controls the power flow to each motor.  Because of the high voltage coming from the battery it can’t directly interface with the flight controller, so the ESCs are needed to keep the voltage away from the delicate circuitry while still letting it get to the motors.

Power coupling
IMG_0699

This isn’t really the most exciting part, but it’s what gets the power from the battery to all of the motors / ESCs.  There are more elegant solutions to this, but a breakout cable like this is the easiest to quickly swap out ESCs in the case of a failure.

Props
IMG_0694 IMG_0695

Once again, not the most interesting part, but ultimately the one responsible for flight.  I bought two full sets to start out, but after looking through forums online I ordered another five sets.

3/24   Still Waiting on Parts…

I’m waiting on two more packages before I have all the parts needed to get this thing off the ground.  One should be delivered no later than the 30th, and the other has an eta of 4/22… Hopefully they’ll arrive sooner than expected, but I’m not getting my hopes up.

In the mean time, I decided to do some more research into using drones for photogrammetry and found these videos:

Both show some pretty impressive reconstructions, and the second video even uses the same software that Wes and I have been playing around with (Photoscan).  Of course, these are large scale scans, and the second video is using GPS guidance which I decided not to include in my build.  Either way, it gives me high hopes that I should be able to get some pretty good results from my system.

I also ordered a goodie or two that will make the quad much more enjoyable to fly and will help improve the accuracy of the scans, but it’ll probably be another two weeks before any of that gets to me.

Printing some parts

In the interest of saving money, I decided to print some of the mounting hardware required to hold everything to the frame of the quad.  So far I’ve only printed the case for the flight controller, and still need to design a mounting option for the gopro and some longer landing gear to keep the battery from smacking into the ground when it comes landing time.

Flight controller case

A  case isn’t really necessary, but it helps to protect the fc from damage from crashes or other external factors.  I couldn’t find any existing online that really fit my needs, so I designed one myself.

Board_Model Case_and_Board
The picture on the left is the mockup of the controller that I made to make sure I could position all of the components of the case in the right place.  The picture on the right is the case with the fc inside it.

20150324_224924 20150324_235327
On the left are the two pieces of the case just after they finished printing, and on the right is the whole assembly put together.  I colored the button areas black with a sharpie and will most likely be using shorter bolts when actually mounting the thing to the frame.

I printed the parts pretty thin (2mm) to minimize weight and used a cool nylon polymer (PCTPE) that is flexible when thin, but super strong when printed thicker than a couple mm.  I’ll most likely be using the same plastic for the rest of the prints.

 

3/17   1st batch of quadcopter partsIMG_0631

The main objectives of the quad were to achieve stable flight with enough power to lift a small camera.

The Frame (some assembly required)
IMG_0645

The frame holds the components of the quad together and houses the electronics.  The frame size for this project is in the 330mm class.  This is a good balance between being big enough to carry a camera, and small enough to be able to move along the flight paths required for scanning.

The Motors
IMG_0632 IMG_0636

Motors are the main factor determining how the quad can fly.  These motors rotate at a lower speed, but with more torque than standard quadcopter motors.  This makes them able to drive larger props for better stability and lift.

The Brain
IMG_0642

This is the flight controller for the operation.  It is responsible for distributing power to the motors in a way that will keep the quadcopter flying steady.  The controller features a variety of settings to finely tune the performance of the quad to match its desired needs.

The Battery(s)
IMG_0647

The batteries are lithium polymer (LiPo) and able to store and deliver the large amounts of power needed to fly the quad.  The batteries I’m using are 11.1 volts and 2700 milli-amp hours.  This is a standard voltage for this size of quad, but a higher capacity.  I figured it would be better to go with a bigger battery to allow for longer flight times while carrying a camera.

Assembly

IMG_0651The quad assembled with all the parts I have at the moment.  It weighs a little under a pound and a half as it is now and the remaining components should raise it to a little over a pound in a half.  I’ve estimated the maximum lift of this setup to be around 5 pounds, so that still leaves the quad able to carry about three and a half pounds of camera equipment.  Hopefully the remaining packages will come in later this week or early next week.

 

 

 

Building a Quadcopter for 3d scanning

I’m planning on building a quadcopter for use capturing photo or video of a subject then converting it into a 3d model.  For smaller objects like people, this doesn’t provide much advantage over standard capture techniques.  It does, however, allow for objects out of reach to be scanned, or objects that are too big to easily scan.  I’m planning on building the platform around a dual control method.  The quad will be able to be controlled with a traditional remote control, but also semi-autonomously with the built in Arduino and ultrasonic sensors.  The user would specify a scanning subject via a smartphone app.  The app would then relay flight paths needed to scan the subject to the quad.

 

 

Subway sandwich 3d scan


Scanwich


 

Using video to capture 3d objects

Taking the necessary amount of photos required to get a good scan can be time consuming.  During the time required to take all these photos, lighting can change, or the subject could move resulting in a poor scan.  Using video allows for scans to be done quickly on the field side, with only a little extra work on the post-processing end of things.

Capturing Video

This is the easiest and most important part of the process.  Just like capturing photos, make sure your subject is in an evenly lit environment where it will not move.  On the camera end of things, it is best to capture in the highest resolution available on the device that you are using.  If you’re shooting on a phone, make sure image stabilization is turned on.  If you’re using something that allows you to adjust the shutter speed, set it as fast as possible to reduce blurring.
To capture the video, just hit record and try to capture the subject from all angles.  Try to keep camera motions smooth and consistent to reduce blurring and make sure every part of the subject is captured equally.  The video doesn’t need to be long, I’ve found that 30 seconds works pretty well.

Here’s the video that I captured for testing purposes:
https://drive.google.com/a/emerson.edu/file/d/0B_F5aGhMCdYPV1l1T1ZMYXM4U1k/view?usp=sharing
The video was shot at 4k, but I’m testing to see if there is any difference in scan quality between 1080 and 4k.

Post Processing

The next step is to take your video and turn it into images that you can use for photogrammetry.  Fire up your favorite editing application and drag in your video.  Change your export settings so that the file-type is “JPEG sequence” and change the output frame rate to somewhere between 1 and 5 then hit render.  You’ll end up with around 50 to 250 frames depending on your settings and video length.  These images can be directly imported into the photogrametry application of your choice.

This is the result of the scan in the video above using 156 frames from the above video down-sampled to 1080p.  The model can be downloaded: Here
Watch_1 Watch_2

 


 

I’ve been playing around with this software called VisualSFM.  It’s basically an open source, hardware accelerated version of 123d catch.  Here’s the website.  There isn’t much information, but I found a blog post giving a workflow for using it and showing off some of the more impressive features here.  Unfortunately I’m having trouble installing the software due to a lot of the dependencies that are needed for it to run.  I will keep this updated with any results or progress that I come across.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s