Showing posts with label singapore. Show all posts
Showing posts with label singapore. Show all posts

Sunday, October 9, 2011

Singapore Post

I was in Singapore again last week for the Singapore University of Technology and Design's first ever Open House.


When I went to Singapore last year, SUTD had just the two upper floors of a Chinese language school, mostly for administrative offices. Now, it has fully moved in to the interim campus, part of the ITE Dover Campus. We built up a small workshop ("the shed" or Gecko Works) at the interim interim campus, which has now been transplanted to a room at the interim campus:


It was cool to see the shop space I helped put together actually being used by future SUTD students and faculty to work on projects. I was expecting the interim campus to have a full shop, since it was formerly part of a technical institute, but it seems Gecko Works is still the primary fabrication space for SUTD. That makes our trip last year seem like a pretty good investment of time, actually.

As you can see in the above picture, Charles and I significantly increased the number of moving vehicles on campus, as usual. But in fact, some of the future SUTD students have been forming an Electric Vehicle Team of their own, using an electric bike we got from MKP Bikes last year as their first vehicle. It's been converted to a chopper bike, and now runs on a frightening amount of lithium polymer battery. You can see it towing half of the SUTD student population here:



Also featured in the video above are a fire ant-motivated top speed test of Pneu Scooter and Charles taking RazEr Revolution's name literally.

Pneu Scooter's officially-measured fire ant-induced top speed: 21mph.
Pneu Scooter actually took its very first test drive in Singapore last year. I finished building the frame and began testing on my 3ph v3.x line of controllers during my last trip. Unfortunately, the v3.0 controller had serious electrical noise issues, so I redesigned it when I got back and wound up with the v3.1, which has been ultra-reliable for almost a year now...

...and then two of them broke on this trip. I don't really know what happened since both times it was being ridden by someone other than myself. (Not that I would know what exactly caused the failure if I was riding it, but I could at least eliminate some possible causes.) My theories are:
  1. The ambient temperature in Singapore is just that much higher than it is in Boston, and the FETs failed due to thermal overload after basically racing it around all day.
  2. Since replacing the rear wheel a few weeks ago, the motor timing had shifted enough to cause commutation failure, leading to a destructive current spike.
I would weight theory #2 a bit more heavily since both controllers (the original and the spare) had the same phase fail. In any case, having burned through even my spare controller and having neglected to pack an extra IXYS module, I went back to MKP Bikes for Plan B: an off-the-shelf e-bike controller similar to the one I used in Singapore last time when my controller also failed. With that, I was able to get through the Open House. When I got back to Cambridge, I promptly changed the FETs on my controller:

Precision MOSFET removal tool.
All the gate drive was in working order, which is unusual after a FET failure. I re-timed the motor and have been riding it around with no issues, so I still have no idea what the problem was. I am going to pretend that nothing ever happened. But I did buy all the GWM100 IXYS modules remaining on the internet.

Scootering around at the Open House was not the only thing I did in Singapore for a week. Earlier, we visited a place called evHUB, which is a Singapore-based electric vehicle conversion and R&D house. They  have a somewhat hidden EV showroom/dealership with the name FSG Mobility Concepts, where I continued my trend of finding Tesla Roadsters scattered around outside the US.


In addition to the Tesla, FSG also carries the YikeBike. Rather than dedicate a paragraph of this post to describing the YikeBike, I'll just put in a video of us attempting to ride it:


I think the evHUB crew had an easier time learning how to handle Pneu Scooter than I had learning how to ride the YikeBike. Also the YikeBike is more expensive than Pneu Scooter by about the same ratio as the Tesla Roadster is to the YikeBike. So I'll stick with the kick scooters for now.

I also brought over 4pcb, my mini PCB quadrotor. It still doesn't fly spectacularly, but I wanted to bring it because I was meeting up with Ali S. to see his somewhat larger quadrotor in action...

Recursive quadrotors...
The exhibition hall actually turned out to be a perfectly reasonable place to fly a mini quadrotor and a perfectly suicidal place to test the one with 10" blades. For that reason, the mini one got a bit more air time. Here it is taking a few short hops:


It still needs work. After returning, I replaced the one weak motor and it at least hovers level now. But at some point in the near future I will replace the IMU with a different board. Not because I think it will necessarily handle the vibrations better, but because I am just sick of dealing with this one. And because Sparkfun doesn't make this one anymore.

