Friday, April 10, 2015

Q450 Quadcopter servo gimbal setup, Part 1

Digging back into FPV / Aerial Photography with a new camera gimbal
I was inspired by recent articles in Make magazine about FPV racing and the local Minnesota Autonomous Vehicle meetup to do some more quadcopter flying and building.  My main quadcopter is a Hobbyking Q450- which I originally bolted together a year or two ago with a crude FPV camera mount made from a Home Depot low voltage electrical box bandsawed and bent into something usable.  These days there are many, many better options for mounting FPV cameras- ranging from simple servo stabilized mounts through very sophisticated 3-axis brushless gimbals that yield professional video smoothness.

I was looking for a cheap and simple solution, and I ended up buying the "ActionCam Inline Gimbal GOPRO and FPV" kit from Hobbyking. I'm planning on using it to mount and stabilize both a GoPro and my small FPV camera. It uses two standard servos, and the Hobbyking KK2.0 flight controller I have will be able to control the servos without any software updates or hardware.

Kit Assembly
The kit comes with decent hardware, although it doesn't include the screws that join the upper and lower plates together.
Kit Contents

"Instructions"

I used a larger, standard sized analog servo for the roll axis

I originally tried a smaller Hextronik HXT500 5g servo for the pitch axis, but it was a little too small. 

A Turnigy TG9e 9g servo was a good fit for the pitch axis

Unpacked hardware kit. The camera mount pivot is pretty nice, it seems to have some rotary damping

I originally tried pressing the camera tray on to the servo directly. It wasn't quite the correct width- a tad too narrow.

So, I decided to bolt the camera tray on to a servo horn. I drilled the horn in two placed for 2/56 screws. I accidentally cracked the servo horn when I screwed in the outer screw. I didn't have a 2-56 tap so I drilled the holes to size then tapped the holes with a screw- mostly worked. I have since ordered a set of 2-56 taps off of e-bay- next time I'll use the right tool and avoid cracking the servo horn. 

Servo mounted to the camera tray using 2x 2-56 SHCS + 4x washers. I used washers under both the nut and the screw head to allow for maximum clamping of components. 

Second view of mounted pitch servo

Mounting the roll servo. My first try placed the servo horn on the "inside" of the frame, but there wasn't enough clearance for the mounting screws- they hit the servo. So I moved the servo horn on the "outside" of the frame. 

Roll servo showing 2x 2-56 SHCS, washers and nuts


