Electronics DIY blog

DIY is fun and is food for the brain and spirit. Don't be afraid to learn.



Monday, November 12, 2012

YAP2C - Yet Another Pickit 2 Clone

After a long break from the electronic scene, I've decided to pick up the drawing board again.

Since Microchip dropped support for ICD2 (Cypress based clone) all x64 Windows OS (since Vista at least) fail to recognize it.
The solution is to use it in an other machine with a x86 OS which is not practical, since that is not my main PC.

Pickit 2 (Microchip also is discontinuing) is a fine replacement for now for my needs. It is small.easy to build and is supported in Vista/7 x64.

So I decided to make yet another clone based on many other clones that are out there. Of course, also has many other clones out there, it is made of the most common electronic components found out there.

Pickit 2 has the following pros:
  • Microchip has open schematics and software for this programmer.
  • Small size form.
  • Easy to build.
  • Easily customizable.
  • Made of common parts and a single 18F2550 PIC
  • Can be integrated with several programming/compiling tools.
  • Doesn't need to download software each time you have to program a different part.
  • My simplified version can supply power to the target without penalty for the USB port.
  • It's a single side PCB with only a few shunts on the opposite layer.
Cons:
  • Does not support most recent PIC (not a big deal for me at this time).
  • My simplified version can supply power to the target without penalty for the USB port but requires external dc adapter.
  • My simplified version is for 5V parts only. (although it can be overcome with an adapter between the Pickit and the 3.3v target).
  • My simplified version has no leds (visual status of PIC).
  • My simplified version has no memory for standalone programming.
So here is the schematic and PCB:
Schematic

PCB

