Needing help wtih Eagle and pcb-gcode (OSX).

TonyB
Posts: 105
Joined: Mon Apr 29, 2013 3:34 am
Location: Norwalk, Ia

Needing help wtih Eagle and pcb-gcode (OSX).

Post by TonyB » Tue Jul 30, 2013 9:55 pm

I'm not sure whether this should be a PCB thread or a CAM/CAD workflow thread; I'm guessing the later of the two.

I'm basically having issues generating gCode for milling PCBs and am hoping to get some direction on what I'm doing wrong. The last thread I created was extremely helpful, it allowed me to work through my last issues in PyCAM! Which is awesome!

I'm using Eagle and pcb-gcode (which I have running on OSX).

This project is for a sort of "Radar Detector Dash", which basically takes a Escort 8500ci plus and adds a waterproof box and a PCB with a bunch of LEDs (for something a little more noticeable).

Here's my design:
Image

Which will fit in here:
Image

Feel free to check out the 3D view: https://tinkercad.com/embed/6l3Z6QbH7SV?editbtn=1

I created my schematic, just a bunch of LEDs:
Image

Went to the PCB view and set all the same dimensions in my TinkerCAD design:
Image

Ran the pcb-gcode.ulp:
Image

Grabbed the etch file:
Image

Dropped it into buildlog:
Image

Spun it:
Image

I'm not sure why I don't have some sort of line/link between each LED like in the PCB view... I haven't tried cutting anything yet, so maybe it is there...? But I just can't see it?

Any ideas/tips would be very appreciated!

Thanks!
Tony
Attachments
Radar Detector Dash.zip
(101.84 KiB) Downloaded 44 times
MegaSquirted 62mm 7m @ 20psi on 91 octane
410whp/411ftlbs

Build Thread
Image

jasonharper
Posts: 11
Joined: Mon Jun 17, 2013 2:06 am
Location: Oklahoma

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by jasonharper » Tue Jul 30, 2013 11:06 pm

I'm not familiar with Eagle, but it doesn't look like you've actually laid out the PCB yet - those lines appear to be the "rat's nest" showing you what traces still need to be placed. You'd certainly want traces much wider than what's being shown, anyway.

What's your power source? 17 LEDs in series would require at least a 34V supply, for typical red LEDs, with 45V or so being a reasonable value to allow for the voltage drop across the current limiting resistor (which you seem to have left out).
ShapeOko #1743F, double X axis, 5mm Y drive shaft, DW660 spindle

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by cvoinescu » Tue Jul 30, 2013 11:48 pm

I too am puzzled by the schematic. Too many LEDs in series, and no current-limiting resistor. I agree with jasonharper that you haven't routed the board. Or you may be milling the wrong layer -- I'm not familiar with the Eagle file naming conventions. It appears you're milling isolated pads, and I think you're milling out the pads and keeping the rest of the copper, rather than the other way round, but I can't be sure. How did you generate the G-code, what did you use?
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

TonyB
Posts: 105
Joined: Mon Apr 29, 2013 3:34 am
Location: Norwalk, Ia

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by TonyB » Wed Jul 31, 2013 2:29 pm

jasonharper wrote:I'm not familiar with Eagle, but it doesn't look like you've actually laid out the PCB yet - those lines appear to be the "rat's nest" showing you what traces still need to be placed. You'd certainly want traces much wider than what's being shown, anyway.
I see what you're saying. I ran the rat's nest command and it changed the lines to more direct lines; I figured it would just create the paths for me. I have no experience with schematic/pcb programs...
jasonharper wrote:What's your power source?
I'm not 100% sure what voltage the bike produces. A car is anywhere from 8.8v-14.4v. Originally the LED (just one) was a three pin; it's green when nothing is happening and flashes red when the detector is going off. I plan to just eliminate the green by having only two pin LEDs. I imagine the power going to the original LED is a 5v. Up near the front of the bike there used to be a small nose light; since it's not being used... so I will have a higher voltage source available. I figure I might be able to use a transistor to step the voltage up?
jasonharper wrote:17 LEDs in series would require at least a 34V supply, for typical red LEDs, with 45V or so being a reasonable value to allow for the voltage drop across the current limiting resistor (which you seem to have left out).
This is where my electronics knowledge completely drops off and my other experience kicks in. Other experience being: Diving in head first and figuring it out through trial/error; it's not always the best approach... but eventually I work through the issues. Any advice towards what components I need or am missing (and an explanation as to why) would be much appreciated; I'll add the needed components to the schematic/board and repost screenshots.