I also got to visit most of my favorite Singaporean hobby shops and industrial centers. (I am such a bad tourist...) So overall, another successful trip to Singapore. I don't know how frequently I'll be going back, but I'm sort-of used to the climate and I seem to have a system for dealing with jet-lag. (I just sleep for the entire 25-hour set of flights.) Soon, there will be actual students and classes at SUTD, so maybe I'll go for an entire semester next year.

Because clearly this is my type of university.
For now, though, I have resolved to stop doing anything resembling a demo/expo/faire/whathaveyou for at least a few months. For one, I'm tired of answering misinformed technical questions from the slightly-more-tech-savvy-than-general public. I might just sound cranky but there's only so many times you can explain that MEMS rate sensors are not the same as flywheel gyroscopes without going crazy. Secondly, I am tired of having my vehicles turned into amusement park rides and then having to repair them after every event. And most importantly, I don't actually get any work done on new projects when I'm constantly exhibiting old ones. It's fun, but I need a break, so no more demos until at least IAP.

Now, what was I working on?...

Friday, November 12, 2010

Singapore Wrap-Up, Pneu Scooter v1.-1 Test Drive

Wow, somehow an entire month has passed since I started my SUTD visit. Singapore, while incredibly hot and humid every day, is actually a very nice country to stay in for an extended period of time. The food is inexpensive and good, the traffic is light, public transportation is clean and effective, and there are plenty of places to find stuff.

...stuff which inevitably winds up at Gecko Works.

If I am allowed one complaint (besides the one that everyone will have, which is the incessant humidity), I would say I strongly dislike the nature of retail. Namely, shuffling sideways through crowds in the impossibly narrow aisles of a tiny shop trying to find something, and then having to ask how much everything costs (pretty much giving away that I am a foreigner with no likely sense of a fair price). The concept that you can tell me whatever price you want to tell me, and then tell the next person that comes in something completely different, is not appealing at all.

Anyway, my flight out is in eight hours and I'll be returning to Cambridge, MA, where it is the same temperature in F as it is here in C. That means very little in the way of outdoor scooter testing is going to occur for the next few months, so I had to get at least one test ride in while I'm here! There's just one tiny problem - you know, the one that is basically the feeder for 90% of my blog posts - the one that is never really solved: Motor Controller Issues.

I'll get back to those, but as I remind myself that Pneu Scooter is more than just a vehicle for testing one particular controller, I feel obligated to put more emphasis on its completion, minus one custom part. So I will designate this the build summary and maiden voyage of Pneu Scooter Version 1.-1:


The principle new technology for me in this project was a new flavor of custom-made miniature hub motor built into the side of a pneumatic wheel, which will provide a much more cushy ride than the 80A urethane bricks on BWD or even a normal Razor scooter wheel. The trick is avoiding the valve stem, since miniature hub motors need every millimeter of radius they can get to produce sufficient torque. The solution here, which comes with the added benefit of minimal wheel modification, is to simply offset the hub motor onto the side opposite the valve stem.

Like so.

Ok, so it's not as elegant and compact as the ultra-miniature hub motor from RazEr, but it's easy to make and the ride is wonderful. And it uses up the leftover custom stator laminations laser-cut by Proto Laminations for BWD. And, I got to try out a new technique that I've been ranting about for a while: making the can out of stacked waterjet-cut plates with magnet-aligning grooves. I classify that as a total win, especially for thin-profile motors where only a few plates are necessary.

I also got a chance to cancel some of the bad juju of BWD's handlebar mount with a much beefier front-end solution:

In total I used about 6" of my 20' of aluminum.

Here's the fully-assembled vehicle right out front of Gecko Works:


I like the simple, square look and the fact that it is stealthy enough to pass for a regular Razor scoo-wait what the fuck is that lump on the back of the deck?

Laaaaaaaaaaame.