And here is a 3D simulation of the circuit. Some parts are missing (I don't have the model) and others are not exactly the specified format but it can provide a good idea. I'm considering changing the inductor to an axial type to save more board space and give it more room.

Pickit 2 - bottom

Pickit 2 - top
My only doubt right now is if I can reproduce this on CrappyCNC. But first I must fix it (yes I've done a stupid thing with it and broke the CNC...lol). Since it was build from root by be I'm not that concerned. The good thing of doing things your self is that you know how to rebuild/fix in case of an accident. ;-)

For more info on the way the Pickit 2 works check this link.

See you next time...

Tuesday, September 4, 2012

PCB-GCode tips and tricks for full isolation

My PCB milling techniques are getting better at each trial-error experience.

Going to the SMD area there are a few tricks and adjustments that will improve the overall quality of the work.

By the way I'm now using some 0.1mm @ 60º V-bit for the PCB echting process instead of the 10º I was previously using. The results are a lot more even. I'm now going at 0.02mm of depth instead of the 0.05mm in my last config. Actually my new config has changed quite a bit.

I'm now using these settings:

Milling depth: 0.02mm
Tool size: 0.4mm (I moved the compensations and safety margins to this field. Run-out, vibrations and all unknowns are in here instead of being in the default isolation margin.)
Default isolation margin: 0.05mm. Reflects the changes above.
I still use the double passage method for best results. Maximum and Set Margin should reflect that has explained in an early post.

Also as I stated in early considerations the DRC tool in eagle is very important. And should reflect the given formula (Minimum clearance = Tool size + 2xDefault isolation margin) for all clearances.

Ensuring full PCB routing trick


Some times enough clearance between track simply can't be achieved or is too difficult. Here is a technique to overcome that limitation. (Remember this will ignore the clearance rule so your machine may not be capable of reproducing a good route/via/pad because it is just bellow the resolution it withstand).
You clould "lie" to the pcb-gcode plugin about the size of your tool to achieve until path was achieved, but this would result in poor final qualitty since all routes/pads/vias would become thinner than expected. This should be avoid.

Here is an example.

Check your clearances. Try to fix as many has you can. Remember that if you can't guarantee the given clearance the gcode generated will also reflect that and route isolation will not be fully achieved.
In the following circuit I used the DRC tool and my failed clearances were highlighted like in this image.

Eagle after DRC tool

Generated echting gcode
As you can see the the milling route in the areas without enough clearance is not generated.
To overcome this manually add some milling routes in the Milling Layer (layer 46 of eagle)

Manually added route

Generated milling gcode

Merged gcodes (milling + echting)
Has you can see the highlighted gcode and track are actually the milling gcode. The final result is a single pass routing to perform the desired isolation.
If the echting tool is not too big and the routes are not that thin the achieved result is very acceptable. The resulting route will be slightly thinner but it wont be that bad. This will in almost every situation yield best results.

Here is the output of the above circuit with those tips applied

Milled board with SOIC28, mini USB and SMD parts

NOTE:

I detected a small bug in pcb-gcode plugin. The first routing of the mill gcode file those not go to the default milling depth (the G01 Z-X.XXX FXXX instruction is not being generated). You must added it manually.

Cya next time.

Friday, August 31, 2012

3D preview of a PCB- EagleUP

I just found out about this plugin today. And man is it good.

It's the eagleUP plugin. It allows you to create a 3D view of your PCB design in Google's Sketch Up (my all time favorite 3D tool and the winner award for the most easy and comprehensive 3D software ever).

Sketch Up is designed for even a 3D noob like me to do wonders.

The wonderful thing about this plugin is that the model library is virtually endless. You can practically use any model from Google's warehouse (and there are plenty of them). Many users contribute for this library so it's always expanding.

This blog new background was done with it.

It's worth checking out. ;-)

Monday, August 27, 2012

Pimp my toy

The other day my 2-year old got a brand new firemen car that only played a sound or two and nothing more. The toy was quite dull but my kind was all over it because he loves everything with a siren.

I thought to my self. This ride need to be pimped. I said "Son I'm going to put an emergency light on that truck". He kept on going "Dadd...put...light...truck". Man was I under pressure.
So I did. I started to look at the car here:
Original toy

This is a 2xAA battery powered toy. So 3V doensn't allow me to use a popular 555 IC. To do a low voltage blinking led I needed and alternative circuit. So I remembered a simple oscillator circuit that is even easier to make. It' an astable multivabrator circuit made with 2 NPN transistors.

The circuit is similar to the one in this link.
Since this is such a low voltage application I replaced one of the collectors resistences by the LED directly.
This made the LED glow nicelly. I also changed some of the components values because of the LED blinking rate. The polarizing resistors were 47Kohm and the capacitors were 10uF. The transistors I used were a couple of BC549B I had laying around.

I took some prototyping pref-pcb and soldered the compontens. Don't mind the tallness of the components. I made this so I can (who knows) reuse them.


The astable multivibrator circuit

Looking at the toy there is a 2PDT switch that turns the toy on. The switch has 3 poositions OFF-DEMO-ON. So I will power the "blinker" in that switch for the ON position.


Identifying the ground and power spots

All soldered in place
 Then I took my dremel tool and drilled the roof of the toy bellow the light cover and glued it all in place with a hot glue gun.


Drilled roof top


Glued LED
 And here it is a PIMPED TOY CAR. The firemen truck now has a blinking light. I hope my son likes his "new" toy. ;-P

Toy with the added blinking emergency light

Friday, August 24, 2012

PCB - Post processing

So. Here is a little trick to post process a homemade PCB board.
This is valid for both mechanical and chemical echting.

This is a small USB bit whacker I made for quick prototyping. Well it's not that small but this is a first version and it's a single side board.

1º Step - DRILL

First step if you are not making the drilling with your CNC or you are making an chemical echting make all the drills on the board.

2º Step - DEBURR

Use a very fine grain sandpaper or oil stone do deburr all imperfections off the PCB. That will make it look like this photo.

Deburred PCB

OK don't mind that accidental cut on the pad...uugghhh. Looks very scratched doesn't it?
Let's make it pretty.

3º Step - "KIND OF" THIN PLATING
Hummm..thin plating finish would be nice. Well you can do something very similar. Apply a silver iodide (silver nitrate based compound) used to repair and clean jewelery. Here in Portugal there's a product called Pratex.
This will also ease the soldering work.

Here is a photo.

Finished PCB treatment

Nice!!
Despite the...uuuggghhhh...accident...uuuuggghhh (rush is your enemy). Looks quite good.



Thursday, August 23, 2012

Milling PCB in a CNC - The guide

OK. So here is a little resume of my process to make PCB with my crap of a CNC.

I'm using freeware version of Eagle to make the schematic and board and then I use pcb-gcode plugin to generate the gcode for the milling.

My steps are these:-Make the schematic and board in eagle.
-After all is in place use the Drc tool in eagle to check your clearances. To do this go to the clearances tab of the Drc tool and set all clearances according to this formula:

Minimum clearance = tool width + (2 * safety offset from pad/via distance)

Why?
Because using the same formula in the pcb-gcode plugin will allow you to make the PCB using 2 passes (making a PCB in a single pass doesn't always ensure proper isolation and almost always needs deburring and more the two passes is excessive and time consuming). The 2-pass isolation has yield the best results for me with a 10º v carbide bit. I'm still waiting for the 60º bit. I'm hopping it can produce similar results with a single pass. For now I'm sticking with 2.

The above formula is a reference and should be used has a reference only. If overlay occurs it's not the end of the world. The amount of overlay is the problem. Some SMD components might not even comply with the clearances. It's OK. But you should check the generated gcode for those places to see if they where properly isolated.

-Next configure pcb-gcode plugin. If you are going to work in metric units (mm) change the gcode-defaults.h in the setting folder of the pcb-gcode plugin to output the coordinates with only 3 decimal places after the floating point.

This is done by changing this line:
string FORMAT     = "%-6.4f ";      /* coordinate format */

To:
string FORMAT     = "%-6.3f ";      /* coordinate format */

Milling depth = -0.05mm
Remember most copper sheets in raw PCB is 35 microns (0.035mm). 0.05mm should be enough without going too deep.

Tool width = 0.2mm.
In my case I'm using a 0.1mm v-bit 10º. I set this to 0.2mm to compensate for run-out, vibration and bit wobbling (being such a thin bit it bends while trying to remove the copper. It's like forcing a needle to scratch a surface. Bending will occur. Also must compensate for the widening of the tip as it goes deeper.

Default isolation = 0.15mm
this is an other place where you can compensate for all the variables above. I prefer not to do it here. In here I like to put the amount safety margin to apply to pad/via clearance.

Isolation step <= Tool width.

Maximum isolation = Default isolation + Isolation step.
This insures 2-pass milling.

Don't forget to set the feeding speed. I'm using between 60 and 100mm/min. Faster then that bits will brake, deformations in isolation will be produced and you don't want that.

-After a good gcode is achieved It's milling time. Secure the PCB to the table in a way that avoids (un)leveling (usually the PCB is not perfectly flat due to storage conditions).
Two ways to do this.
The pro way. Use a vacuum table.
The cheap and dirty (but totally works). Double side scotch tape. This the one I use. It works (period). Read this.
Home the bit with one of the to procedures I've mentioned in a early post (Eagle2GCode - Part 2).

And you are good to go. You should be ready to start milling.

Good luck.

Tuesday, August 7, 2012

Eagle 2 GCode - Part 2

OK seems my early considerations where partially wrong. The depth of the engraving bit must be ~0.05-0.06mm.

My initial considerations where wrong because I was not homing the bit properly.

Two ways to home the bit (that are actually almost the same).


Homing method 1 (cheap and dirty) - Use an power source of some kind to drive an LED (in series with a resistor if not adequate to drive the LED directly) and use the contact between the bit and the raw copper as a switch to indicate if there is contact between both.
Here is a schematic.

Homing detection schematic


Homing method 2 (more precise) - Exactly the same but using on of inputs in the CNC control board/Software.

Note: For some reason the EMC 2 is rounding my GCode floats to the 0.1mm scale. Don't know why this is happening but I'm upgrading to EMC 2.5.0 seems to have fixed it. Also I had to reconfigure the gcode-default.h file of the pcb-gcode script to write floats with 3 digits after the dot separator. This prevent rounding errors of the gcode interpreter in the EMC 2 reported in arc movements in mm units.


This is a picture of my first trials.

From left to right - 1st attempt had a bad configuration was doing it half sized, next is 1,2mm deep with multiple passes (excessive), next reduced number of passes (still excessive), next at 1mm with one pass (still excessive but acceptable).

These are my SMD trials (just a simple SOIC8 circuit and a resistor)


1st SMD trial


1st SMD trial detail (depth 0.075mm to deep in the majority of the circuit)
2nd SMD trial detail (depth 0.05mm to shallow in some places)

Here are a few videos from the machine working.









Despite the results are not perfect I'm getting pleased with it. There are still a lot of headroom and some tricks in my sleeve to improve this with minimal changes.
Let's see how far I can take this.