Thursday, November 29, 2018

KSP: Laythe Colony Part 2, The Robotic Fleet and Launch Window #1

In honor of the successful Mars InSight landing this week, I thought I'd do a progress report on my long-term KSP mission to get as many Kerbals off Kerbin by Year 2, Day 0 as possible. Part 1 sets up the premise and the main strategy. In this Part 2, I throw about 1,000 tons of robotic hardware at Jool during the first available launch window, with hopes that at least some of it winds up in a single spot on the surface of Laythe as the seed for a colony.

The busy 1000m/s on-ramp to Jool Transfer Orbit.

The Robotic Fleet

For the first launch window, I decided to send only uncrewed vehicles to feel out the Jool transfer orbit, the details of maneuvering within the Jool system, and the landing procedures at Laythe. The robotic fleet consists of three types of ship: Triple Relay Satellites (RS3), Laythe Rovers (LR1), and Habitats (HAB1). Each one has a different function crucial to settling a remote colony.

RS3

Does this thing get HBO?
These are the smallest and lightest ships, but critical to this first remote-controlled mission phase. One of the relatively new realism additions to KSP is that uncrewed vehicles need to have a line-of-sight communication path back to Kerbin, or to a ship with a crew, in order to maneuver. To achieve this requires lining up a bunch of relay satellites around Kerbin and at other useful locations in the system. 

Each RS3 assembly carries three small relay satellites with their own ion drives. In addition to the ones already parked around Kerbin, two sets of three are on their way out to Kerbin L4 and L5 stations and then eventually other equally spaced points in the orbit. Three more sets are heading out to an intermediate orbit between Kerbin and Jool. And four sets of three are in the fleet heading for Jool, to set up a network around Laythe.

The start of the mission's comms network.

LR1

Practice driving on Kerbin.
The Laythe Rovers are giant 30 ton workhorses. The main function of these 8WD crawlers is to seek out ore to mine and make fuel on Laythe. They each have two large drills, a refinery, and a huge fuel storage tank. They can dock with a parked space plane to refuel it, which is critical for sustaining a link between the Laythe surface and hardware/habitats in orbit.

Landing the rovers is a four-step process. They come packaged in an aero shell with a heat shield, so the initial descent involves just surviving with the heat shield pointed in the right direction. After some time, the drag on the large heat shield flips the package around and the heat shield itself becomes a supersonic air brake, with the aero shell protecting the rover. Once subsonic, the heat shield and fairing are discarded and set of parachutes further slows and rights the rover. Lastly, a set of four rockets slows it to a safe velocity just in time for touchdown.

Step 5 is to quickly deploy the solar panels and drive out of the way of falling fairing debris.

HAB1

Home, sweet home.
The Kerbals can live for extended periods of time in orbit, but having a home base on the Laythe surface will be important for long-term survival. In order to facilitate construction, the surface habitats are themselves rovers with roughly the same chassis as the LR1s. They land the same way and, once on the surface, can drive to each other. This will be important, since the landing target might hundreds of square kilometers.

The habitats are extremely modular. They can be individual homes for a single Kerbal family, including single-passenger mini-rover parked in front. Or, they can be docked together indefinitely to form a larger base, thanks to a central hallway section with docking ports on either end. The slight angle of the hallways allows them to fit inside the aero shell.

How much fuel to bring?

The LR1 and HAB1 landed payloads are both around 28 tons, about half the mass of my first Laythe lander. (That lander had to be heavy in order to have enough fuel to get back off of Laythe, a task to be handled by space planes this time around.) In that mission, two identical ships flew independently to Laythe with an average of about 2500m/s of fuel-burning Δv. But, they also made heavy use of aerocapture at both Jool and Laythe. Without that, it would take something more like 4360m/s to get from low Kerbin orbit to low Laythe orbit, according to the amazing KSP Subway Map.

With a known Δv requirement, figuring out how much fuel to bring is simple. With the 800s specific impulse of the LV-Ns, the minimum wet to dry mass ratio is:
So, the ships need to carry about 3/4 ton of fuel for every one ton of dry mass. Not too bad, since the same heavy lifter that carries up the packaged landers can carry up an equivalent mass of LV-N engine, fuel tank, and liquid fuel. Thus, each robotic lander requires two separate launches:

