Flutterby™! : Dan does electronics again

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Dan does electronics again

2003-04-06 05:08:04.357488+00 by Dan Lyke 15 comments

Aaargh. I've been wanting to go a little further with electronics, so today I broke out my Atmel AVR development board, looked at the assembly language again, got lights blinking, then ran down to the local hobby shop for a Hitek HS85BB "Mighty micro", the cheapest servo they had in stock.

The spec sheet for this thing is great, it gives pin-outs, voltage ranges, and confirms what I thought: .9mS to 2.1mS +5V square wave every 20mS to select a position. "No problem", thinks I, and I code up a little interrupt routine on the AT90S1200, wire up a little harness to give me two wall warts, one for the servo at +5 and one for the developer board at +12 or so, with a common ground. Write the code with an extra counter to show me the LEDs blinking at a rate that looks right to me when divided by the counter (since I don't have a 'scope to check it in real-time), remove the counter, plug the servo in, and...

Noise. Jitters over a huge range. Large enough that I can't tell if I'm centering on anything.

My guess is that the wall wart is too noisy for the servo and I need to cobble up a battery pack and make sure the ground is common after the developer board power supply filtering. I've tried a pull-down resistor from the signal to the servo supply ground. I've tried all sorts of different delay values.

Sigh. Back to the drawing board, time to get a battery pack holder tomorrow.

[ related topics: Hardware Hackery Dan's Life Robotics ]

comments in ascending chronological order (reverse):

#Comment made: 2003-04-06 20:02:27.105589+00 by: TheSHAD0W

If you're going to do this a lot, I strongly recommend you pick yourself up a silly-scope. It'll save you all sorts of problems in the future.

If you'll be constraining yourself to things like driving stepper motors, just get the cheapest one you can find. 5 MHz is plenty for that sort of thing.

#Comment made: 2003-04-06 21:48:03.521706+00 by: Dan Lyke

I know I need one and I'm keeping my eyes out. I'd like something fast enough that I can also see what's going on with other logic stuff, 'cause I don't yet have that feel for things that says "throw a cap or small resistor across...", but if this continues too much further I'll start with something slow and cheap just because then I'll learn what i really need.

#Comment made: 2003-04-06 22:18:29.769915+00 by: Diane Reese

It's so much fun to read this stuff: I have no earthly clue what you're talking about, but it sounds great! (Except that my kid has an oscilliscope under his bed that his physics teacher was throwing away last fall.)

#Comment made: 2003-04-06 22:37:45.691164+00 by: baylink

Yeah, this analog crap is *such* a pain, isn't it, Dan? :-)

#Comment made: 2003-04-06 22:46:35.530266+00 by: Dan Lyke

Yep! But woot!, I just hooked up 4 alkalines to the servo, hit a common ground after the dev board power supply, and the code works flawlessly. I can now control servos (muhahahahaha).

I need to get some of the chips with the UARTs in 'em so that I can talk to PCs, and do some cycle counting so I can figure out how much extra processing I can do on these little beasties, and breadboard out the chip running standalone, but this and some PN2222s for small motors that don't need to be servos and I'm at the point of a Lego Mindstorms kit, except that I can expand it as far as I can make the chips talk to each other, and I've got better control.

#Comment made: 2003-04-07 02:39:29.058066+00 by: TheSHAD0W


http://cgi.ebay.com/ws/eBayISA...em&item=2521770788&category=4677 - wow.



#Comment made: 2003-04-07 03:55:09.502779+00 by: Diane Reese

... and that fourth one's seller is in SF, so he'd probably agree to a pick-up, thereby saving on shipping costs, if you meet his reserve price and write to him to ask about it ahead of time.

Diane, the queen of eBay

#Comment made: 2003-04-07 04:05:47.505221+00 by: Dan Lyke

I'll keep an eye on those as they get closer to their sell dates. Also casually browsing http://www.tequipment.net/InstekPriceList.html

#Comment made: 2003-04-07 12:09:00.993597+00 by: John Anderson

Probably a bad sign that, on Monday morning, I read Dan's above comment as "the chips with the LARTs in 'em".

Gonna be a long week.

#Comment made: 2003-04-07 15:57:41.07958+00 by: Dan Lyke

Oooh. Want. Actually, a local Linux user group has asked me to talk about building a minimal boot CompactFlash[Wiki] based install for the Via Eden[Wiki] boards, in the context of this motion control rig I set up. I've been thinking about an easier demo than dragging the whole huge rig to a meeting 60 miles away, and realized that what I need to build is a web enabled fully automatic rubber band LART.

Got a 3 axis stepper controller, I can do angle and azimuth with two motors and save the third to wind the string for a rubber band Gatling gun like mechanism. Couple that with a $20 web cam, and you've got the ultimate "plug it into your network in the machine room" device.

#Comment made: 2003-04-07 18:26:04.368254+00 by: Brian

FYI, GCC has an AVR target. There are even debian packages for it (in unstable). Much easier to deal with than atmel assembly.

I'd be interested in seeing that CF install talk.. when/where is it happening?

#Comment made: 2003-04-07 19:01:31.284398+00 by: Dan Lyke

Someone from the the Davis LUG contact about the CompactFlash[Wiki] install talk, but I'll be putting my notes on Flutterby sometime soon. I need a few hours to get set(e?)[gu]id() stuff working, right now everything's just running as root and I've hacked the few things that want to be something else (notably webfs, which is the HTTP[Wiki] server I settled on) to remove those calls.

Maybe I should just put up my preliminary notes and we'll go forward from there.

On the AVR target, given that I'm doing some funky ass interrupt management (in fact I think figured out how to do it in 2 to 3 (hoping for 3 and finer resolution) variable spaced interrupts per 2.5ms, at 25 instructions or less per interrupt, which moves the servo controll from about a third of the available CPU to pretty much nothing), and that I'm working on one of their lowest-end chips, 1k of ROM, and 32 registers, 16 of which can be indirectly addressed so we'll call that RAM, assembly language is working fine for me. But I'll keep that in mind if I move to one of their larger chips.

#Comment made: 2003-04-08 09:24:42.336541+00 by: Brian [edit history]

#Comment made: 2003-05-09 22:06:08.505865+00 by: mooseo

#Comment made: 2003-05-09 22:07:11.924648+00 by: mooseo [edit history]

As a really low-budg scope option, you might take a look at: http://polly.phys.msu.su/~zeld/oscill.html

This is a program that uses a computer sound card as an a/d converter for a digital oscilloscope. Needs windows, but is free otherwise.