Page 5 of 12 FirstFirst ... 2345678 ... LastLast
Results 49 to 60 of 138

Thread: Cheap & simple height-probing

  1. #49
    Registered
    Join Date
    Aug 2009
    Location
    Portugal
    Posts
    62
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by michael_m View Post
    Casainho: looking at your images, I don't see any probe grid paths, so I'm pretty sure it's a scale thing to do with your using inches ie your grid size is probably 20 inches (not 20mm) square. The default grid size is 20mm (and it's been suggested 10mm is probably better), so if you are using inches, try setting the grid size to be say 0.5 and see how that goes. If that works, change the default grid size in your python code to be 0.5 for your inch machine.
    Yes, looks like the problem is the inch instead of mm. Unfortunately pcb2gcode just outputs the gcode in inchs (mm is on TODO list).

    If you want to try my gcode file and develop your code, please get it from here: file "lyre_v1_io-Component.pho.ngc". That's for an Open Source project and so all the files are shared on that place, if you want to generate the gerber files you just need to used KiCad with that source files. Project page is here: http://lyre.sourceforge.net/


    Quote Originally Posted by michael_m View Post
    Re setting up the probe in EMC2: the documentation is there in the EMC2 wiki but you have to go looking for it... I used pin 13 because when I made a breakout board it was the easiest pin to connect to.

    I found these links useful:
    http://wiki.linuxcnc.org/emcinfo.pl?Touch_Probe
    (it tells you the line to add to your standard_pinout.hal file)

    http://wiki.linuxcnc.org/cgi-bin/emc...el_Port_Tester
    (gives you a little display that shows you whats happening on the parallel port pins when you fiddle with them)
    Thanks! With that links/info I got my probe working and did run that gcode that have problems at least until the probing... and it works! I got the "OK folks - power up the mill..." :-)

    So now I just need your code to work for me.

    Right now I am on Linux Ubuntu 8.04 because EMC2 just run on this version. I have here Python 2.4 and I get:
    Code:
    python Etch_Z_adjust.py 
    Traceback (most recent call last):
      File "Etch_Z_adjust.py", line 155, in <module>
        X_span = X_max - X_min
    NameError: name 'X_max' is not defined
    On Ubuntu 10.04 I get none errors, it goes perfect. I have Python 2.5 there.

    Quote Originally Posted by michael_m View Post
    If you can document the process as you discover it, it would be very helpful for others that follow - the EMC2 wiki is not detailed, and there may be other steps I've forgotten...
    I will... and I started to document before with title "CNC milling/drilling of PCB" but on KiCad Wiki page. I think that the best place may be on the EMC2 wiki. I will do it later, I promise. I usually do because later I forget what I did and than is best to read docs than have to do/discover all again :-)


  2. #50
    Registered
    Join Date
    Aug 2009
    Location
    Portugal
    Posts
    62
    Downloads
    0
    Uploads
    0
    Now it seems to work:



    At starting of your gcode, you put a "G21 (mm)" while the rest of code is in G20 (inchs). I just changed your gcode for G20 :-)

    The only question now seems that grid is with 1 inch, which is a lot, I think.

    Also looks to me that if the code mill a big line, the Z value is always the same all over the length of the line... which I think is a problem because there should be different Z values over all the line, right?
    Attached Thumbnails Attached Thumbnails Cheap &amp; simple height-probing-capturaecra.jpg  


  3. #51
    Registered
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    32
    Downloads
    0
    Uploads
    0
    Hey well done casainho! That inch / mm thing does my head in... I just stick to mm... I had a look at your first file and I couldn't work it out.

    I have a minor alteration to the code so you can use it in inches - the step size was previously required to be an integer (for no very good reason). I've changed it to allow a float value by altering the Tkinter instruction to ask for a float rather than an integer. So now you can make the step size as small as 0.05. Inch users should also look at the python intro for how to make the *two* minor changes that they will require. (These could be automated eventually)

    For all us mm users out there, I have changed the default grid size to 10 which based on PHK's previous experience will work better. Inch users should change this to eg 0.4

    Re long lines - Aha! I thought of that - buried in the intro you will read:

    "For long etch moves it puts in a way point every 5mm (or half the grid spacing if you change the 10mm default gridspacing) to calculate new heights as it goes along"

    So you should be fine.

    PS don't forget to change the file extension to .py after you download it!
    Attached Files Attached Files
    Last edited by michael_m; 07-28-2010 at 09:15 AM. Reason: corrected attached file (as above)


  4. #52
    Registered
    Join Date
    Aug 2009
    Location
    Portugal
    Posts
    62
    Downloads
    0
    Uploads
    0
    I get a warning while loading the gcode on EMC2: "Attempt to dive by zero" on this line:

    Code:
         #<waypoint_number> = fix[#<distance> / [#<_step_size>/2

    eheh, you forgot to change this line:
    Code:
    line =  '#<_step_size>     = %d' % (step_size)
    Ok, changed to:
    Code:
    line =  '#<_step_size>     = %.4f' % (step_size)
    And it look like to work :-)

    I hope to be able to test this today on my CNC. I will post pictures :-)


  5. #53
    Registered
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    32
    Downloads
    0
    Uploads
    0

    Corrected version!!!

    Change the first attached file to a .py file, the second to a .wav (otherwise it won't play...)
    Attached Files Attached Files


  6. #54
    Registered
    Join Date
    Aug 2009
    Location
    Portugal
    Posts
    62
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by michael_m View Post
    Change the first attached file to a .py file, the second to a .wav (otherwise it won't play...)
    I am sending a patch with my changes. You maybe did paste an error of G1 Z40 just after the probing!!!

    I went to test the probing and it worked but just after start milling all went wrong!! Looks like Z values are inverted :-(
    The pads of PCB were milling in air while when the bit should go upper in Z direction it was instead going down against the PCB :-(

    I am sending pictures and even the original gerber file and gcode.



    Attached Thumbnails Attached Thumbnails Cheap &amp; simple height-probing-img_2964.redimensionado.jpg   Cheap &amp; simple height-probing-capturaecra-38.jpg  
    Attached Files Attached Files
    Last edited by casainho; 07-28-2010 at 05:16 PM.


  7. #55
    Registered
    Join Date
    Aug 2009
    Location
    Portugal
    Posts
    62
    Downloads
    0
    Uploads
    0
    Michael, could you please share a gcode files you are using for testing etch_z_adjust.py? -- I would like to see the original e changed gcode files.

    Maybe the original gcode files I am using are not compatible with your etch_z_adjust.py program...


  8. #56
    tyo
    tyo is offline
    Registered
    Join Date
    Jul 2010
    Location
    indonesia
    Posts
    13
    Downloads
    0
    Uploads
    0

    Thumbs up

    hallo all....

    what the software of you use for gerber to G-code..??
    but it must be match with EMC2...
    tell me please,,, i beg..


  9. #57
    Registered
    Join Date
    Aug 2009
    Location
    Portugal
    Posts
    62
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by tyo View Post
    what the software of you use for gerber to G-code..??
    but it must be match with EMC2...
    I use "pcb2gcode".


  10. #58
    Registered
    Join Date
    Aug 2009
    Location
    Portugal
    Posts
    62
    Downloads
    0
    Uploads
    0
    Ok, I found a problem. My gcode was being generated like this:

    Code:
    ( Connected component 0: )
    G00 X0.099000 Y2.412000 ( rapid move to begin of connected component )
    G01 Z-0.010000 F20.000000 ( plunge )
    G64 P0.000400 ( set maximum deviation from commanded toolpath )
    X0.099000 Y2.412000
    X1.931000 Y2.412000
    (...)
    X0.093000 Y2.412000
    X0.097000 Y2.412000
    G61 ( mo more deviation! )
    G00 Z0.010000 ( retract )
    (Completed connected component 0.)
    And I believe G64 and G61 are the problems. Well, Michael already told me that on a PM but I didn't understand on that time.

    Since the pcb2gcode is OpenSource (yeah, OpenSource is the best!), I quickly went to sources and saw where that G64 and G61 are being printed... and then I found that I need to make "--max-deviation=0" parameter so pcb2gcode don't print G64 and G61. Now final gcode is (from other file):

    Code:
    ( Connected component 0: )
    G00 X0.529000 Y0.792000 ( rapid move to begin of connected component )
    O200 call [0.5290] [0.7920] [0.5290] [0.7920]
    O200 call [0.5290] [0.7920] [0.5290] [0.7920]
    O200 call [0.5290] [0.7920] [0.5420] [0.7920]
    O200 call [0.5420] [0.7920] [0.5420] [0.7280]
    O200 call [0.5420] [0.7280] [0.5230] [0.7280]
    O200 call [0.5230] [0.7280] [0.5230] [0.7920]
    O200 call [0.5230] [0.7920] [0.5270] [0.7920]
    G00 Z0.010000 ( retract )
    (Completed connected component 0.)


  11. #59
    Registered
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    32
    Downloads
    0
    Uploads
    0

    Etch_Z_adjust.py - default units are all in mm

    First of all, can I just say, Etch_Z_adjust.py works well, and has worked perfectly for me ever since I posted it.

    But, here is my set up: I take output from EAGLE 5.10 via PCB Gcode in millimetres, then run Python 2.5 from within EMC2 v 2.3.

    I have attached a G-code file that I used to make my break out board with, for you to see if it works for you too under your set up.

    The problems Casainho has had so far are due to my code not previously being adapted for use with inches. I never use inches! I had a look again, and my last inch fix was incomplete... there were still other default values (in mm) further on that I didn't remember (it was late at night here)... So I've picked them all out now (hopefully) and listed them all below, and in the intro to the program, so you know where and what to change...

    The latest code is the same working code, with instructions added on how to adapt it to inches.

    I agree that it would be good to automate the inch/mm thing, I'll do that further down the track - once I'm reassured I have picked up all the inch anomalies. Casainho, I'm sorry this has caused you these dramas - I just never use inches. Let me know if it works with inches after you make these extra changes.


    ## DEFAULT UNITS ARE ALL IN MM
    # If you need to use inches, you must change all of the following values in the five places listed below
    # (this could be automated later):

    # MM | INCHES

    # 1. set initial values
    # G_dest = '00' | '00' (yep - it's a string)
    # X_dest = -80 | -3.000
    # Y_dest = 40 | -2.000
    # Z_dest = 40 | -2.000

    # 2. if the line is an etch move, then replace the line with an etch call
    # if G_dest == '01' and Z_dest > -0.5:| -0.020

    # 3. G code configuration section
    # G21 (mm) | G20 (inches)
    # #<_etch_speed> = 120 | 4.000
    # #<_probe_speed> = 25 | 1.000
    # #<_z_safety> = 1 | 0.050
    # #<_z_probe> = -1 | -0.050
    # #<_etch_depth> = -0.15 | 0.005

    # 4. ignore trivial z axis moves
    # [#<z_etch> - #<_last_z_etch> ] lt 0.02]| 0.001

    # 5. Withdraw probe
    # G00 Z40 | Z2.000


    NB
    change Etch_Z_adjust extension to .py
    change breakout etc etc extension to .ngc
    Attached Files Attached Files


  12. #60
    Registered
    Join Date
    Aug 2009
    Location
    Portugal
    Posts
    62
    Downloads
    0
    Uploads
    0
    I got it! It seems to work very well! Here 2 pictures of what I got:



    Workflow
    • export the Gerber files from KiCad (select Plot Origin as Auxiliar Axis)
    • use pcb2gcode to convert Gerber files to Gcode, by executing on command line: pcb2gcode --verbose --zup=0.4 --zchange=1 --offset=0,010 --zdown=0,01 --max-deviation=0 --dpi=1000 --toolpath-smoothing-passes=0 example-Component.pho
    • execute etch_z_adjust.py: python etch_z_adjust.py
    • open the Gcode files with EMC2, run it and it will automatically probe and mill the PCB


    I am attaching the files I am being using.

    A big thanks to Michael and to Poul-Henning ;-)

    I will soon (tomorrow maybe) document all this on EMC2 wiki.
    Attached Files Attached Files


Page 5 of 12 FirstFirst ... 2345678 ... LastLast

Similar Threads

  1. My simple and cheap steel desktop router
    By fahque99 in forum DIY CNC Router Table Machines
    Replies: 6
    Last Post: 03-02-2009, 02:22 AM
  2. are there still no simple cheap good USB controllers?
    By lithium in forum Controller Cards
    Replies: 21
    Last Post: 01-16-2009, 02:49 PM
  3. Simple, cheap servo controll.
    By Kirbeh in forum Stepper Motors and Drives
    Replies: 4
    Last Post: 01-09-2008, 03:33 AM
  4. Simple cheap mill
    By JBV in forum Mechanical Calculations/Engineering Design
    Replies: 4
    Last Post: 11-22-2005, 06:20 PM
  5. Simple cheap CNC router
    By mwalach in forum DIY CNC Router Table Machines
    Replies: 7
    Last Post: 10-28-2005, 08:08 PM

Posting Permissions


 


About CNCzone.com

    We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

Follow us on

Facebook Dribbble RSS Feed


Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.