0

Arranging Eagle components in circles or other shapes
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arranging Eagle components in circles or other shapes

by magician13134 on Mon Mar 16, 2009 7:45 pm

What is the best way to arrange components in perfect circles in Eagle? Can it be done? I wanted to arrange quite a few LEDs in a large circle and I can NOT do it by hand/eyeballing. Are there any ways to do this?
magician13134
 
Posts: 1119
Joined: Wed Jun 13, 2007 9:17 am
Location: Ann Arbor

Re: Arranging Eagle components in circles or other shapes

by gamerfreak on Mon Mar 16, 2009 8:24 pm

magician13134 wrote:What is the best way to arrange components in perfect circles in Eagle? Can it be done? I wanted to arrange quite a few LEDs in a large circle and I can NOT do it by hand/eyeballing. Are there any ways to do this?

I've never used Eagle specifically, but on most CAD platforms this can be done with a polar array. Does eagle have an array or pattern feature?
gamerfreak
 
Posts: 64
Joined: Tue Nov 04, 2008 6:57 pm

Re: Arranging Eagle components in circles or other shapes

by zener on Mon Mar 16, 2009 8:31 pm

Can you just lay down a big circle in silk, and then place the LEDs on it? A little trig might help also. How many LEDs do you want in your circle?

zener
 
Posts: 4429
Joined: Sat Feb 21, 2009 2:38 am

Re: Arranging Eagle components in circles or other shapes

by magician13134 on Mon Mar 16, 2009 8:59 pm

60. Nice and easy for trig functions in degrees, but still quite a few.
magician13134
 
Posts: 1119
Joined: Wed Jun 13, 2007 9:17 am
Location: Ann Arbor

Re: Arranging Eagle components in circles or other shapes

by westfw on Mon Mar 16, 2009 11:59 pm

Eagle has polar coordinates, which makes placement pretty easy

http://lh6.ggpht.com/_NOmmtpdLD5M/Sb8Qc ... -wheel.png
Image
You can pick up a part with the "move" tool, and type (on the command line) a polar coordinate (even one set to a new origin) for the destination "(P <radius> <angle>);" Computing part rotations (if you care) will probably require more effort and trig. This works better for relatively small numbers of components, of course. For large numbers of components, it may be worthwhile to write yourself a simple ULP, which has full trig functions. For instance, this ulp draws segments for a "radial dirod" like electrostatic generator.
http://picasaweb.google.com/westfw/Misc ... 2550769074
Image
Code: Select all | TOGGLE FULL SIZE
int nrods = 22;
real id = 21;
real od = 25;

real angle, step;
string cmd = "";
string s;

step = 360.0 / (nrods);
int rod  = 0;

for (angle = 0.0; angle < 360.0; angle += step) {
    real a1 = angle - step/4;
    real a2 = angle + step/4;
    string signame;
    sprintf(signame, "rod%d", rod++);
    /* first radial line */
    sprintf(s, "poly '%s' (p  %f %f) (p %f %f) ", signame, id, a1, od, a1);
    cmd += s;
    /* outer curve */
    sprintf(s, "+181 (p %f %f) ", od, a2);
    cmd += s;
    /* inward radial line */
    sprintf(s, "(p %f %f) ", id, a2);
    cmd += s;
    /* inner curve */
    sprintf(s, "+179 (p %f %f) (p %f %f);\n", id, a1, id, a1);
    cmd +=s;
}

exit(cmd);
westfw
 
Posts: 1568
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Arranging Eagle components in circles or other shapes

by magician13134 on Tue Mar 17, 2009 7:49 am

That's very interesting and helpful Westfw. I've pretty much avoided the command line until now, but I've got to learn at some point I suppose. Thanks
magician13134
 
Posts: 1119
Joined: Wed Jun 13, 2007 9:17 am
Location: Ann Arbor

Re: Arranging Eagle components in circles or other shapes

by westfw on Tue Mar 17, 2009 11:05 am

I find the ability to mix mouse-clicks and command line options, even in a single operation, and the fact that everything that can be done with the mouse can also be done via the CLI (or ULP), to be very ... comforting, in a way. It's presumably a consequence of having been "mostly cli-driven" not-so-long ago. Which are pretty unpleasant, but they seem to have pulled off the transition.
westfw
 