Here are the LEDs I ordered:
http://www.amazon.com/gp/product/B006G6 ... UTF8&psc=1

cvoinescu wrote:I too am puzzled by the schematic. Too many LEDs in series, and no current-limiting resistor.
Sorry, my lack of knowledge :/.
cvoinescu wrote:I agree with jasonharper that you haven't routed the board.
When I get a chance I'll try and see if I can find some sort of routing command.
cvoinescu wrote:Or you may be milling the wrong layer -- I'm not familiar with the Eagle file naming conventions.
I'm only doing one layer.
cvoinescu wrote:It appears you're milling isolated pads, and I think you're milling out the pads and keeping the rest of the copper, rather than the other way round, but I can't be sure.
It does kind of look like that... I definitely need to mill the majority of the way around the circle, then towards the next component and then drill a whole in the middle of each 3/4 milled circle.
cvoinescu wrote:How did you generate the G-code, what did you use?
I downloaded pcb-gcode, which they refer to as a ULP. If you look in the last couple of screenshots in the first post, you can see a ULP button across the top toolbar. When you click it, it opens a browse file window; from there you select "pcb-gcode.ulp" and it just generates the gcode files into your project directory. I also noticed if you run "pcb-gcode-setp.ulp" instead of "pcb-gcode.ulp" it lets you specify more setup options (I think it's the equivalent of a CAM program).


I hope this is enough information to get an understanding of where I'm at. Feel free to link me to resources/articles/etc. I don't mind putting in some effort, I just need nudged in the right direction ;).

Thanks again!
I do really appreciate the help!
Sorry for my ignorance! haha
Tony
MegaSquirted 62mm 7m @ 20psi on 91 octane
410whp/411ftlbs

Build Thread
Image

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by cvoinescu » Wed Jul 31, 2013 3:33 pm

The Amazon page says "forward voltage 1.9 - 2.1 V". Let's assume 2.0 V. The current should be 20 to 25 mA. While the supply is nominally 12 V, it'll actually be as much as 14-15 V when the engine is running and the battery is charging.

Let's say we use five LEDs in series; they'll drop 5 * 2.0 V = 10 V. Assume 14.5 V is the maximum supply voltage. We need to drop 4.5 V on the resistor, at a current of 25 mA. Ohm's law says R = U / I = 4.5 V / 25 mA = 180 ohm. The dissipated power on the resistor will be P = U * I = 4.5 V * 25 mA = 113 mW, so a regular 0.25 W resistor should be plenty. When the battery voltage is 12 V (engine idle or off), the resistor will have to drop only 2 V, giving a current of I = U /R = 2 V / 180 ohm = 11 mA. That'll make the LEDs noticeably dimmer. If we want to keep the LEDs shining bright, we have to have fewer LED in series and a larger resistor.

Re-doing the calculations with four LEDs in series: 4 x 2.0 V = 8 V drop on the LEDs, 14.5 V - 8 V = 6.5 V drop on the resistor. A current of 25 mA gives the resistor value R = 6.5 V / 25 mA = 260 ohm. The closest standard value is 270 ohm. Power dissipation on the resistor is (different method, for variety) P = U^2 / R = (6.5 V)^2 / 270 ohm = 156 mW. Again, a quarter watt resistor will suffice. At 12 V, current will reduce to 4 V / 270 ohm = 15 mA, which is still plenty.

You can wire as many of the four-LEDs-and-a-resistor groups in parallel as you need to make up the number of LEDs. The current drawn by the assembly will be that many times 25 mA (at 14.5 V).

(Pre-emptive note for nitpickers: this is simplified. I've ignored, among other things, the variation in LED voltage drop with current, but it's close enough to work perfectly well in practice.)
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

TonyB
Posts: 105
Joined: Mon Apr 29, 2013 3:34 am
Location: Norwalk, Ia

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by TonyB » Wed Jul 31, 2013 5:55 pm

