More Upgrades Pre-SEMA Convention in Las Vegas

I updated a few other things, as well. The throttle stuff is easy because it's simply software changes. This new stuff is woodworking and whatnot. Check it out!

The control panel was too far away from the pilot and too high, so I cut the posts and created new mounting brackets out of the pieces of the IKEA chair I'd cut from the bottom of the legs. It's like recycling, kinda. Anyway, this design looks nicer. I'll be painting the wood black this weekend so everything looks more uniform. I'll also be plugging the countersink holes for the screws you see in that photo.

The next upgrade was in the drive electronics and general wiring in the chassis:

The bare-chassis high-amp automotive relays I used originally were welding their contacts closed sometimes. I dumped those in favor of a solid industrial-strength 24-volt contactor. Basically a relay on steroids with a ultra-beefy solenoid inside. Locks on, locks off. Kinda loud when it clicks open or closed, but at least it's robust and can carry current. And, technically, cost as much as two of the bare copper relays in parallel.

I also moved the motor controller down into the chassis out of harm's way and put it on a simple aluminum mount I made with simple bending and drilling. Since the controller is the most expensive part on the chassis (not including the control panel, of course), I wanted it tucked away nicely.

I rebuilt the wiring harness (using that term loosely, of course) so all that heavy-gauge wire is out of the way of the chair and it connects to everything cleanly. I rebuilt the low power wires to ALL have connectors and routed them more cleanly around the chassis under the chair.

Next, I'll be working on the lighting system on the chassis, which includes the headlights, turn signals, brake light, reverse light, Wunderglow™ under-chassis glowy stuff and the circuit to run it all. Should also start seeing more functionality in the control panel, since the lighting depends on that working.

Starting tomorrow, I have four days straight of tinker time for this thing. My goal is to get the control panel mostly going, including sounds.

More Throttle Tweaking in Firmware

For anyone who's driven the Office Chairiot Mark II, you know that the throttle response was a bit nutty. The throttle control firmware was translating stick input to motor commands using a weird (but cool and efficient) bezier curve thing. Problem with that was that the stick-to-motor commands were instantaneous making the response jerky (maybe dangerous).

I wrote a replacement C++ class to handle transitioning the throttle smoothly over time to the latest stick inputs. This smoothed out the response immensely. The drawback was that it also slowed the transition from higher speed down to slower speeds. That was dumb. I almost drove the thing off a stairwell and our CTO almost drove it into a wall. Seems it's not intuitive to plan ahead for slow throttle back. Oops.

Here's video of the indoor test drive on Tuesday, October 14, 2014 at meltmedia in Tempe:

Today was the first real trial run of the Office Chairiot Mark II with its new throttle control firmware and it went swimmingly! Only two of the planned four modes were active: Kiddie and Advanced. Kiddie slows the transition of the throttle commands down, so if you gun the throttle, it takes its time getting to the power you input to the stick. The Advanced mode takes half the time to advance the power to what you input. Overall, it went well. However, I missed one little feature that I'll be adding tonight: When the driver let's off the throttle, the program needs to let the motors drift by not sending a command. This has two benefits: 1) The motor controller actually recharges the batteries a tiny but when the motors coast (because they become generators at that point), and 2) the Chairiot was taking its sweet old time slowing down, which meant I almost drove it down a flight of stairs and our CTO almost drove it into a wall. Seems like a bug.

Here's another angle of some high-speed passes by the camera:

This was the first official in-office speed test of the Office Chairiot Mark II with the new time-based throttle control firmware. The "Advanced" throttle setting was great, but still needed some tweaks. The "Kiddie" mode setting was just plain dumb: It slowed over time which meant the driver had to anticipate when the thing would come to a stop.

So, patched the throttle control class to gradually increase speed, but to more quickly drop it. Will be testing that concept today. I'll post results tonight or tomorrow.

Suggestion: Mid-Drive Powered Wheels, Six Total

This is a message from the Local Motors Projects website from @SpeKterDesn (Gavin):

Fun piece of work Andy!

As a person about a pinch away from needing a motorised bottom half at times can I make one suggestion even just for a fun chair in the office?
I didnt see it written anywhere above and you may have considered it but not wrote it down yet, but in terms of footprint (and helps put it on any chair), mobility (fun) and turning circle (important in offices) have you considered moving the driving wheels to the middle of the sides of your platform and having balancing castors front and rear so you end up with 6 points of contact with the ground as well, you can even add suspension for uneven floors and surfaces.
Just a small suggestion on the drivetrain that I think may make all the difference to the implementation of your product. I hope its feedback well received and like I said you may have had that trick up your sleeve already just hadn't seen it mentioned before.   ;)

Cheers

Gavin

Hey Gavin, thanks!

Yes, that particular idea was an early one. There is a prototype platform of that idea in the garage. It was only a little bit more rectangular than square, as in it had a short wheelbase. I didn't ever get around to adding suspension beyond quick-fix foam rubber layers between the platform and the casters. It was a bit bouncy and not nearly as stable as what I have at the moment, but again, it was a rush job.

When I get new video up of this current revision, you'll be able to see that this can turn in a perfect circle in-place. It's about 30" stem to stern and is exactly as wide as that silly Ikea Poang chair. Aside from a smaller-than-average closet door, it fits most doorways, especially those in offices.

I figured that design might be a plausible option later when I can actually weld a proper and more robust chassis from metal parts, not plywood and 2x4s. ;) I also think that it would stabilize with some sort of small shock absorption system, like the rear frame shocks from mountain bikes. It needed play for getting over bumps but also needed occasional stiffness.