Upper mounting plate attached to servo. (note this is a photo of the first try with the kit's hardware which I ended up ditching) I decided to use my own 2-56 hardware because it seemed to fit better. I also decided to place the roll servo above the vibration damping plates, then attach the vibration damping plate to my Q450 frame. This arrangement seemed to make the most sense for my purposes. 

Roll servo attached to the upper plate- first try with the kit hardware. The threaded ends of the screws extended too far past the upper plate and interfered with the lower plate. 

. Now with the 2-56 screws attaching the servo to the upper plate. Vibration damping balls (blue) installed

Note the head of the screws securing the roll servo are under the upper plate, double-nutted on the top. 

Bolting the lower plate onto the Q450 quadcopter frame


I had to dremmel the slots on the Q450 quad copter frame slightly wider to allow the lower mounting plate to fit. 

Camera gimbal installed. I used 4x 4-40 x 0.75" SHCS to attach the upper mounting plate (with camera gimbal attached) to the lower mounting plate. I didn't have any 4-40 lock nuts, so I used a few drops of blue locktite threadlocker on the threads to keep the nuts from vibrating off during flight. I only used screws on the outside group of damping balls to save weight. 

Ready for plugging in the servos and setting up the KK2.1 flight controller. 

The setup that worked for me for plugging in the camera gimbal servos was the Roll servo in the KK2.1 output #7, and the Pitch servo in KK2.1 output #8.

KK2.1 Setup- first go to "Camera Stab Settings"

The "Gain" settings adjust how much the servo corrects. the "Offset" setting adjusts the neutral location of the gimbal. To check functioning- first take the props off the motors. Then throttle up slightly so the motors are spinning- only then will the gimbal react to motion of the quadcopter. If the gimbal moves the wrong way, change the gain to negative. The gains shown in the photo above is what I'm starting with that appears OK. 
Next steps:

  • Adjust servo arm position on both servos to try and get the offset to zero. This will get a larger range of motion in one direction in both axis. 
  • run servo cables
  • attach both gopro and FPV camera to gimbal
  • fly!

Sunday, February 15, 2015

Magicshine mount for Giro Edit

I just purchased a new helmet for winter riding- I was tired of getting a brain freeze from riding in 10 degree temps with my regular helmet and Gore balaclava underneath. Way back in the day I would have just duct-taped the helmet vents, but these days there are lots of great winter helmet options. The helmet is great by itself- and it has a nice bonus feature- a built-in GoPro mount. One of the nice things about this new helmet and printed mount is that no additional purchased hardware is needed to attach the light.

I designed a mount for the gopro adhesive mount I attached to my summer helmet, but the angles were not right for the new helmet. So, off to Solidworks to design a new mount. The first try seemed to work well. I might add a feature to clip on the wire, but other than that it's good to go. I might also try moving the light further back towards the helmet.

I placed the Solidworks .prt and .stl files on thingiverse if you want to print your own.

GoPro adapter printed

MagicShine bolted on

Magicshine LED mounted to the Giro EDIT



Tuesday, February 10, 2015

Raspberry Pi Time-Lapse, First Movie

First shots taken- spaced one minute apart from 7am to 7pm on 2/10/15. Once the series of shots were taken, I used Microsoft Movie Maker to put together a video.

The process was very easy- basically import all the photos into Movie Maker and set the duration. I used a duration of 0.04 seconds per photo to yield about 24 frames / second. Unfortunately it was a snowy and overcast day, so it's a really boring video.


One issue that is noticeable right away is that the red camera on light shows in the photos. The Raspberry Pi camera light is very easy to turn off, see this link.

Following the link's instructions, open up the config.txt file for editing:

sudo nano /boot/config.txt 

Then add this to the end of the file:

disable_camera_led=1 

save, reboot your PI, and you are in business minus the annoying light.

Monday, February 9, 2015

Raspberry Pi Time-Lapse Camera : Go time!

In the previous post I went though a few tries to get my Raspberry Pi set up to take time-laps photos. After a few false starts I had success using the instructions on the Pi foundation's website:


I also found that my PI tended to pull the same IP every time it booted- even though I couldn't get it to successfully set it's network configuration to static. 

I was successful, however, getting it to automatically log onto my wireless network every time it booted.

I used the instructions on the raspberrypi.org website listed above to set up a crontab scheduled job to take a photo every minute. Initially I used their instructions just to test the function and made sure it worked. Then, I combined those instructions with some info on a crontab tutorial (located here) to set up a job where it would take a photo every minute from 7am to 6pm, every day of the week. This roughly corresponds to daylight hours in Minnesota right now. 

The line in crontab ended up to be:

* 07-18 * * * /home/pi/camera.sh 2>&1

The first position "*" indicates each minute
"07-18" indicates hours 0700 through 1800, every hour (24 hour clock)
The third position "*" is each day (# of days)
The fourth position  "*" is every month
the Fifth position "*" is every day of the week

I'm not exactly sure what the "2>&1" does....

After I had that set up, I shut the PI down, disconnected the monitor, keyboard and mouse, and taped the PI's camera to my sun porch window, and plugged it in. 

I was able to both SSH and sftp into the PI using the IP address I had written down earlier. I used the standard Nautilus file manager in Ubuntu 14.01 as the ftp client, and PuTTY as my SSH client. 

Tomorrow night I'll sftp in to the PI, and hopefully have a folder full of pictures to put together a movie with. 

Sunday, February 8, 2015

Raspberry Pi Time-Lapse Photo initial setup

I'm finally getting around to another project that's been on my list for a long time- putting together a self-contained time-laps camera using a Raspberry Pi and camera module. I'm planning on mounting it in some sort of waterproof container and placing it outside- I hope I can catch the melting and breakup of the lake ice later this spring.

If you haven't heard of the Raspberry Pi, it's a $35 linux computer the size of a deck of cards. Head to http://www.raspberrypi.org/ for more info.



Updating the Raspberry Pi
I'm using Raspberry Pi B model. It's been sitting in a box for quite a while so the first step is to update all of the software. Open up a terminal window and fetch available updates:

sudo apt-get update

then, apply the updates:

sudo apt-get upgrade

These two commands might take a while to complete- particularly if it hasn't been done in a while.

I'm planning on having the Pi close enough to my house so it should be able to connect to my wifi network- nice for transferring files and remoting in to adjust settings, checking alignment of the camera, etc.

Setting up the Pi to automatically connect to my home wifi network (successful)
I found some instructions on how to change the Pi's network configuration so that it'll automatically connect when it turns on:

http://weworkweplay.com/play/automatically-connect-a-raspberry-pi-to-a-wifi-network/

Attempting to set up a static IP address (not successful)
I also wanted to be able to SSH into the Pi to adjust settings, etc. So, to accommodate SSH the next step after configuring the wifi to automatically connect on boot was to change the Pi to a static IP. The previous link also had instructions on how to change from dynamically assigned to static IP. Here is another link with more detailed instructions on setting up a static IP on your raspberry pi:

https://www.modmypi.com/blog/tutorial-how-to-give-your-raspberry-pi-a-static-ip-address

However, when I was trying to comment out the old versions of lines in the network configuration files, I couldn't get # to work on the keyboard- some other character would appear instead. It turns out my PI didn't have it's keyboard configured properly.

Using:

sudo raspi-config

from the command line I was able to work through the menus to reconfigure the keyboard to a standard US 104 key layout. One note- some of the menus in the raspi-config program take a very long time to load- 10 seconds or longer. So have patience- it took me several times to realize this and not think the terminal window had crashed.

Then, back to trying to get a static IP setup.... And, no luck. I went through every tutorial I could find and it just didn't work. I'll have to postpone trying to set up SSH and just get the camera working on its own.

Back to the Camera setup
next step- installing Berrycam software on the PI so I can control it with my android phone.

see:
http://www.fotosyn.com/berrycam-support/

Installed- then installed the Pi Sight app on my Nexus 5- and no dice. The app would crash almost immediately every time I tried it. I immediately uninstalled it.

Then, after looking on the play store, I tried RaspiCam Remote. That worked right away- and without anything to install on the Raspberry Pi.

After trying and failing to use the Pi Sight app along with the berrycam script, I thought I'd go back to the basics and try using a tutorial that explains the process from scratch- and I found this:

http://www.raspberrypi.org/learning/timelapse-setup/worksheet.md

Great, step by step tutorial- and explanation about what each line does!

Tomorrow- to actually take some photos.

Wednesday, December 31, 2014

ShapeOko 2 Build: Part 1

I've been watching the ShapeOko2 from Inventables for the last year. I've been interested in DIY CNC for the last several years, but the time wasn't right to jump in. When their kit went on sale for "small business Saturday" I decided the time to order the kit had arrived. I decided to spring for "the works" kit which includes the Quiet Cut spindle and a bunch of other upgrades.

The kit was very complete, down to including all the tools you'd need for mechanical assembly, and well packed. The basic instructions on their website were also very good. However, I was a bit underwhelmed with the documentation included for the extras in "the works" kit. The inventables website did have a page: ShapeOko 2 "The Works" kit instructions- not really instructions, but has at least a few more details.

So far, I have the mechanical assembly complete, and have started to wire up the system. The first challenge was to attach the drag chains / cable chains included in the expanded kit. Mounting brackets were not included. The Shapeoko2 wiki did reference these 3D printable drag chain mounts, they look nice but they don't fit the drag chains included in the shapeoko2 "the works" kit. I ended up designing a set of brackets (files posted here on thingiverse) since I couldn't find any ones on Thingiverse that seemed to do what I'd like.





A few of the brackets I designed, ready for trial mounting. (these were old versions, I ended up not using them)

X-axis carriage with drag chain mount. Wires not yet routed through chain

Outboard X-axis drag chain mount installed, again wires not yet routed through chain


It's getting closer to running....

As soon as I have the steppers all wired I'll start in on the Quiet Cut spindle. There are a few different sets of installation instructions- I have yet to choose one to follow:

Quiet Cut Spindle installation instructions:
http://blog.inventables.com/2014/08/quiet-cut-spindle-for-shapeoko-cnc.html
https://www.inventables.com/projects/quiet-cut-spindle-upgrade#instructions

Quiet Cut Spindle w/TinyG electronics instructions:
http://blog.inventables.com/2014/07/shapeoko-upgrade-quiet-cut-spindle-with.html
http://blog.inventables.com/2014/06/shapeoko-upgrade-quite-cut-spindle-with.html

Tuesday, December 2, 2014

45Nrth Vanhelga tubeless setup with Marge Lites

It was time for some new, more aggressive tires for the fatbike. The Husker Du's I have are great on dirt and hard pack snow, but in looser conditions they really struggle. I'm planning on putting them back on next spring. 

45Nrth has a new tubeless ready tire called the Vanhelga that has been getting great reviews- I decided to give it a try. It seems to be the widest, most aggressive tire I can fit in my old school 170mm 9:zero:7. New snowbike tires are not for the faint of heart-  they certainly lighten the wallet. I've never paid this much per tire for even car tires!

Apply for a loan before you bring these to the counter
I decided to go with the more expensive 120TPI version- even with the additional cost, it's probably the cheapest way to knock some serious weight off of a fatbike.



As soon as I got home I tossed the tires on the scale:

120TPI 45Nrth Vanhelga: 1279g & 1298g each

Amazing that this aggressive of a tire is as light as it is.

Motorcross or Snowbike Tire?


"old" tires: 45Nrth Husker Du, 60TPI
As I took parts off the bike in preparation for changing out the tires (and attempting a tubeless conversion) I put everything on the gram scale.

Old Front Wheel setup: 3380g (all up inc. tire, tube, etc)

Bare Front Wheel: 1345g

  • MargeLite rim
  • 907 135mm hub
  • 160mm rotor
  • spokes, etc


Surly rimstrip: 60g
Bontrager 26x2.50-2.80 Tube: 280g

45Nrth Husker Du, 60TPI: 1650g

I'm going to attempt a tubeless conversion, but not the full "ghetto" tubeless conversion with split inner tubes, sill foam, etc. I'm going to first just try a solid rim tape setup and go from there.

Supplies, ready to go


Materials:

  • 3M 8898 Tape, 72mm width
  • Reflective Tape, cut down to ~43mm width
  • Stan's valve stems
  • Stan's sealant
  • Tires


Plan:
1) remove tire, tube & rimstrip
2) true wheel
3) clean rim with rubbing alcohol
4) Cut down reflective tape & wrap around rim, securing at one end with small piece of tape, then stick to itself
5) apply 3M 8898, try to keep centered
6) carefully stick tape down to bead seat area of rim

