Thursday, May 5, 2016

It's all a mess

Look at this mess

Seriously, look at the mess...

No really, look at it...

Isn't it awesome? Building things makes messes. Beautiful messes that you eventually clean up because we don't wanna be a safety hazard and or annoyance to fellow lab-dwellers. But currently we're still in the mess phase and it's where all the fun mostly happens.

I'm so close to finishing my ATV (not calling it a tank anymore, because it's not shooting anything - yet - ).

The wheels are turning, the RC is RC-ing, camera is transmitting. It's all so close. I just need to make all the wires be nice and robust. Or at least not susceptible to breaking easily.

I can't wait to show you a video of it running around the office.

Of course you can also attend NXP FTF in a week and a few days and see it (and drive it!) for yourself.

I will be there...I will race you (there will be 2).

If you're not going, stay tuned for more updates.

Wednesday, April 13, 2016

Uhm...wut? that?

Why yes, that is a tank

It's a tank! A big metal tank!

I'm going to make it move. I'm going to make it do things. Maybe even hit things...because it's a tank!

I will then take it to NXP FTF 2016 and if you go there, you will get to play with it. 

I will let you play with it.

Go to FTF and play with tanks and microcontrollers. 

Tuesday, April 5, 2016


As I said in my previous post, the NXP FTF technology forum is happening in Austin, TX the week of May the 16th.

I will be around and if you're going (and you should go) you should tweet me @embeddedstories

I am preparing some stuff for it including a few classes on motor control technology (wanna hear about quadcopters?)

And maybe possibly a BATTLE OF THE TANKS. Yes, there will be fun times.

Don't tell anyone about this.

But share this post.

Don't mind the incongruence.


Monday, March 28, 2016

Documents documents documents

I am not gonna lie to you, sometimes engineering is boring *gasp!*...

It can be, there's no way around it. As exciting as blowing up capacitors and figuring out how to solve a complex software bug can be, eventually you have to communicate and document things. Ideally you work in a place where processes are not overbearing, but even the most minimalist processes require some documentation.

I review a lot of documentation, it is possibly even more boring than writing it, but it needs to be done and in my mind it's almost as important as the product itself, particularly when you're talking about highly complex to use products such as microprocessors or software libraries (you could argue that a consumer product should not require documentation to be used, but we all know the miles of documentation that exist behind the curtain for that to be possible).

This all to say that I haven't posted anything new in a few weeks because I've been doing a lot of documentation work and it's mostly not interesting.

Fun times are coming, though.

While I get an interesting post going, lemme tell you about the wonderful event my company is having very soon, it's calld NXP FTF and if you're an embedded systems engineer of any sort you should plan on attending to learn a bunch of stuff about new technology, NXP products and such.

I will be there, teaching some classes on motor control with our Kinetis MCU. There will be plenty of classes on all sorts of subjects, do you do embedded Linux? Do you work with MEMS sensors? NFC? RF?

Click here to find out more and tweet me @embeddedstories if you want to talk some more about this or other topics.

Friday, February 12, 2016

Good vibrations

I wrote this fun little demo recently to prove the control algorithm and micro (NXP KV31 Microcontroller) can handle this sort of motion.

See for yourself:

This motor might be listening to Shake it Off by Taylor Swift

This sort of motion is difficult to accomplish because we are periodically and very rapidly changing motor direction, which means counteracting all the inertia present at the moment. Using a field-oriented control algorithm such as what is running here makes the control possible because it mathematically decouples the magnetic flux and the torque vectors and they become 2 separate currents to control. 

When the drastic direction change is commanded (going from 1200 RPM clockwise to 900 RPM counterclockwise in about 15 milliseconds) the controller can immediately compensate for the current peaks, because it is controlling mainly for current (the speed control is a secondary control loop), allowing drastic and damaging current changes to be minimized. Additionally keeping control of the flux and torque means being able to make the motor do what is needed in a much tighter way.

Simpler controllers, like a basic voltage control, are definitely less CPU intensive and easier to work with, but would not accomplish the level of response shown in the video above, especially under different levels of load. 

Luckily the reference designs available on the NXP site provided pretty much all I needed to make this happen including firmware and tuning software so that I needed to mostly focus on the motion side and what I wanted the application to do, rather than the motor control, itself.

Monday, January 18, 2016

Messy motors

When I was around 10 years old I broke one of my front teeth by sliding down a water slide at top speed and failing to recognize a friend had stopped mid way down...I rammed into him first with my legs, flew forward and my chin landed on his head prompting my jaw to close shut with such force that my tooth shattered and I subsequently pulled my head out of the pool and spit the pieces.

Why do I tell you this gruesome story? Because I got a fake tooth put in. That was exactly the tooth that I used to peel wire insulation when playing with my electric train kit that my dad had bought for me when i was a baby but that I was rediscovering at age 10. I loved taking the trains apart, figuring out how the motors worked and then putting everything back together.

Yes, I know and knew back then about tools to do the job...I had no patience for such complications, I peeled my wires with my teeth like a brute-orangutan-geek-kid hybrid.

Few weeks later, while playing with my train set, I peeled another piece of wire and promptly pulled that fake tooth off. I placed it back in it's place and pretended like nothing happened for several months. Eventually dentist saw me again and said I should just wait until I grew up to get a crown put in.

I am almost 34 years old and I still have that gap in my teeth, I never got around to fixing it...or...I'm not an adult yet. I have proof:

Not quite over playing with motors

This is my work life. I still play with motors. Not quite toy train motors, but still motors.

Working with motors can be messy. There's always wires sticking out of places. You're running relatively high power (even with lower power motors, compared, to the micros running the software), so you have to be careful about where and how you connect instruments. It's not unlike my childhood days playing with toys, taking toys apart, annoying my parents for breaking apart my new toys.

(The reason I decided to go into electronics is that I was always frustrated by not being able to figure out how my toys with electronics worked...that and I couldn't figure out how I would make a living as a physicist.)

I do use pliers and wire peelers now (usually)...they're not in the picture but take my cyber-word for it.

Currently testing new NXP Kinetis Motor Suite software for the KV31 series for position control on PMSM (permanent magnet synchronous motors). Will post a video of the thing actually spinning once I figure out if those encoder signals are working correctly.

Monday, November 4, 2013

Programming today...

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."

Rick Cook