Posts: 1568
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Arranging Eagle components in circles or other shapes

by macegr on Tue Mar 17, 2009 5:23 pm

I also use trig and polar coordinates, but one other useful technique is using the Rotate tool. Or, actually, a lot of tools that allow direct angle entry, like the Move and Copy tools. You can draw a part at the desired radius, draw a line from the part to the center of the circle, group them, then use the copy tool with the cursor at the center of the circle. Before you place the copied parts, enter the desired rotation angle and hit enter, it'll rotate immediately and you can position the part and radius line on the circle center. Now you can repeat with both rotated objects and radius lines, rotate appropriately, and repeat. Doubling up each time makes it pretty quick to finish a whole circle. Here's an example I just did with 60 0805 LEDs:
Image
And here are a couple actual boards using both the above technique and polar coordinates:
Image
Image
macetech LLC - http://www.macetech.com
macegr
 
Posts: 292
Joined: Fri Apr 04, 2008 4:46 pm

Re: Arranging Eagle components in circles or other shapes

by magician13134 on Thu Mar 19, 2009 8:50 am

Ok, so I'm trying to make an LED clock... And I've never really done a whole lot with multiplexing, but this Instructable says that I can drive N(N-1) LEDs with N pins. So assuming I disregard seconds, I should be able to drive 60 minutes + 12 hours with only 9 output pins? So this should be possible with a single ATTiny2313, right? Thanks

(And thanks for that board with the 60 LEDs in a circle, that's very helpful, macegr!)
magician13134
 
Posts: 1119
Joined: Wed Jun 13, 2007 9:17 am
Location: Ann Arbor

Re: Arranging Eagle components in circles or other shapes

by westfw on Thu Mar 19, 2009 11:18 am

I should be able to drive 60 minutes + 12 hours with only 9 output pins? So this should be possible with a single ATTiny2313, right?
Yep. A clock is one of the ideal apps for Charlieplexing, too, since you're typically only illuminating 2 LEDs at a time anyway...
westfw
 
Posts: 1568
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Arranging Eagle components in circles or other shapes

by magician13134 on Thu Mar 19, 2009 7:28 pm

Oh, I didn't realize that was your Instructable. I'm still having a little trouble understanding how Charlieplexing works (is that not the same as multiplexing?) but I'm sure I'll figure it out when I've got a little more time to sit down and look at it.
magician13134
 
Posts: 1119
Joined: Wed Jun 13, 2007 9:17 am
Location: Ann Arbor

Re: Arranging Eagle components in circles or other shapes

by westfw on Thu Mar 19, 2009 11:21 pm

I thought I explained it, but at least one person decided that it needed a better explanation and wrote http://www.instructables.com/id/Charlie ... he-theory/ , so I guess I didn't do a great job.
westfw
 
Posts: 1568
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Arranging Eagle components in circles or other shapes

by oPossum on Fri Mar 20, 2009 4:45 am

I am the Possum, and I approve of this message. Sent from MacBook Wheel Sorry for my bad German.
oPossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am
Location: Michigan, USA

Re: Arranging Eagle components in circles or other shapes

by jarv on Fri Mar 20, 2009 9:20 am

the wikipedia article is also a good reference - http://en.wikipedia.org/wiki/Charlieplexing
right on the page is a nice picture of a LED clock too :)
projects (avr/electronics/programming) - http://jarv.org
jarv
 
Posts: 49
Joined: Tue Jan 02, 2007 5:48 pm

Re: Arranging Eagle components in circles or other shapes

by magician13134 on Fri Mar 20, 2009 6:43 pm

Alright, thanks for all your help! Now I'm trying to figure out the command line... I can get "ROTATE LED1" to work, but when I try to type in an angle after that, it just gives me an error. Can anyone tell me what the syntax is for rotating an LED a certain number of degrees, or moving it to a certain location? Thanks!
magician13134
 
Posts: 1119
Joined: Wed Jun 13, 2007 9:17 am
Location: Ann Arbor

Please be positive and constructive with your questions and comments.