cvoinescu wrote:The Amazon page says "forward voltage 1.9 - 2.1 V". Let's assume 2.0 V. The current should be 20 to 25 mA. While the supply is nominally 12 V, it'll actually be as much as 14-15 V when the engine is running and the battery is charging.

Let's say we use five LEDs in series; they'll drop 5 * 2.0 V = 10 V. Assume 14.5 V is the maximum supply voltage. We need to drop 4.5 V on the resistor, at a current of 25 mA. Ohm's law says R = U / I = 4.5 V / 25 mA = 180 ohm. The dissipated power on the resistor will be P = U * I = 4.5 V * 25 mA = 113 mW, so a regular 0.25 W resistor should be plenty. When the battery voltage is 12 V (engine idle or off), the resistor will have to drop only 2 V, giving a current of I = U /R = 2 V / 180 ohm = 11 mA. That'll make the LEDs noticeably dimmer. If we want to keep the LEDs shining bright, we have to have fewer LED in series and a larger resistor.

Re-doing the calculations with four LEDs in series: 4 x 2.0 V = 8 V drop on the LEDs, 14.5 V - 8 V = 6.5 V drop on the resistor. A current of 25 mA gives the resistor value R = 6.5 V / 25 mA = 260 ohm. The closest standard value is 270 ohm. Power dissipation on the resistor is (different method, for variety) P = U^2 / R = (6.5 V)^2 / 270 ohm = 156 mW. Again, a quarter watt resistor will suffice. At 12 V, current will reduce to 4 V / 270 ohm = 15 mA, which is still plenty.

You can wire as many of the four-LEDs-and-a-resistor groups in parallel as you need to make up the number of LEDs. The current drawn by the assembly will be that many times 25 mA (at 14.5 V).

(Pre-emptive note for nitpickers: this is simplified. I've ignored, among other things, the variation in LED voltage drop with current, but it's close enough to work perfectly well in practice.)
Awesome explanation!

I read through it a couple of times to make sure I am understanding each piece. I also read through a little bit of the Ohm's Law on wikipedia; which helped me tie things together.

I do have a few questions:
1. Where did the 20 to 25 mA number come from?
2. I assume that the power (that previously powered one LED) coming from the Escort control box will more than likely not support all these LEDs. Could I use the signal coming from the Escort control box with a transistor (IRLZ44N) to switch ground and have my power come from my extra 12-14v source?


Now that I somewhat understand the voltage drop and how to group the LEDs, I should probably pick an amount per group that is divisible by 4 or 5. I'm thinking that 28 would be a good number; that way I can do 7 groups of 4. I imagine the voltage will get down to even 8.8v at idle... though idle is the one time these LEDs will be the least important. So even if they're dim it won't matter; Since I'm sitting still, I may even have more awareness on the bike anyhow. The most important time will be when I'm moving at around the speed limit, which means the bike will most definitely be in the 12v-14.4v range; so I think the figures are more than sufficient.

I'll post back when I have time to make some revisions to my TinkerCAD file and my Eagle file. If anyone else is able to shed light on the Eagle to gCode process before than, that would save me a lot of time.

Making progress in the right direction!
Thanks again!

I'll be busy the next couple of days, but hopefully by the end of the weekend I'll have some progress to post!
Tony
MegaSquirted 62mm 7m @ 20psi on 91 octane
410whp/411ftlbs

Build Thread
Image

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by cvoinescu » Wed Jul 31, 2013 6:11 pm

Glad my explanation helped!

20 to 25 mA is typical of 5 mm LEDs, and I think the Amazon page mentions 25 mA too.

Your assumption is almost certainly correct. A transistor would be a good idea.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

TonyB
Posts: 105
Joined: Mon Apr 29, 2013 3:34 am
Location: Norwalk, Ia

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by TonyB » Wed Jul 31, 2013 9:12 pm

cvoinescu wrote:Your assumption is almost certainly correct. A transistor would be a good idea.
Sweet, that should work out really well then.