First, a heavy lift booster hauls the lander payload in its aero shell into orbit.
These are the unsung heroes of the mission, relentlessly hauling all the more exciting hardware into orbit.
Next, a second booster brings up a propulsion module, with LV-Ns and a lot of liquid fuel.
Just remember to check yo' staging...
The two meet in orbit and create a transport ship with a wet to dry mass ratio of about 1.775, for a Δv of about 4500m/s.

Rendezvous between an LR1 lander package and its propulsion module.
A total Δv of 4500m/s is cutting it a bit close, but they would only need a small amount of aerobraking or Tylo gravity assist to gain back a comfortable margin. There's also a good amount of RCS fuel on board that can be dumped (in a prograde or retrograde fashion) near the end of the trip if it's not needed. Additionally, the RS3 ships have a lot of fuel to spare if their propulsion modules can be swapped onto the more thirsty landers nearer to Laythe. The wet to dry mass ratio of the fleet as a whole has a comfortable margin.

Launch Window #1

The first Jool launch window happens around Day 190 in-game. (The simple and more complex online calculators both agree to within a few days).  Up to that point, I spent time refining the landers and practicing the landings on Kerbin. But once the designs were locked, the push began to assemble the fleet in orbit. 

The practical limit on fleet size is how many ships can be juggled during the actual launch window. In order to boost the wet to dry mass ratio, these ships have the two-engine version of the propulsion module, which gives them a somewhat low thrust to weight ratio. The ~2000m/s ejection burn had to be split into two parts: one into a 10-day elliptical orbit and a second to escape onto the final Jool transfer. Even still, the burns were 10 minutes each, so the ships had to be spaced out so they would reach their final periapsis burn at reasonable intervals.

Also, it would be nice if they didn't hit the Mun on their way in.
After the final burn, the transfer takes over two Kerbin years, meaning Kerbin will have been destroyed by the time the first ship even arrives at Jool. The lander designs can never be tweaked, and the crewed fleet will have to set out with no guarantee that there will be a base waiting. No pressure.

Lots of empty space to cross now.

661 Days Remain

With the first 18 ships on their way to Jool and then Laythe to set up base, the priority shifts to getting Kerbals off-planet. This means mass-producing and then filling the immense colony ships, which are the most intricate builds I have attempted in KSP yet.

More to come...

Monday, September 24, 2018

TinyCross: Electron Herding Unit

My ultralight electric crosskart kit has arrived:


By "kit" I mean the water jet-cut plates and the 80/20 extrusion. There's still some custom machining to do, but most of the kart is designed as plate-and-standoff structure, so it does feel a lot like a kit build. I want to start putting it together, but also realize I am way behind on the electrical side and should get some PCBs on order before I really dive in to the build.

Since it's 4WD with independent motors, I want two dual controllers, front and rear. One of my first three-phase controllers was a dual layout, using IXYS GWM100-01X1 three-phase bridge modules. These modules have excellent cooling, thanks to their huge isolated heat sink interface that can be mounted directly to the chassis (with thermal paste). And while the GWM100-01X1 is undersized for this project, the newer MTI200WX75GD looks spectacular. So let's begin.

3ph v2.2: MTI200WX75GD High-Power Upgra...crap.

They're not available. Despite being in stock for a while, they seem to have disappeared. I mean if you want, you can still get one, but the big distributors have stopped stocking them and the little distributors are pains in the ass. Some day they will return, and I'll be ready for that day, but until then I need some other way of herding electrons.

Can I Just Stuff Some FETs Somewhere?


Sometimes having an extra constraint, even if silly, is good for making progress on things. It makes optimization easier by removing degrees of freedom. So in this case my silly constraint is that any alternative MOSFET configuration must fit entirely within the footprint of the MTI, so they could be swapped without changing the board design. 

I played with some DirectFET and Power SO8 layout ideas before settling on just one monstrous FDMT80080DC per leg. They're similar in many ways to the MTI, with comparable resistance, gate charge, and current ratings. They also have top-side cooling that, although smaller in surface area and not isolated, could sink heat to the chassis fairly well. Using just one per leg yields a tight and tidy layout that fits within the 12mm span of the eight MTI pads allotted to each phase. I've also left solderable tracks for adding extra conductors if needed.

Extending this constraint further, I decided the 12mm strips should fit an entire phase: FETs, gate drive, local capacitance, current sense, and output.


Copy-paste six total for a dual controller. A header in the middle eats current/voltage sensor signals and spits back gate drive inputs. The gate drive is the same one I use on everything: anti-parallel optos with dead-time RC. It's low part-count, easy to bootstrap the high side, tri-stateable, and guarantees dead-time in hardware. And as far as the microcontroller knows, it's just driving some LEDs. What more could you ask for?

Cross Karts, Not Current

For current sense, the ACS781 offers an impressively tiny 100A (150A peak) surface-mount Hall effect current sensor. The current sensing range can be extended by diverting some of the current around the sensor. I've had issues with nearby large currents coupling into small Hall effect sensors before, so in this case I've taken extra care to keep non-sense currents flowing perpendicular to the sensitive axis of the ACS781:


The sensors are aligned so that their sensitive axis is along the board X axis (left to right). Except for the sense leg, all nearby current is routed along the board Y axis (top to bottom). This is especially important for the sense and bypass current flowing immediately adjacent to the next sensor over, since cross-coupling is harder to deal with than a slight change in sensitivity on a single phase. Similarly, phase wires exiting vertically (Z axis) should not produce much field in the sensitive direction. Hopefully.

The Rest of the Panel


I've done separate logic/power boards for a while, but this is my first controller designed as a multi-board panel. In this case I wanted the power board, logic board, and two motor sensor boards all in one. OSH Park has a four-layer prototyping service by the square inch (no panelizing penalty), and some of the most beautiful-looking boards I've ever gotten have come from them. They do quantity three for everything, which is perfect since it gives me two controllers and a spare.

The logic board sits on the gate drive / sensor interface, with a single STM32 running the show. It turned out a lot denser than I thought. While it's more common to do a full schematic first and then layout and route, I tend to make nicer boards if I route as I go, doing a few nets at a time and planning the placement and pinout with the routing in mind. And sometimes you just get lucky and find an open path on the layer you need.

It's All So Clean Until You Add Wires

Since the dual controllers are on the kart centerline and the motors are in the corners, I need to run about 700mm of motor phase and sensor signal wires together to each corner, and I know how that story usually ends. I'll use shielded cable for the signal wires and try to keep them separated as much as possible, but I have a new trick to try for making the Hall sensor signals more robust. For starters, they will run through a buffer on the sensor side, to decrease the impedance. (Normally, they are just open-drain with pull-up resistors.) The real trick is on the logic board side, though, where they will be sent through this:


The signals are fed into a three-channel optocoupler, which means noise would have to be able to inject mA-level current into the signal to change its state. But the input side of the optocoupler also references only the phase signals, not a local or even remote ground. Common-mode noise, even on the order of Volts, can't change the state. It's a sort-of three-phase differential signal.

The Big Picture


It's been interesting to revist the idea of a dual controller. I'm honestly not sure how my first one worked at all, although I think the robustness of the IXYS bricks and opto gate drive helped me out a lot there. This one feels a lot more routine, and I'll consider it a success if it just works without any fuss, like Twitch X's drive. Speaking of Twitch X, there's a really neat consequence of independent front-wheel drive that might make for some interesting software parallels down the road...

Back to the build for now.

Saturday, August 25, 2018

TinyCross: An Ultralight Electric Crosskart

It's time for a new go-kart!

I'm going for something a little bigger and more capable than tinyKart, but with the same ultralight genetics. This time, the inspiration is from something I didn't even know existed until recently, called a crosskart. The best way to understand the appeal of a crosskart is just to watch this video:


Now, there's no way an ultralight electric version will be as exciting as that, but if I can get to an end result that's about 33% crosskart, 33% downhill racer, and 33% electric scooter, I'll be more than satisfied. So, here's the concept:

TinyCross chassis and single corner module.
The design follows the water jet-cut plate and 80/20 construction that's been my go-to for rapid and adjustable construction. There are still a few machined parts, mostly turned shafts, but a large portion of the chassis can just be "printed" on a couple sheets of aluminum.

The 0.25in aluminum plate components to be cut.
Long-time readers may recognize that I've switched over to new CAD software. The days of free SolidWorks are over, so I'm using Fusion 360 now. Rather than arguing with people about the best ECAD/MCAD software, I tend to just try the different packages until I understand their fundamental strengths and weaknesses. I've got maybe 100 hours in Fusion 360 now and the biggest difference to SolidWorks I've noticed is the assembly constraint framework: SolidWorks "mates" are refined, purposeful, and user-friendly. The "Width Mate", for example, is sublime. Fusion 360 "joints" are raw and don't inherently guide you to the good practice of constraining your CAD the same way as your real assembly. But, they have a general flexibility that I find very powerful and time-saving.

As I've done more and more projects, I spend way more time in the CAD than actually building. This design has been almost a year in the works before I felt confident enough to order plates. I'm still not sure it'll turn into exactly what I want, but here are some of the details that I have been working on:

Drive Module x4

Drive block with motor and brakes.
The powertrain is entirely contained in a ~4kg block that is repeated in each of the four corners. It uses the same motors as tinyKart, Alien Power System 6374-170 outrunners, but with different gearing for the larger 12.5in scooter wheels. With four of them, I expect around 8-10kW peak output. I've carried over the offset bearing  belt tensioner that worked so well on tinyKart. The brakes are the same as well, but I managed to fit the caliper in the middle of the belt loop to keep everything in-line.

Suspension and Steering

Front suspension and steering geometry.
Suspension separates a crosskart from a go-kart in my mind. I wanted something that can handle speed bumps, potholes, gravel, dirt, snow, and other surfaces that would (and did) tear tinyKart apart. Now, I don't have any experience designing vehicle suspension, so I took a reasonable first guess on the geometry but left room for tweaking later. The shocks are mountain bike air shocks, which are both very light and easily adjustable. The total suspension travel is about 5in.

Because the suspension takes up so much space, I wound up moving the steering linkage to the very front of the kart to make more legroom. This turned out to be a major headache since the Ackermann geometry is backwards. I was able to get back to a reasonable geometry by using a slightly more complex linkage. Minimizing bump steer from suspension travel was also an interesting new challenge for me.

Chassis

Box chassis to add a little stiffness.
tinyKart's chassis was truly flat-packable, but as a result it twisted a lot. This actually worked in its favor somewhat, keeping all four wheels on the ground in lieu of suspension. But here, I was willing to go vertical and make a bit more of a box structure to keep the chassis stiff. Note that there are many stiffening spacers between the thinner bottom plates that I've left out of the model to keep the assembly smaller.

I still want to be able to separate the chassis into front an rear sections for transport with as few fasteners as possible. Removing the two side rails and then sliding the rear chassis out of the front chassis plate sandwich seems reasonable.

Electronics

I've settled on motors and batteries (12S/20Ah LiPo), but haven't started any of the controller work yet. I'd like to do an update version of the 3ph "Duo" v2.1 controller, one in front and one in back, but based on the newer IXYS MTI200WX75GD-SMD, which is a pretty awesome little part. I need to run the math though, since the original design was never meant for these power levels.

I'm also planning a simple board for the steering wheel, to host a display, trigger throttle, and some knobs or switches for quick setup. Not sure how far I will dive into independent torque control, but I do plan to link everything together with CAN to leave that possibility open.

Power/Weight Budget

I'm shooting for about 34kg / 75lb for the kart without batteries. With the full 12S/20Ah it will be about 40kg / 88lbs. This is about 50% heavier than tinyKart, but still light enough to manipulate up onto a table to work on, or into a vehicle for transport. Plus, most of the weight of a go-kart is the rider, so with double the power it should have plenty of acceleration to spare.

Parts should be coming in this week so next post will have some real pictures!