ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

EE Expert Darren Ashby
SpacersProduct Engineering

Click Here to Go to the Product Engineering ArchiveClick Here to Go to Darren Ashby's Main EE Expert PageClick Here to Go to the Guides and Experts Main Page

TOP SECRET Motor Control
Finally Done!
 
by Darren Ashby

Well, the Top Secret Motor Control is in its final stage. For those of you following along, this will be my last installment concerning this project. Will we ever come back to development on the Tiny 15? Probably. My son has a remote control car that needs repair sitting on a shelf in my office. I keep promising I’ll get to it some day.

At this point in any other tech rag you'd get to see a picture of the completed prototype. I wish I could show you one, but I can’t. It’d just reveal too much. A few last words will have to suffice.

So let’s begin the story at the end. It all started with a missing part.

I Almost Forgot

The free-wheeler diode was missing on my project. Whenever you switch current on and off with an inductive load you should have a reversed-biased diode around the inductor to prevent all sorts of nasty stuff caused by induced voltage spikes. It's a given that motor windings make good inductors. After paying homage to the great electronic guru in the sky for reminding me, I soldered a diode onto the TSMC.

Setting Up Tables

No, we’re not going to have a picnic. These tables are for the modulation schemes I’d like the TSMC to be capable of, primarily a sine wave. Given the limited calculation resources of a micro such as the Tiny, often the easiest way to do a modulation scheme is to set up a lookup table. Fortunately, there are many LDx commands available for loading data from a table in the ’15, making this a fairly easy process. One thought as I set up a sine table, "Is there a simple approximation based the unit circle that a micro like this could use?" I couldn’t find one on the ‘net. If you know of one please send it to me. Otherwise I’ll have to delve into it on my own. Just seems too useful if it were possible. I did find some something cool called magic sine waves, but it really didn’t work in my case due to the size of the look up table.

Recommendations

Don’t use the STK100. You should go to Digikey and spend $80 on an STK500. It was much easier to use and considerably more reliable. For example, you can run it right from AVR Studio without an external program. My results with the STK100 were less than enjoyable and often frustrating. I got my hands on an STK500 and configured the high-voltage serial-programming jumpers as per the manual. You have to do this if you plan on disabling the reset pin on the Tiny 15. It is the only way to get it to program once that fuse is set. There was one error in the STK500 manual though: item 7 section 3.7.2.2 says the reset pin on the PORTE/AUX header is pin 3. It is really pin 4. The PCB, however, is labeled correctly. This document was on the CDROM included with the programmer. I don’t know if this has been corrected yet.

The ‘500 was a breath of fresh air compared to the STK100. The frustration factor was about an 8 out of 10 on the ‘100, whereas the STK500 ranks a 1 in my book. The jumper configuration was a small pain, but I can see Atmel set it up that way to make it very universal. If I were Atmel I’d stop selling the STK100 completely and only offer the STK500. I don’t think I’d even give the '100 away due to the frustration it can cause.

Warnings

Don’t plug a chip in backwards into the programmer. It will not only kill the chip, but your programmer will loose its magic smoke as well. I really think the programmer design should have taken this into account. It is just too easy of a mistake to make.

The Atmel instruction set has several ‘skip if this’, ‘skip if that’ instructions. The first time I saw this type of instruction was on a PIC Microchip. I thought, "hey this is so much easier than trying to come up with labels!" So I use it all the time instead of ‘compare then jump’ statements. There is one problem though. It only skips the next line of code. If you happen to use a macro, you will get all kinds of results that you don’t expect because it looks like one line of code when you write it. I caught myself making that mistake a few times, but it is easy to see with AVR Studio. Single instructions appear in blue, while macros are gray. Much easier than my old DOS-based assembler I used for the PIC so many years ago.

Done At Last...

Is an engineer ever really done? Every engineer I’ve worked with would tinker forever unless someone stepped in (with their hair to point the way) to say SHIP IT! For me that time occurs when you have a product that works and hopefully won’t disappoint the customer. That stage has been reached. Of course it depends on who your customer is. I may just tinker with the Tiny 15 forever.

The End, or Is It?

Four articles and eight weeks later you’ve seen quite a bit of this little project. As discussed throughout the series, this is a TOP SECRET project for me. (Don’t worry, it doesn’t fly a missile or anything like that.) I suppose how secret it is depends on how much investment someone out there is willing to make. Now it’s time for the ultimate question: Can you guess what it is?

Product Engineering Archive

Guides and Experts   Analog Avenue   EDA Tools   PLD   DSP   EDA   Embedded Systems   Power   Test
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