In the past, I referred to this article when using one:
http://bildr.org/2011/03/high-power-con ... nd-tip120/
Though I have a IRLZ44N and I'm not sure of the differences. Can I set the IRLZ44N up the same as the TIP120? I think the biggest difference would be the resistor and whether or not to use a diode?

The original IRLZ44N that I had was from this:
http://www.diyautotune.com/catalog/pcbv ... p-160.html

Which is a PWM kit that's used to control different things on a MegaSquirt (among other things it could be used for). The diagram they reference for Boost Control is here:
http://www.msextra.com/doc/ms1extra/MS_ ... .htm#boost

I notice some key differences between the TIP120 setup and the IRLZ44N setup. When I've messed with electronics stuff in the past, I've kind of just used trial/error, made an educated guess, etc.

The TIP120 diagram uses a resistor (2.2k) and 2 of the 3 uses a diode also. The IRLZ44N uses two resistors (100r and 10k).

I understand that the premise is that we're switching ground to complete a circuit. But I don't quite understand why these two setups are different...

This thread is getting a bit off topic, but it'll come back around once I start plugging away at Eagle.

Thanks,
Tony
MegaSquirted 62mm 7m @ 20psi on 91 octane
410whp/411ftlbs

Build Thread
Image

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by cvoinescu » Thu Aug 01, 2013 12:41 am

The schematic at msextra.com is correct for a MOSFET transistor (e.g. IRLZ44N). Both resistors are optional, but they're a good idea (the series one limits the current during switching, the other one insures that the transistor is off when disconnected, and also makes it less sensitive to damage by electrostatic discharge). The one at bildr.org is also correct, but for a bipolar transistor (e.g. TIP120). That resistor is not optional (it is required to limit the current through the base of the transistor). In either care, you don't need the diode if your load is a bunch of LEDs -- that's only for inductive loads (motors, solenoids, relays), to protect the transistor.

Depending on how the original LED was wired, you may actually need a second transistor (a small one), or your circuit may work backwards (turn the LEDs on when they're meant to be off). Check that your output is "high" (positive relative to ground) when the LEDs are supposed to be on (often, digital circuits work "backwards", active low -- the same as you're going to do, switching the negative side). It would be very helpful if you could measure the voltage on the output, with respect to ground, both with the LED off and with the LED on. If it's backwards, I can draw a simple schematic for you.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

TonyB
Posts: 105
Joined: Mon Apr 29, 2013 3:34 am
Location: Norwalk, Ia

Re: Needing help wtih Eagle and pcb-gcode (OSX).

Post by TonyB » Thu Aug 01, 2013 9:36 pm

cvoinescu wrote:The schematic at msextra.com is correct for a MOSFET transistor (e.g. IRLZ44N). Both resistors are optional, but they're a good idea (the series one limits the current during switching, the other one insures that the transistor is off when disconnected, and also makes it less sensitive to damage by electrostatic discharge). The one at bildr.org is also correct, but for a bipolar transistor (e.g. TIP120). That resistor is not optional (it is required to limit the current through the base of the transistor). In either care, you don't need the diode if your load is a bunch of LEDs -- that's only for inductive loads (motors, solenoids, relays), to protect the transistor.
Alright, that makes sense. I'll wire the IRLZ44N according to the msextra.com diagram.
cvoinescu wrote:Depending on how the original LED was wired, you may actually need a second transistor (a small one), or your circuit may work backwards (turn the LEDs on when they're meant to be off). Check that your output is "high" (positive relative to ground) when the LEDs are supposed to be on (often, digital circuits work "backwards", active low -- the same as you're going to do, switching the negative side). It would be very helpful if you could measure the voltage on the output, with respect to ground, both with the LED off and with the LED on. If it's backwards, I can draw a simple schematic for you.
I was planning to put a voltmeter to the pins; I'll let you know which way it does once I know. I'm assuming the idea is to use a ground switch to switch a power switch? (well... transistor)



I made a bit of progress over lunch. I only did one side and still have a bunch to do, I was just trying to add the resistors and get everything arranged in the available space. I'm not sure where I'll put the transistor; I'll figure that out when the time comes.

Image

Image
MegaSquirted 62mm 7m @ 20psi on 91 octane
410whp/411ftlbs

Build Thread
Image

Post Reply