Sunday, August 28, 2011

Hurricane Special: Navbar Updates + 4pcb's First Hops

I'm camping inside today due to the remnants of Hurricane Irene, which came up to the Northeast this weekend.

Isn't this what Boston looks like normally?
Anyway, it's a great time to make some major long-overdue navbar updates. 

Most importantly (seriously) I added a bit of dynamic content that tells me if the large brushless motors (codename: melons) have come back in stock at Hobby King. It should be right around here -------------------------->

Turns out Hobby King  has a web API that you can use to do everything from check inventory to pull up tracking numbers for specific orders. I've been habitually checking the site every day to see if any new motors have been released, because they are out of stock on almost every motor larger than 55xx. I think they're working on a new line of motors that will replace things in the 63xx size range, like the ones on tinyKart, but I also have hope that the 80xx (melons) will return. So, rather than scrolling through the site every time, I can take a quick glance at my navbar to see if any are in stock! I made a static page with the melon checker as well.

I've also added new links to other awesome project sites right about here --->

I hadn't updated my links in such a long time that I feel bad for leaving out so many awesome blogs, such as that of Transistor Man and fellow battery abuser Dane Kouttron, combat robot and electric vehicle builder extraordinaire Jamison Go, and potentially (lolpun) the most frightening underclassman ever Tyler C. of TC-Engineering (or does TC stand for Tesla Coil?).

Lastly, the project pages have been shuffled and updated:
  • Since there are now two electric go-karts, Cap Kart and tinyKart now share a new high level page. I don't know if I'll ever build another electric go-kart, but just in case, I now have a project category for them. (Or maybe, now that I have a project category, I have to build more...)

  • I added DirectDrive to the Motor Controllers page.

  • I actually populated the Self-Balancing Things page which has been a dead link for several months now. I've determined that the internet is an infinite Segway sink, so I can keep making silly balancing robots/vehicles and people will actually want to see them. Not sure why. But anyway, now there is a page for them.
That's it for the administrative updates, on to more interesting things:

PCB Quadrotor!
I'll admit, I rushed through this build without posting any updates, so this will be a little on the long side. I got the board from Advanced Circuits ( early last week. It's $33 for a two-layer board with silkscreen and soldermask, routed to any shape you want (including quadrotor shape). The first thing to go on was the Toshiba TB6588FG sensorless driver chip:

It's not the easiest chip to solder, but it can be done by hand. I managed not to put it in backwards. I decided to solder up just one ESC and its supporting passives so that I could test it with the tiny 5g motors to see if it would even work. I had to also put on the Arduino Mini before I could do so, but that didn't take very long.

Very quickly I ran into one of the problems that I was expecting: the TB6588FG datasheet mentions a commutation frequency limit of f_osc/(3*2^11) in the context of a protection feature that shuts down the drive if you exceed this limit. But, it doesn't mention what happens if you turn off the protection feature. I figured the possibilities were either that (1) it would work, (2) it would limit the frequency, or (3) it would explode. The actual answer was (2):

Speed limiting at about 800Hz (3 pulses per cycle).
The tiny 5g motors are actually very, very fast. Not only do they spin at about 14,000rpm, but they have 16 poles, so the electrical frequency in Hz is 14,000/60*8 = 1,867! Under load, I thought I might need at least 1,600Hz. So, I tried overclocking the chip by changing its oscillator resistor from 20k to 10k. This bumped f_osc from 5MHz to 10MHz.

And the speed limit goes up to 1,600Hz (3 pulses per cycle).
This seemed to work just fine. It will also double the PWM frequency, but I chose the lower of two options, so it's no worse in terms of switching losses than the higher case with 5MHz. I'm not sure how much more you can push f_osc, but it would be an interesting experiment to try. Other than that, the ESCs work well. The start-up routine is dubious, and seems to be designed for much slower motors. But they seem to be able to find sync on these motors even starting in the run state. Once spinning, they are able to change speed quickly and smoothly.

Confident that the Toshiba chip would do the job, I filled in the remaining three and then mounted the motors:

Copy-paste, copy-paste, copy paste.
Motors mount with 2-56 machine screws.
The motor leads are just long enough to reach the pads.
And when all the parts are together:

The total weight, including a 7.4V, 500mAh LiPo battery, is 125g. This is just a bit over what I predicted, but then again I was using a slightly different battery for that estimate. Each 4x2.5 prop should be able to generate at least 50g of thrust, so it can still fly. The yellow electrical tape is for balancing the props, which, for $0.40, were not very good to start with. It also helps for visibility and avoiding finger contact.

I put together some quadrotor control software (yes, in Arduino..) based heavily on the previous quadrotor project I was involved with. It uses a complementary filter on each axis to calculate pitch and roll angles from accelerometer and gyroscope signals. The angle and rate then go into a Proportional-Derivative (PD) controller that attempts to keep the quadrotor level and stable. Yaw is handled by a simple proportional controller that applies a differential signal to the counter-rotating props. The input for the control is done through my stock RC solution: a USB joystick and XBee radio modules.

Once I had something close to flyable, I did a few test hops:

You can see the control loop still needs a good amount of tuning. But the test hops also revealed a few other problems that I'll want to fix as well. For one, it could really use some landing gear. And I'm not just saying that because it currently crash lands on its LiPo every time, I don't really care about that. But taking off is actually the most difficult part, because it's not very stable in ground effect. Having four solid points of contact would help a lot at keeping it level during take-off, I think. Right now, the only real solution is to gun it and get it off the ground as quickly as possible, hoping it stays level enough to fly.

The other major problem I encountered was that, even though the props survive crashes very well, the motors are not as durable:

After several hits, the cans started to detach from the faceplates of a couple motors. They are held on only by a press fit with a short interface. Once the can comes off, the motor locks up. To attempt to fix this problem, I've been adding superglue to them as they come off. It would also help if I would stop crashing it.

Mostly, though, I think the flight can be improved with control loop tweaking. I'll be playing around with the P and D constants, to start with. The control loop is currently running at 100Hz, which should be fast enough to stabilize the system, but it's possible that there is some unaccounted-for lag in the motor control or sensors. The tradeoff seems to always be between oscillation and drift. Higher gains cause more overshoot and oscillation, but do a better job of holding it level. Lower gains are more stable, but it flies away in one direction or another. Finding exactly the right combination is frustrating, since it also depends on your ability to trim and fly it. So, hopefully with more tweaking and practice, I'll get it to the point where I can legitimately call it "flying".

1 comment:

  1. maybe use nylon standoffs, one in each quadrant mounted to the motor-mount screw holes?