Tire & rim strip removed, rim cleaned, truing it up. 
Starting to wrap inner layer of reflective tape- sticky side "out", reflective side in (to show through rim cut-outs)
Full wrap of reflective tape
Getting the 72mm wide 3M 8898 wrapped down tightly was tough- it's nice and tight over bead seat area but not in the center.

1384g after reflective rim strip & 72mm 3M 8898

That's one beefy tread pattern
It looked good and I had high hopes for an easy tubeless setup, but no luck. I couldn't get the bead to seat even using the tie down strap method, with valve core removed and an air compressor. I tried putting a tube in, seating the beads, popping one bead, removing the tube, and trying again- but no luck. There is just too much room between the tire bead and the center of the rim. I think it'd work fine using the sill foam tape trick, but that'll be for another day.

So, I gave up tubeless for now- re-installed tube. Even with a tube there was substantial weight savings from the new tire:
2920g Front wheel, new rim strips, tube & new tire = 460g savings from the front wheel alone

I repeated the process with the rear tire, minus the tubeless attempt.

Old Rear Tire on wheel: 3920g (all up, tire, tube, etc)

Bare rear wheel: 1897g (no rimstrip)

  • MargeLite
  • 907 170mm hub
  • 160mm rotor
  • Cassette w/ 42T Giant Cog
  • spokes, etc
Bare rear wheel with 72mm 3M 8898 & reflective tape: 1962g
rear wheel with Vanhelga, Tube: 3470g = 450g savings

So, just changing out tires and rim strips to the new 120TPI Vanhelga's yields 910g weight savings, just a hair over 2 pounds. Pretty amazing, especially considering the new tires are both wider and have much, much more aggressive tread patterns.

Still plenty of chain clearance with a 1x10 setup. A 2x10 might be pretty tight. 

A short ride around a frozen lake with 2-4" of snow shows the new tires function much better in loose snow- they tracked and gripped with authority. I'm hoping to ride some snow-covered singletrack this weekend!

I'm also going to search through Menard's and try to find some self adhesive foam tape for the tubeless conversion.