The other drawback to increasing feet-on-the-ground, as it were, is the added complexity: More parts. One goal I had in mind for the serious side of this thing (there are equal parts comedy in this chair, of course) was to make it as inexpensive as possible by creating a BOM from off-the-shelf hardware and parts and to keep that BOM as short as possible.

The fix for clearing more rugged doorway thresholds, curbs and poorly maintained parking lots is the greater ground clearance and the pneumatic scooter tires. This thing navigates over the worst of doorway transitions and nasty sidewalks quite well and even at higher speeds (not smart, necessarily, but great for your daily adrenaline fix).

Either way, though, thank you so much for contributing ideas! The chassis will be the first thing to get love at LM Labs, methinks. Input from people like you will help immensely!

Andy

A Throttle Tuning Update

A tiny update on the throttle stuff... It works. WOOT!

It's very optimized compared to my original plan. Each of the three available throttle control curves has only 4 control points in a 2D Bézier curve. When you switch the configuration to a different curve, the microcontroller dynamically generates a new map of 256 points for joystick axis value to motor command value. That's it. Works great (up on the sawhorses, anyway)!

The original plan above caused the ATmega256 to crash and restart because the poor thing only has 8K of SRAM. The tables of coordinates coming out of the Bézier curve function were 2,048 bytes each and I was (stupidly) building TWO curves (maps) for each skill level curve (one curve each for motor/joystick-axis combo). 25% of memory used up on silly lookup tables was glaringly inefficient.

Since the resolution of the motor commands is only 128 steps, I really didn't need to hang onto a value for every potentiometer step (1024). Now I just generate the 256 points (kinda like how the Nyquist frequency in sampling audio). That appears to produce the smoothest response from the motors. It's glorious (in a nerdy way)!

I'm going to fire up the soldering iron and build a quick cable assembly for the controls to the drive computer. I need to mount all this junk onto the chair temporarily to do a test drive. I'll probably bring it over to LM in the "mostly it works" state. I'll worry about the other non-essential features later.

A Better Throttle Control for an IKEA Chair

Took a cool approach on the throttle control response curves. 

There are three throttle-to-motor control curves: Advanced, Regular and Kiddie. I expect the Advanced curve will be the most popular among test drivers at LM. There is also a configuration that completely ignores curves altogether, but there's nothing cool about that aside from the adrenaline factor.

All three curves aim to make the center area of the joystick smooshy so that inadvertent bumps to it and people with less-than-precise hand movements can control the chair easily, especially at low speeds.

The motor controller I'm using (Dimension Engineering Sabertooth 2x60) can work in a number of modes, but I'm using it in a simple serial mode. You can command each motor individually with a single byte. Motor 1 is idle when you send a value of 64. 127 is full forward and 1 is full reverse. Motor 2 is idle at 192. 255 is full forward and 128 is full reverse. A 0 (zero) will cut power to both motors simultaneously.

In initial driving tests (Vimeo: Very first test drive of Office Chairiot Mk II in garage.), I used the controller in the plain old analog mode, where the potentiometers in the joystick were directly connected to the inputs on the controller. The controller was then configured to use its own internal smoothing and control curves for input smoothing. That worked amazingly well, but I wanted a little more control over the throttle response (safety being one concern), which is why I run the command of the motors through the Office Chairiot Mark II Run-Time Operating System (OCMkII RTOS). (I'm being silly, but it really is a custom-built, run-loop kinda RTOS-ish thing running the show.)

I designed the curves in Adobe Illustrator. The graph for the curves had all of the possible analog values of the joystick potentiometers on the X axis (0 to 1023) and the motor command values on the Y axis (1 to 127 for motor 1 and 128 to 255 for motor 2). I output the graphs for the Regular, Advanced and Kiddie curves to PNG, imported them into a kind of reverse graph plot program and extracted 32 data points along the curves. I then ran those points through a Bézier curve routine to get a smooth run of motor command values from full reverse to full forward. I found a great Bézier curve snippet written in C#, which I don't do, so I translated it into straight C. It outputs a full range of motor command values for every analog stick value from 0 to 1023. That way I can store precomputed values for any stick position, saving the little AVR microcontroller a ton of cycles that would have been required to computed those values on the fly.

If you're following along at home, you realize that each curve will occupy 1,024 bytes of memory. That's precious space on a microcontroller, especially one with only 256K AND a big-arse semi-OS running on it controlling very large number of subsystems.

I only need the curve data on-demand (once) when the throttle curve is set on the control panel. Retrieving that from an SD card would be fairly quick and painless. Not too tough to do. But, I figured out a better way: Store only enough data points for each curve so that the Bézier routine can fill in the blanks on-the-fly. This would only require a few bytes for each curve and the curve computation goes pretty quickly (about the same as pulling it from an external storage medium). Bob's your uncle.

The Advanced curve gives the driver complete range of speed commands to the motors. But the curve becomes a straight climb to the max values more slowly from the center position. At about ⅓ throttle, the curve starts on a more direct path toward the maximums (for motor 1, the command for full forward is 127; the full reverse command is 1).

The Regular control curve keeps the center of the stick mooshy, but it only allows the Office Chairiot Mk II to go a maximum of ~50% throttle forward or backward. It's a safe and reasonable way to get across a parking lot for those people who might not be retired skydivers or stunt people.

Finally, the Kiddie curve only lets the vehicle go to about 25% throttle in either direction. Why? Because you know at some point someone is going to ask if their kid can drive it. What do you suppose would (could) happen if a 10-year-old got into a motorized office chair that was capable of doing 20+ MPH? I don't have a waiver for that, yet.

All that being said up there, this thing is nearly ready to drive. I'm updating the throttle code on the Arduino tonight/tomorrow morning and hopefully it will be drivable this weekend. After everyone is back from the conference, it should be ready to pilot around the grounds at LM!