Yes, it's one of those cheesy electric bike controllers that I found in plastic bags at the e-bike store. Yes, it's lame and noisy. (You can hear it buzzing away in the video, occasionally drowned out by the crane-mounted jackhammer that's been demolishing half of Singapore for the last week or so.) Yes, it totally ruins the stealthy look of the scooter. Yes, I should be capable of producing a working brushless motor controller by now. Yes, I am a failure.

Actually, I did manage to do a lot of independent troubleshooting by moving the 3ph HD controller over to an electric bike. Decoupling the electrical and mechanical tasks was a good idea, since it allowed me to finish the scooter mechanicals while simultaneously testing the controller on a known-to-be-functional vehicle. What I discovered were two (possibly related) problems that I need to solve:
  1. The current sensors readings are garbage. The DC sensor reading is clean, but totally incorrect. The two phase current sensors are just noise. Well, not just noise, but I'll get to that. Since I rely on the current sensors for field-oriented control, this is generally bad.
  2. The microcontroller will occasionally jump out of valid code and/or lock up, forcing a watchdog timer reset. This results in a momentary loss of torque. It's definitely load-dependent, meaning it could very well be caused by some kind of induced noise from the power side. (As a side note, I found a great reference in ST Application Note AN1015 on how to make EMC-robust software.)
One thing we don't have at Gecko Works is an oscilloscope. So, getting a clean picture of the current sensor signals noise was not an option. But, I generally suspected PWM-induced noise, and after taking a look at the sensor data, I remembered a trick I learned from this Prof in 2.671, the only undergraduate class with notes that, time and time again, I actually find myself going back to use. The clue was that the sensor data, with the wheel locked so that all current should be DC, still appeared to be periodic:


It looks as though the current is oscillating at exactly 5Hz. However, nothing at all in the system is happening at 5Hz, so this doesn't make sense. And random white noise would not show up as neatly periodic. The trick is that it's actually aliasing of a higher frequency noise source, namely the PWM. I was 99% sure of this because of the details: The data is transmitted at a frequency of 20Hz. Nyquist says that the highest frequency you can record at 20Hz is 10Hz. 20Hz will look like 0Hz (this make sense). 11Hz will look like 9Hz (this requires a bit more thought). 15Hz will look like 5Hz. In fact, (10n+5)Hz for any integer n will look like 5Hz. The PWM frequency is 15,625Hz. Since the PWM and the data transmission are created from the same clock source, it makes total sense that the PWM noise appears as an aliased signal in the current sensors.

The extra 1% of certainty: By changing the PWM frequency to 15,564Hz I can test this theory. Sure enough:


It's a little harder to see, since 4 doesn't go evenly into 10, but the period is now 4Hz, which is what 15,564Hz should fold down to, given a 20Hz sample rate. Case closed, it's PWM noise. Who needs an oscilloscope?!

After spending about 10 seconds looking at the board schematic and layout, I realized why my current sensor signals are mostly noise. I included an RC filter at the output of each sensor, but with R=10kΩ and C=1.5nF, it ain't filtering 16kHz. I honestly have no idea why I chose 1.5nF...it very well could have been a typo. The other, possibly larger problem (since the motor's own inductance should filter the current a great deal more than is reflected in the data) is where I put the capacitors. In power circuits, where you put things is probably even more important than what you put. In this case, I put the capacitors near to the current sensors, leaving a long stretch of high-impedance trace antenna going right under the MOSFETs:


I'll have to fix this in a later board revision. For now, adding (properly sized) capacitors right at the STM32 breakout pins seems to do the trick. A 10nF at the pin reading the Phase C current sensor revealed a beautiful and accurate current signal behind all that noise:


So for now, I should be able to solder some capacitor sculptures onto this board to make it work. That may not be the end of the troubleshooting, but at least it will be one large part taken care of. It'll be much easier to proceed when I can trust the sensor data. 

Ah, more electrical troubleshooting. Something to look forward to when I get back... :-/

Saturday, November 6, 2010

Gecko Works, Stuff@SG, Pneu Scooter MechE

I'm just about at week 3.14 of my visit to SUTD, where one of my tasks is to help set up an interim interim workshop. The interim campus, with its Pappalardo Lab-sized fabrication facility, won't be open until April. In the mean time, we are in a workshop known as "the shed". No, seriously. Since "the shed" is not a very inspiring workshop name, we've renamed it Gecko Works. (Because the surrounding area has an abundance of geckos. And not the friendly type that try to sell you car insurance. More like the type that jump out of the toilet when you flush it.)

As of last post, Gecko Works was pretty empty. Since then, workbenches and about half of the tools have arrived. A virtual Gecko Tour:

Welcome to the SUTD interim interim shop facility.

 Here is a sample of the workbenches. This one is patiently awaiting welders.

The "What the fuck is all that noise?" table. 

 Cuttin', drillin', tappin'.

Baby arbor press is very cute. Perfect for baby wheels.

At this point, we're just lacking the Heavy Machinery: MIG and TIG welders, benchtop CNC mill and lathe. Odds of it arriving before we leave: slim. Oh well. At least we got the basics laid out. There's also a 3D printer, though it hasn't been moved down from the main SUTD offices yet. Hopefully, this will be more than just a six-month temporary shop. The goal is that it will be a prototype for a "fabrication cell" that can be copy-pasted into the interim and final campus. It's small enough that each team in a project-based class could get their own cell in which to work and store their hardware.

My in-between-other-things task has been to go around the country (it's not that big) looking for good places to buy commonly-needed engineering supplies. For anyone who happens to be in Singapore looking for stuff, here's a running list of places I've found to be convenient and legitimate sources of the types of stuff I typically need: Stuff@SG. My only warning: Do not go to Sim Lim Square.

Don't go here.

Go to Sim Lim Tower:

Go here.

They are not the same thing. Sim Lim Square is like if you took Radio Shack and made it six floors. Six floors of bullshit consumer electronics stores with two electrical supply stores hidden on floors 2 and 6. (If you expand Radio Shack to six floors, these would be analogous to the poorly-stocked bins of resistors.) But if you didn't know that Sim Lim Tower exists right across the street, and is full of real electrical hardware stores, you could easily be fooled into thinking that Sim Lim Square is the right place. Not saying that happened to me......just be warned.

Supply chain in place and tools at the ready, I decided to spend Saturday pretending that I'm a MechE for once instead of working on motor controllers. To make sure I don't revert to EE ways (and to keep the aluminum chips out of it), I moved my controller off of Pneu Scooter and onto the first official SUTD electric vehicle:

Who says electric bikes are dorky?

It's got a 36V, 46-pole (O_o) hub motor that I can use for independently beating the software bugs out of this damn controller, or blowing it up. I'd be happy with either outcome. But more on that in a later post. While I have unFETtered access to Pneu Scooter, it's time to face an old demon: mounting a Razor scooter handlebar rigidly to a custom deck. BWD had serious problems because it had only thin sheet metal flanges for mounting stuff. Even with the equivalent of a two-piece clamp holding the front together, it still makes creaky noises when you step on it and the handlebar never quite returns to the same place when you fold it up. Clearly this experience calls for a degree of overcompensation on Pneu Scooter.

METAL.

From the 20 feet of 5"x1/4" aluminum I bought, this is what I needed. Ten 4-40 screws into the 0.26" side walls of the u-channel should do the trick. A few more in the front may also come later, depending on how thoroughly I feel like erasing the impending failure-feeling associated with BWD's handlebar mount from my subconscious. Mounting provisions taken care of, I couldn't resist taking it for a quick unpowered spin in the parking lot, so I put the Razor handlebar on with the original wheel:

Odd...

It looks silly, but it coasts nicely enough. Only the slightest bit of noticeable drag from the motor at normal kick speeds. This is good, because if the controller fails or the battery runs out, it's nice to be able to unplug it and kick your way back home.

The last piece of the puzzle is the front fork. I thought this would be moderately difficult to modify. Not so. The Razor A3 comes with a shock-absorbing hinged front fork, as opposed to the welded solid Razor Spark front fork we used on BWD. This one comes apart with one screw, leaving two nice mounting surfaces for a custom job:


The normal fork fits flush to the inside surface of those flanges. Turns out if I instead fit a custom fork to the outside surfaces, the width is perfect for clearing the 6"x1.25" pneumatic wheels. I whipped up the necessary plate geometries out of some more of my infinite 1/4" bar stock.


It's still missing the spacer that bumps up against the rubber shock absorber. And yes, it is being held together with drill bits. I don't have the proper screws and will have to make a trip to Homely Hardware on Monday so I can finish this off. But aside from that, there are no obstacles remaining in the mechanical path to completion. Which means I'll be back working on software or something soon...


Monday, November 1, 2010

Pneu Scooter: Singapore Edition

Sorry for the cliffhanger ending to the Can I Finish Pneu Scooter in Three Weeks quintilogy. The truth is, I probably never had a chance, but if I didn't try then I wouldn't have made any progress until basically winter break. Instead, I got most of it done and decided at the last minute to stuff the whole thing into my suitcase (which was still only 47lbs) and take it to Singapore.

Oh yeah, I'm in Singapore!

I'm here on a month-long visit to the Singapore University of Technology and Design (Established in collaboration with MIT). If you're familiar with Singapore's universities...well, you've probably still never heard of SUTD. It's a brand new endeavor; an attempt to build a university focused on design, in a broad sense. The first entering freshman class will be in 2012, at an interim campus until the shiny new campus near the airport is completed. For now, though, we're at the interim interim campus, the third and fourth floor of a primary school.

I'm actually staying at NUS, since SUTD doesn't have any student housing yet. One of the first things we did was check out the NUS electric vehicle workshop:


The frame in the foreground is a work-in-progress three-wheel, two-seat, road-worthy electric vehicle. The two bubbly-looking cars in the background competed in the Shell Eco-marathon, and the one on the left (I think) won the Asia competition in Kuala Lumpur.

I should warn you that I am the worst tourist ever. Most of my pictures are of workshops, parts, stores, aluminum, or some combination of those nouns, such as "aluminum stores." Here is my one and only touristy picture from the entire trip so far:

And it's not even a good picture.

I mentioned that the SUTD interim interim campus is the third and fourth floor of a primary school. For obvious safety reasons, primary schools don't have fabrication equipment, so one of our tasks here is to create an interim interim shop. That is, a prototype of a "fabrication cell," a more-or-less self-contained design and fabrication space with modern rapid prototyping tools as well as the standard set of hand and power tools. The space in question was introduced to us as "the shed," which I thought was a little odd.

Oh, now I get it.

The shed, or as I've started calling it, Gecko Works, is a great place to escape from the faculty offices and actually do some hands-on work. Or at least, it will be, once we stock it with the essential machine tools. For now, it at least has tables, desks, an assortment of hand tools, and most importantly, air-con. In the weeks to come, we will be setting up a benchtop CNC mill and lathe, MIG and TIG welders, a drill press, horizontal and vertical bandsaws, grinders and sanders, and various other small tools. This is my first experience with actually outfitting a shop space from scratch, so I'm having fun.

Shop space is one component of making stuff. Another is parts (and raw materials). I figured the best way to get motivated to find parts and raw materials sources in Singapore would be to intentionally leave a few of the critical pieces I would need to finish Pneu Scooter in Cambridge. Actually, I just forgot a lot of stuff. So, some of the last two weeks has been spent tracking down good places to get stuff.

First of all, Hobby King still works in Singapore. In fact, it might work better, since much of their shipments pass through Singapore anyway on their way to the US. This takes care of things like radios, brushless motors, ESCs, wire, and of course, cheap lithium-polymer batteries. It was those that I was particularly after, since airline regulations (justifiably) prohibit me from traveling with homemade lithium-ion battery packs. So, I ordered up some of the "long" Turnigy batteries that I've been eying for scooter use ever since they were released.


At 111Wh (22.2V @ 5Ah) and $51.26 each, these batteries represent one of the best values on the market ($462/kWh). If only lithium polymer didn't have such dramatic failure modes, I would totally use these for everything. And they fit so nicely into Pneu Scooter's battery bay. Maybe some day I will overcome my fear of fiery death and use these permanently.

I also neglected to bring any polarized connectors with me, but luckily Singapore has at least two serious RC hobby stores, Rotor Hobby and Singapore Hobby Supplies. Don't expect Hobby King-like deals, though; the prices are on-par with what you would pay at a hobby store in the US (i.e. really freaking overpriced).

During my random scouting, I also stumbled upon an electric bike store. Since Singapore is closer to the source of mysterious Chinese brushless e-bike controllers, I should not have been surprised to find some in little baggies here:

I almost don't want to know what's inside.

In the same general area, I also found a very good, if oddly-named, hardware store:


And there's the (in)famous Sim Lim Square electronics tower, full of pushy salespeople trying to sell you mobile phones. It's kinda like a really big Radio Shack. Buried in there, though, are some decent electronics supply shops, where I was able to get soldering equipment, connectors, etc.

In fact, the only thing that I find sorely, horribly, frustratingly missing is a place to buy raw freaking material in small quantities. We are so totally spoiled by McMaster-Carr and Online Metals in the US that I haven't ever really considered where I would go to find aluminum chunks elsewhere. The concept of web stores in general is lacking here. Mostly, you go to a tiny shop with aisles just big enough to shuffle sideways through and annoy the owner until you get what you want. I actually found a shop like this specifically for aluminum:

It was closed...

I was seeking some 1/4" thick plate from which to make the part of Pneu Scooter that attaches the Razor scooter neck to the custom deck. You know, the bane of BWD. I wanted serious overkill plate stock this time, instead of sheet metal. I went back to Teck Cheong Aluminum during business hours to find that they would only sell aluminum in standard-length stock, i.e. 20-foot bars. So, I did what any reasonable person would do...

I accidentally the whole aluminum bar.

Pound for pound (all 30 of them), it's actually a very reasonable deal @ $1.81/lb. Compare this to the nearest product at Online Metals ($3.25/lb) or McMaster ($6.42/lb). Only, you have to buy enough aluminum to last through the next two zombie apocalypses. Oh well.

Back to Pneu Scooter.

Before I get to finishing the front fork and building my aluminum fortress, though, there were some lingering controller issues to be worked out. And even before that, some battery wiring. I decided to try something new: a precharging circuit for the controller. I am a bit tired of arc eroding my connectors (BWD's first connector had almost no metal left when I replaced it). The problem is that extremely high discharge 10-12S battery packs and oversized bus capacitors on the controller lead to major inrush current. There are all sorts of tricks for limiting inrush current, but precharging the capacitors through a resistor is one I'm familiar with from the Cap Kart.

Rather than putting a bulky contactor on the scooter, I opted for a two-connector system. They share the same positive lead, but one has a negative lead which passes through a 47Ω power resistor:

The precharge resistor.

The resistor is sized so that the precharge circuit can actually power-up the logic stuff (microcontroller, XBee radio) but it would have an unpleasant time trying to drive the motor. I found a wonderful back-to-back configuration for the Deans connectors that made wiring very simple, which you can see on the right-hand side of this photo with the controller, fuse, and precharge circuit:


The order of operations for power-up would be to plug in the precharge connector, followed shortly by the main connector. It's not necessarily user-friendly, but it will limit progressive connector destruction. In the process of wiring everything up, I came up with a simple plan for waterproofing which will probably have to wait until I'm back in Cambridge. 

Here's the part where I complain about motor controllers and how they are impossibly frustrating to build and how I should just buy one, and then realize that the ones I could buy for a reasonable price all suck in one way or another and that I am simply doomed to troubleshooting my hardware because it's still ultimately more effective. (Sound familiar? I went through the same cycle with BWD's 3ph Duo, which ultimately became a fairly reliable controller. I probably just need to stop complaining and accept the fact that hardware will cut you.)

The problem I was having back in Cambridge was that the program on the STM32 chip would spontaneously stop running, but the PWM peripheral would keep going with its last state. This is particularly bad for a brushless motor, since it just locks the drive up. At speed, this would be disastrous for both human and hardware. To take care of the safety aspect, I added a watchdog timer that resets everything if the control loop fails to run. This doesn't really address the root of the problem, just the symptom. 

As it turns out, much of the problem went away simply by actually setting the Hall effect sensor timing properly. (It was left in a state of "close enough" before, which was actually almost 45º off.) I still don't think this solves the problem, but it does point to possible avenues of further exploration. Is it sensor glitching? Is it the speed estimator? Do I need to add some more error handling? All possibilities. For now, it at least runs up to full speed and survives the less-frequent watchdog resets without destroying itself:

MIT Tech TV

The motor itself seems quite capable and efficient. At 33V, 100% throttle, with the timing set correctly for sinusoidal commutation, it only draws 1A no-load. Also, the external Hall effect sensors seem to be doing their job quite nicely, despite the imprecisely-cut magnet strips. In general, the subsystems all seem to be working well. 

I'm hoping the remaining problems are pure software, and not some horrible hardware-triggered software glitch. Even so, it'll take a few more controller tests and tweaks before I'm confident enough to road test it.  But, I do plan to keep working on it a bit here for the simple reason that, unlike Cambridge in November, it's hot here and I can actually ride it outside....maybe.