Welcome to Our Community

Some features disabled for guests. Register Today.

Standalone Torch Height Controller for CNC Plasma Cutting

Discussion in 'Laser Cutters' started by Retsaj, Oct 7, 2020.

  1. bpresten3

    bpresten3 New
    Builder

    Joined:
    Feb 27, 2024
    Messages:
    5
    Likes Received:
    0
    I have a question I see the drawing you have shows a 50:1 coming from the plasma cutter voltage divider. What if your plasma cutter has a 1:1 output how do you suggest wiring to the thc. Would you still install the cap?
     
  2. Drell8345

    Drell8345 New
    Builder

    Joined:
    Mar 22, 2024
    Messages:
    1
    Likes Received:
    0
    I am building the THC controller and have hit a snag with the screen I have the screen you have stated and uploaded the gui file from the site, but I keep getting the same error message on the screen "File Version is Too low" I am not so good on Gui and I am stuck I have tried different SD cards but still get the same error
     
  3. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,353
    Likes Received:
    4,190
    Note connecting and disconnecting a powered stepper motor from its driver -even by relay - will ruin your stepper driver. Not if, but when.
     
    David the swarfer likes this.
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,353
    Likes Received:
    4,190
    Hook up an oscilloscope watch the peaks of all the back EMF and cable inductance dumping back into the drivers at the time it switches. Learn more here

    "10ms" has no bearing here either - stepper drivers doesn't run on AC frequencies, nor are their phases synced. TMC2160s has a 12Mhz clock - not 60Hz. By your (still invalid, there is a better way) theory you'd need a switchover time of under 12,000,000th/sec (12Mhz) and if you are off by half that between switches you could hit the sine wave at opposing times making things even worse. Not to mention that the two drivers won't be in sync (or even perfectly 180deg out of sync) to begin with

    What do you think flows between the driver and stepper motor other than Power? Not just plain DC or AC either - a complex chopper stepped pseudo wave at set current and variable voltage. They are constant current devices, you break the connection, resistance becomes infinate, constant current driver tries to compensate. You have to think about what this actually is. Its not a Mains powered UPS - 10ms switching is irrelevant.

    Tolerance = for occational mistakes like a wire break, not daily use multiple times per job.

    Now, the RIGHT way to do this would have been to keep PSU>DRIVER>MOTOR as a unit. Switch the SIGNALS :) relay on step/dir/enable between controller and THC

    Same as how the commercial THCs do: Internal relays switch the control signals, long before it gets to the Driver, exactly so you don't cause motor wire disconnect/connects - they really are bad for your drivers!

    [​IMG]
     
    #64 Peter Van Der Walt, May 14, 2024
    Last edited: May 14, 2024
    David the swarfer likes this.
  5. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    14,353
    Likes Received:
    4,190
    Second one, but I would not switch GND. Leave it connected (safer all round than floating grounds and alternative ground paths).
    Just DIR/STEP/ENABLE
    I still suspect the out-of-band THC will cause Z-height issues but thats something one may be able to work around with touchoff probes rezeroing etc - will have to see how it plays out.
     
  6. cnc-trucker

    Builder

    Joined:
    Mar 20, 2024
    Messages:
    2
    Likes Received:
    4
    Jeramiah, in one of your posts in this forum topic, you stated that if anyone could integrate your THC into a GRBL machine, you would like to know how they did it. Well, I have done it...
    You can check out the new source code (with due credit to you, of course!) at my GitHub fork of your repository.

    Basically, I re-wrote your code into an ISR -- the program monitors the ARC-OK signal and, when received, triggers an interrupt to assume control of the Z-axis during the cut. When not actively cutting, the program simply passes the Z-axis pulses on to the stepper motor driver from the GRBL controller un-altered.

    I also changed the plasma voltage mapping you used (to accomodate Everlast's 0-3 volt arc voltage range) to map(analogRead(PLASMA_INPUT_PIN) + CalibrationOffset, 0, 1023, 0, 16500), so now it works on the Everlast 62i/ 82i/102i cutters without having to resort to full arc voltage and a home-brew voltage divider.

    In the process of re-writing your code, I fixed many minor coding issues that kept the Nextion display from being updated and -- as a side result -- kept values from being stored in the EEPROM. Nextion has changed a lot of their firmware, and I believe that they simply changed the methods you used to pass values to the display; the EEPROM issues were caused by a conflict between data types.

    I changed the EEPROM address allocation routine to use pointers to assign and pass the EEPROM addresses instead of the values themselves, then passed that pointer to other functions (EEPROM.readInt(*addressPage1) instead of EEPROM.readInt(addressPage1); this saved on memory usage, too.

    As for the Nextion functions, most of them require that values passed to them be cast to uint32_t instead of just passing the native int value -- once I cast them properly, and put the serial initialization code into the "Splash Screen" pre-initialize event code (you forgot to in the HMI file in your repository), the display functioned properly and showed/ stored data as it should.

    As I said, the THC works well now -- with only one issue that I am trying to figure out. At the very end of the cut, when the THC is passing control back to GRBL, it seems to want to dive into the metal -- I believe that it relates to your code block
    Code:
      //after cut reset height
      pos = 0;
      //do move
      stepper.moveTo(pos);
      while (stepper.distanceToGo() != 0) {
        stepper.run();
      }
    
    at the end of the height following routine. I saw no initialization of the torch height by the THC at the start of the interrupt, so I believe that it simply doesn't know where to reset the height to when it finishes.

    Here is a short video of this THC in action, attached to this post. I've also attached a wiring diagram for an entire Mega 2560-based GRBL machine, complete with limit switches & this THC.
     

    Attached Files:

    #66 cnc-trucker, May 31, 2024
    Last edited: Jun 1, 2024
    mleaming and Giarc like this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice