-
Speed Control
04/27/2017 at 05:46 • 0 comments“I believe it’s jogging or yogging. it might be a soft j…apparently you just run for an extended period of time. It’s supposed to be wild.”
Keep Moving
Most runners, once they get going, are loathe to stop. It's either a good situation where they're feeling good and loving every minute, or the sober realization that starting again would be more painful than just continuing to grind.
Further, with all due respect to Jeff Galloway, every race or group run I've been involved in has featured runners at a consistent pace. Many even push the uphills and coast the downhills. Relentless Forward Progression.
To satisfy our design criterion that the project make going running easier, we need to respect the patterns inherent to how people exercise. For us, that means a P.I.D. controller.
011100000110100101100100
The digital world is often hilariously exact, but in a way that is completely oblivious to intention. In many programming languages, 3 + 0.6 = 3.5999999046, because the computer is dutifully reporting how many slices of a number are closest to 0.6, not actually interpreting the question as a human would.
For speed control, this can be an issue. If we tell the stroller to go 13kph, it's straightforward to calculate motor RPM based on gear reduction and drive wheel circumference. A transfer function can then be determined to define "effort" (in the current case, a pulse-width corresponding to throttle input).
But what happens when, as happened this evening on a test run, a gust of wind blows head on? The effort level will now correspond to a lower wheel RPM than anticipated by our transfer function, and the whole rig slow down. The opposite situation will happen barrelling down a hill; it's best not to apply any effort there.
We could try to model these things, but ultimately one comes to the conclusion that the real world just isn't predictable. Enter the PID algorithm. PID adjusts the "effort level" based on how far off we are from where we want to be. It checks three times in three different ways, and adds all the results together to determine what our next effort level should be. Currently, we check every 100ms.
- Proportion just adds a percentage of how far we are off. If we want 1500RPM, but are at 1000 RPM, our error is 500 and proportion will add P * 500 to the output
- Integral looks at how fast the error is changing, and adds a slice of that. If our last error was 500, and our current error is *still* 500 even after applying the last proportion, integral will now respond with a slice of (500+500=1000).
- Derivative acts a damper to oscillation and is usually negative. It looks at the speed at which the actual RPM changes and dampens it if it moves too quickly. If we make a change which is responded to very quickly, the next PID output will be much smaller under the assumption we're nearing the target.
Hardware
For the first iteration to empirically test power needs I'm using an off-the-shelf airplane ESC, a Castle Creations Edge 100. This accepts, every 20ms, a 1200µs to 1900µs pulse communicating throttle. This PWM signal is generated by an ATXMega32A4U development board I made a few years ago.
The ESC delivers the motor RPM using a square wave out of its auxiliary wire. This is fed into the XMega on PORTD.0 and a timer counts the edge changes. From here we can calculate motor RPM (and thus wheel RPM).
Input
The Runner Interface is experimental at this point.
Pros Cons Potentiometer - Infinitely Adjustable
- Easy implementation with a lever
- Intuitive
- Immediate stop possible- Noisy Reading
- Difficult to set exactly
- Easy to accidentally change
- May react to bumps in the road
- Wastes a small amount of current
- Open loop is prone to accidental startsButtons - Easy to locate while bouncing
- Treadmills have nearly standardized for a reason
- Easy to program
- Robust- Difficult to place physically in a professional manner
- Difficult to instantly communicate intent (encourages repeated presses to arrive at final value)
- As a consequence of the above, additional buttons are needed for instantaneous intents, such as pausing or interval running.Initial testing has shown that a boat-style throttle lever on a potentiometer is inappropriate for running. Besides noise mitigation and erroneous readings causing false starts, it's just too hard to change while moving.
As I have kits in mind, one unwritten requirement is that we modify the commercial stroller as little as possible. Button controls can be added by essentially clamping a bent Twinkie to the handlebars.
the curve keeps the controls near the brake lever, and the positioning allows the left thumb to increase or decrease speed. I've noticed most people prefer to run to the side of the stroller to remain closer to it without shortening their stride, and it's only safe to run on the opposing (left, here) side of the road. Personally I'd rather have my child closer to the curb than sacrifice him as car buffer, so that puts me to the right of the stroller steering and pushing with my left hand.
Next Iteration
Given the initial success of these tests, the next steps will be developing a concise display showing set speed, battery level and distance traveled. Removing the middle man and developing my own BLDC inverter is also being planned. This will enable much tighter PID integration, much more intelligent braking, and to a (unfortunately very) small degree regenerative braking.
-
Which 18650 Cells?
04/26/2017 at 22:02 • 0 commentsThe battery choosing script is now on GitHub. It goes through a popular website's listing of battery cells and tries to build the best pack it can given minimum parameters and quantity price breaks. The cheapest cell will not always make the least expensive pack.
I'd love to make this into a fully parametric web application some day.
-
Shaping Power and Applying it
04/26/2017 at 04:58 • 0 commentsPower Considerations
Because each LiPo cell has a nominal voltage of 3.7 volts, to achieve our 35 watts of power we would need to discharge at (35/3.7 = ~9.5 amps) continuously. During start up, against wind, or up a hill the required power will be much higher. In fact, for a motor rated at 1500 watts max we would be drawing 400 amps! At these currents even the wires that deliver power to the motor start to look like resistors.
Because of these losses, it turns out that motors (and a lot of things) are generally more efficient at higher voltages and lower currents. This is a big part of why power line transmission is done at such high voltages when your phone only really wants a little over 4 volts to charge.
It can be extremely difficult to balance the wide variety of cells available against cost. So I wrote a quick script to scrape a website's catalogue and make suggestions for me. It did a better job than I did initially, and so for this project we'll start with a 6-series (6s) battery pack. This will range based on its wear level and state-of-charge from between (3.7*6)= 22.2 volts and (4.2*6)= 25.2 volts. At our average 35 W, we will be near 1.5 amps discharge. This lower discharge rate has the added benefit of helping the cells age much better.
Motor Selection
Brushless DC motors are usually given a rating called Kv. This can be read as their "voltage konstant" and specifies, generally, how many RPM a motor needs to turn to generate 1 volt. It's usually interpreted the opposite of that, though: how many RPM a motor will turn per volt of potential. This can be confusing at first— doesn't the frequency generated by the controller determine the rotation speed? Well, yes, but only by controlling how "hard" it throws the rotor forward to the next pole; a motor will never spin faster than its Kv rating.
So how fast do we want to spin? Earlier we specified that we need to move at a 4:30/km pace. The test stroller has 20" wheels with a circumference of approximately 1.6 meters. That means it needs to spin 625 times per kilometre over those four-and-a-half minutes. 625/4.5 = ~138 RPM. If we want to do tempo runs at a 20min 5k pace, it's closer to 158 RPM.
The aircraft hobby scene has developed a ton over the years, and good compact brushless motors are available relatively inexpensively. However, with a 20" pneumatic drive tire nothing will have the torque required to start from a stop without some gearing. This is actually great, though, because the most powerful motors have a low Kv rating. At ~23 volts we will need a rating less than (23 * 138) = ~3200. 23:1 gearing would be challenging as well.
Power Application
Now might be a good time to think about how a spinning motor can effect a spinning wheel. There are a few specific aspects to this and they're mostly related to one fact: running strollers do not have a swivel wheel. Steering is performed as seldom as possible, and made possible by an intention location of centre of gravity near the rear axle. This prevents mishaps where a swivel wheel meets unpredictable ground, self-turns, and the stroller self-topples. Kids can present certain attitude-oriented challenges while running, but violence is never the answer.
Taking this idea further it becomes clear that driving one of the rear wheels will cause yaw-slip and make straight travel a challenge. Counter-acting this by driving both wheels may be feasible, but separate driving wheels doubles costs and seems inappropriate for an application that primarily will go straight. Using one motor (and thus locking both wheels to the same speed) will either prevent turning entirely or require the fabrication of a limited-slip differential. For a stroller.
Driving the front wheel, however, will have the added benefit of allowing the parent to lift the powered wheel off the ground if an immediate stop is required. Generally, as a rule, I strive to put as few bugs as possible into my code, but when children and cars are potentially involved a safe mode of failure is required.
Gearing
The most forgiving, low-cost, and light-weight method of power transmission for this application is probably a toothed belt. This also allows us to arbitrarily vary the wheel RPM making for a wider range of acceptable motors. So what RPM will the motor be at, typically? Well, for larger motors a typical Kv specification is ~250 (RPM/V) +/- 75. Given our 6S battery pack we will typically be running at ~23 volts. The top rotational speed of our theoretical motor would be (250 Kv * 23 V) = 5750 RPM. Recall that wheel RPM at our specified pace of 4:30/km is 138RPM. This is a 41.6:1 reduction! The smallest pulleys listed on SDP/SI with a 3mm pitch have 14 teeth. This would necessitate a 582-tooth wheel pulley, which, at a 3mm pitch, would be 556mm in diameter (a couple inches short of 1ft).
I don't know where to buy a pulley that large, and my 3D printer can reasonably do 190mm at most, so the top speed might end up being a tad faster. Colin Furze: we're coming for you.
3D printing a pulley is appealing. All that's needed is a means of attaching it to the wheel. Most running strollers use a spoked wheel like a bicycle, and at our power levels transmitting power through the spokes will likely be acceptable. If we use a little trigonometry to determine the angle of the spoke relative to the axle, bolts with a slot down them lengthwise allow a robust attachment to the wheel.
As mentioned, the bed of my 3D printer is, practically speaking, 190mm square. A 195-tooth HTD3 pulley has an outsize diameter of 185mm, which is perfect for fit. Coupled with the 14-tooth drive pulley that gives us a ratio of 13.92:1.
- At 138 wheel RPM, our 4:30/km pace, the motor will spin 1922 RPM. This is somewhat low in terms of motor efficiency, but we should have motor commutations quickly enough to satisfy the speed controller.
- With an 80% efficiency on a 6S battery pack, 4600 motor RPM = 330 wheel RPM, or 8.8m/s = 31km/h top speed. Excessive, but technically this satisfies our requirement, which is the best kind of satisfaction.
Cost is a significant factor in this project. While there are several motors that would fit our requirements, the Propdrive V2 50-60 is $53, ships from the U.S., and claims a maximum power capability of 2400 watts. Good luck getting a data sheet, but this should enable us to 1) start, and 2) climb hills, of which Phoenix has several formidable examples.
-
Keep On Rolling
04/26/2017 at 01:21 • 0 commentsLongevity
The major consideration for a project like this is how to get it to move and how to make sure it keeps moving. Anyone who runs these distances knows the effort level involved, although a modern electric motor should be somewhat more efficient.
Our specifications imply that we should be able to travel a little over 13km (or 8mi) over an hour. Now it's fairly difficult to estimate what kind of power any particular stroller / kid / juicebox cache combination will require, especially when you factor in wind. A cycling-specific power calculator estimates the power required for the least-efficient bike with a 4ft tall, 60lb rider at 8.3mph (our 4:30/km pace) at 26 watts. Given that the calculator seems to rely on drag coefficient (and a stroller is typically less streamlined than a bike), it's likely that this estimate is somewhat on the low side. Most electric bicycles (albeit for adults) are rated at least 250 watts. For the sake of initial calculations, let's assume an average power of 35 watts with the expectation that power requirements may be somewhat higher once we can actually conduct empirical testing.
Battery
Now that we have an idea of what kind of power is required we can work on motor selection and battery design. Since we're concerned with efficiency here, a brushless (BLDC) motor is a good choice. Motors respond to power, and power (here) is comprised of volts * amps. So first let's choose a good voltage.
First we should pick something that's readily available. There are lots of types of batteries, from your reliable potato-flavoured science fair project to massive lead-acid or compact lithium-ion chemistries. Which one we pick will dictate convenient voltage levels.
- Potato battery would require an additional trailer, although is potentially delicious
- Lead acid has an excellent discharge rate, but is heavy, and has poor longevity
- Lithium Ion and related chemistries are compact, last a long time, and are not much more expensive than lead-acid.
Lithium Ion batteries are also the most configurable in terms of voltage, discharge rate, and capacity. For this project we'll use 18650 cells. In a future post I'll go over the implications of choosing this battery type and how we'll move from there.
-
Design Considerations
04/26/2017 at 00:46 • 0 commentsWhat are we trying to do here?
When designing anything, the first step is always to define the problem. For us crazies who love running, this means we want to be able to run even though we have kid(s) to watch and even though they're heavy, or it's windy, or today was supposed to be a recovery day, or training plans don't happen to mention "tempo pace as a family."
But we could technically satisfy that problem by taking the kids to the park and running around a tiny loop within line-of-site, or any other number of creative but less-than-realistic ideas. So let's put some numbers on it. Each of these will get a discussion in a future post.
We need to be able to:
- carry at least 60 lbs (an average four-year-old is approximately 38 lbs).
- maintain at least a 4:30/km pace (7:12/mi).
- go for at least an hour.
- start from a dead stop.
- safely and gracefully self-disable if the situation requires it.
- make going running easier. Running can still be hard, but the act of going out shouldn't be a logistical hazard.
So there we have it; let's solve that problem.