584,826 active members*
5,275 visitors online*
Register for free
Login
Page 1 of 3 123
Results 1 to 20 of 48
  1. #1
    Join Date
    Oct 2010
    Posts
    317

    Teensy Up/Down Torch Height Control

    I've created a THC with LCD using a Teensy 3.1 that works with a Mesa THCAD card to send up/down outputs out to a control. It works by reading the undivided frequency from the THCAD, mapping the range to the specifications provided on the THCAD card and then working the with target/hysteresis to set outputs. I have spent a significant amount of time testing different ways to print to the LCD to keep code impact minimal and I believe the run time is acceptable now. The board is just something I knocked out quickly in KICAD so I didn't have to keep using shields and such to connect the LCD, I have a limited understanding of electrical/Arduino coding so any input is appreciated.



    Code Features/Issues

    Features
    - 7-12 microsecond loop time
    - Adjustable hysteresis
    - Values can be saved to eeprom with encoder button and are automatically loaded on boot
    - EEPROM values can be recalled with encoder button
    - Can run on an Arduino UNO with a simple pin swap between button and frequency input, have not tested the effect of lower clock speed. Teensy is running at 96 MHz vs 16 MHz on Uno.

    Issues
    - Currently I lock the output to off if the voltage it outside 100-150 volts (I map the undivided frequency from the THCAD to the specifications provided on the card and do the math to get back to tip volts) but this has a problem if the torch starts and falls below 100 while moving it will never recover. I was thinking to either move the floor down to around 50 volts or have a moving floor/ceiling that is target +- 50volts?

    Source
    https://github.com/limited660/Teensy-Plasma-THC-Master



    PCB Features/Issues

    Features
    - IDC sockets for Reprap Smart Controller LCD (SD card, buzzer, and reset button not wired, ideas for use?)
    - Female headers for plugging in the Teensy
    - Male headers for all of the pins going to the female headers
    - Headers for VIN and GND
    - Screw terminals for THCAD and Outputs

    Issues
    - No power input (I also didn't want to cut the USB jumper on the Teensy but power could be added as long as you don't use power and USB)
    - Output/THCAD/Teensy grounds not all shared, maybe add jumper to connect output ground to the others that can be cut?
    - IDC connector for EXP2 hangs off board
    - Use plugs instead of screw terminals for THCAD/Outputs?
    - Limited mounting options
    - Some pins have odd traces (+ jumper all connected on top but only 3 connected on bottom layer, minor but annoying)
    - Requires Mesa THCAD

    Source
    - To be added later



    A short video of it in action with UCCNC and a UC100

    https://www.youtube.com/watch?v=GcG85IwxP2Y

  2. #2
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    Very nice. What frequency divider are you using on the THCAD?

    Is the THCAD mounted at the plasma end or the controller end? Mine is at the controller end but with the benefit of hindsight, it should be at the plasma end because the frequency output by the THCAD travelling across the interconnecting cable is much more immune to noise than a divided torch voltage.

    Dependence on the Mesa THCAD board is not a concern at all in my view. It gives you robust state of the art A/D conversion specifically designed for the noisy plasma environment. Because each board is individually calibrated, its highly accurate and has a very fast response (we measured about 5ms rise time) so your THC is tracking whats happening now, not a few cycles ago.

    For $70 its a steal!
    Rod Webster
    www.vehiclemods.net.au

  3. #3
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by rodw View Post
    Very nice. What frequency divider are you using on the THCAD?

    Is the THCAD mounted at the plasma end or the controller end? Mine is at the controller end but with the benefit of hindsight, it should be at the plasma end because the frequency output by the THCAD travelling across the interconnecting cable is much more immune to noise than a divided torch voltage.

    Dependence on the Mesa THCAD board is not a concern at all in my view. It gives you robust state of the art A/D conversion specifically designed for the noisy plasma environment. Because each board is individually calibrated, its highly accurate and has a very fast response (we measured about 5ms rise time) so your THC is tracking whats happening now, not a few cycles ago.

    For $70 its a steal!
    I'm using full frequency (undivided) with a 10 millisecond gate interval, library is here - https://www.pjrc.com/teensy/td_libs_FreqCount.html The THCAD is in the main control box which is about 10 ft from the plasma cutter, I haven't noticed any issues with the voltage readings yet but that's a fairly simple change if I have to move it closer...the hardest part would be getting 5v to the board at the plasma end! It would be nice if 5v was available inside the unit and I could just swap the voltage divider wires for frequency count wires but that's a bit of work.

    Do you have any input on how the Teensy should handle voltages that are far away from the target? I know I definetly need to recode to handle voltages under 100v but unsure of what to do with drops/rises after a certain range.

  4. #4
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    I don't think you will have any issues with a 10' cable. I'm using a 16' cable with 16:1 divided voltage and the THCAD-10. I did quite a bit of testing with a 96 volt power supply (2 x 48v in series) through the internal Everlast voltage divider and there was no discernable voltage loss from the plasma to the control box. There is the possibility of the cable acting as an antenna in relation to noise. In fact I did have some issues with noise which I resolved by putting a RFI filter on the IEC mains input into the control box. At one stage, I added some filtering on the raw arc signal in the plasma cutter but recently removed it as the control box filtering solved the noise and in some tests others observed delays in the signal with too much filtering on the arc voltage. I did locate a 12v power source inside the plasma so if I relocated the THCAD, I'd step that down to 5v.

    I am using Linuxcnc and the Mesa 7i76e ethernet board. Its recommended to use the 1/32 divider in software so thats what I do. A couple of others and I are focussing on PID based THC within Linuxcnc's core. I am using an experimental branch of Linuxcnc that uses a Z axis offset that is external to the trajectory planner and progress has been slow. I've written a few custom components to deal with decoding THCAD torch voltage, torch arc sampling, velocity antidive (corner lock) and today I started to gather some data on kerf and void crossing to finalise an algorithm to sense it. . The velocity hold (corner lock) is difficult to do with an external THC as you don't know the velocity but trivial in software in about 10 lines of code.
    Rod Webster
    www.vehiclemods.net.au

  5. #5
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by rodw View Post
    I've written a few custom components to deal with decoding THCAD torch voltage, torch arc sampling, velocity antidive (corner lock) and today I started to gather some data on kerf and void crossing to finalise an algorithm to sense it. . The velocity hold (corner lock) is difficult to do with an external THC as you don't know the velocity but trivial in software in about 10 lines of code.
    It's built into the UCCNC. You can set velocity drop % to make the controller to lock the THC control below that %.
    You can also lock/unlock the THC using macro codes.

  6. #6
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    Re voltages, in my testing, I took 16000 readings 1 ms apart at torch heights varying by 0.05mm from 1.5mm to 2.45mm on 8mm steel
    I then discarded the data where the height was changing. This left me with about 460 readings per height tested.
    I've attached the regression analysis of this data which shows a linear relationship at 99.4% confidence!
    The reason I did this was an earlier test with just a few readings indicated that torch height was not linear and followed a 3rd order polynomial s curve with a pronounced plateau.
    So in answer to your question, I don't think you should treat lower voltages any different.

    One thing that has made a difference is torch voltage sampling before enabling the THC. This ensures the commanded voltage is right on the actual voltage so there is no jump when THC is enabled. Something you could add to your THC fairly easily.
    Rod Webster
    www.vehiclemods.net.au

  7. #7
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by OlfCNC View Post
    It's built into the UCCNC. You can set velocity drop % to make the controller to lock the THC control below that %.
    You can also lock/unlock the THC using macro codes.
    Which is exactly what Linuxcnc now does for us (including enable/disable THC from gcode). Traditionally LinuxCNC's THC components used a bit bang approach the same as the external THC's out there even if they were using the THCAD board while we are using LinuxCNC's trajectory planner for much tighter integration with the trajectory planner. Here's samco's in action:
    https://youtu.be/mOg5C_TusdM
    Rod Webster
    www.vehiclemods.net.au

  8. #8
    Join Date
    Aug 2013
    Posts
    112

    Re: Teensy Up/Down Torch Height Control

    Hi

    My THCAD is mounted close (on top of) the my plasma power supply. The controller is connected through a 25' piece of shielded cat5 cable.

    Attachment 397124

    John

  9. #9
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by rodw View Post
    Re voltages, in my testing, I took 16000 readings 1 ms apart at torch heights varying by 0.05mm from 1.5mm to 2.45mm on 8mm steel
    I then discarded the data where the height was changing. This left me with about 460 readings per height tested.
    I've attached the regression analysis of this data which shows a linear relationship at 99.4% confidence!
    The reason I did this was an earlier test with just a few readings indicated that torch height was not linear and followed a 3rd order polynomial s curve with a pronounced plateau.
    So in answer to your question, I don't think you should treat lower voltages any different.

    One thing that has made a difference is torch voltage sampling before enabling the THC. This ensures the commanded voltage is right on the actual voltage so there is no jump when THC is enabled. Something you could add to your THC fairly easily.
    Well it's not exactly lower voltages I'm concerned with. When I was doing the testing in the video it appeared the voltage was dropping down to around 90v after the pierce and move to initial height probably due to the angle of the sheet and because it was below 100 the Teensy never sent a signal. I just picked a range of 100-150 because I didn't see anything below 116 in the manual for 45 amps and assumed wrongly that it wouldn't drop that fast that I couldn't compensate. I would still like to maybe block outputs if it exceeds a certain value past the target but that might only be a good idea in stopping the torch from dropping rather than going up, I guess I will look at +-X number from target or a percentage of the target for blocking. UCCNC does have anti-dive commands and feed rate locks for the THC and it's my understanding the THC signals are handled by the controller (UC100), not sent back and forth between the computer and controller, so it acts quite quickly on the signals.

  10. #10
    Join Date
    Aug 2013
    Posts
    112

    Re: Teensy Up/Down Torch Height Control

    tjb1

    The THC should not be enabled until after the arc voltage is stable. On my system that is a delay >.30s (yours will be different) from the arcok signal from the plasma power supply. I recommend that you start with your THC servo delay at about 1s and shorten it only if needed on thin sheet. If you ever plan on using other consumables the arc voltage can be as low as 70v or less.

    John

  11. #11
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by islander261 View Post
    tjb1

    The THC should not be enabled until after the arc voltage is stable. On my system that is a delay >.30s (yours will be different) from the arcok signal from the plasma power supply. I recommend that you start with your THC servo delay at about 1s and shorten it only if needed on thin sheet. If you ever plan on using other consumables the arc voltage can be as low as 70v or less.

    John
    UCCNC has built in pierce delay parameter with setable time. That blocks the THC after arc on for the set time.

  12. #12
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by tjb1 View Post
    Well it's not exactly lower voltages I'm concerned with. When I was doing the testing in the video it appeared the voltage was dropping down to around 90v after the pierce and move to initial height probably due to the angle of the sheet and because it was below 100 the Teensy never sent a signal. I just picked a range of 100-150 because I didn't see anything below 116 in the manual for 45 amps and assumed wrongly that it wouldn't drop that fast that I couldn't compensate. I would still like to maybe block outputs if it exceeds a certain value past the target but that might only be a good idea in stopping the torch from dropping rather than going up, I guess I will look at +-X number from target or a percentage of the target for blocking. UCCNC does have anti-dive commands and feed rate locks for the THC and it's my understanding the THC signals are handled by the controller (UC100), not sent back and forth between the computer and controller, so it acts quite quickly on the signals.
    as said, if you are using the THC enable delay from your controller, you should wait a bit before enabling thc. This voltage plot on 8mm plate might help understand whats going on. I use a 1.5s delay on this material.
    Attached Thumbnails Attached Thumbnails Screenshot at 2018-07-07 13:46:10.jpg  
    Rod Webster
    www.vehiclemods.net.au

  13. #13
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    and another on 2mm plate. one of my early THC tests. you can see its been annotated with where the THC was enabled.

    Rod Webster
    www.vehiclemods.net.au

  14. #14
    Join Date
    Aug 2013
    Posts
    112

    Re: Teensy Up/Down Torch Height Control

    tjb1

    Just so things are clear the pierce delay has no relationship to the THC servo delay other than they both start with the arcok (or ok to move) from the plasma power supply going true. You really need both. Sorry I have no knowledge of how uccnc works. Rod's halscope captures show it all.

    John

  15. #15
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Servo delay is how long we are waiting after receiving arc ok before acting on up/down signals? Pierce delay is just how long after starting the arc that it waits before moving to cutting height correct? I'm having trouble reading the text on those pictures.

  16. #16
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    I have no clue how linuxcnc works, but I think what you refering as "THC servo delay" is the same what I'm refering as pierce delay.
    When the THC is turned on then the THC control (up/down) is disabled for a specified amount of time.
    Or if your THC servo delay is different then please explain what it is.

  17. #17
    Join Date
    Aug 2013
    Posts
    112

    Re: Teensy Up/Down Torch Height Control

    tjb1

    Correct! Pierce delay is the time from arcok to when the torch starts to descend to cutting height. THC servo delay (or what ever you want to call it, I am trying to be generic here) is the time from arcok until the THC takes control of the z axis height based on the arc voltage.

    Yes that is my biggest gripe with halscope plots is that there is no data only way to easily share plot, screen capture only.

    John

  18. #18
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    OK then we were talking about the same thing just named things differently.

  19. #19
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by tjb1 View Post
    Servo delay is how long we are waiting after receiving arc ok before acting on up/down signals? Pierce delay is just how long after starting the arc that it waits before moving to cutting height correct? I'm having trouble reading the text on those pictures.
    It looks like the forum downsamples the images. E:command is the voltage set point you want to achieve (95 volts in this example), curvolt is the actual torch voltage from THCAD. The time scale is 1 second per each horizontal line. The blue line at the bottom is the error between the setpoint and the actual volts at a higher scale. You can see the THC is enabled below the desired voltage and the PID unit initially overcorrects before oscillating to settle on a stable value on the set point.

    The gap between the actual volts and the desired volts is the reason why I now sample the torch volts. Initially I just grabbed one reading when the THC servo delay expired but now I have rewritten it to calculate a moving average of 100 readings (eg. average over the last 0.1 second). The averaging commences once we get an ArcOK so that we know we will have a full buffer of 100 samples by the time the Servo Delay expires. I've just bench tested that its working this morning and I'm off to confirm its working. Its a bit tricky to calculate the average in an Interrupt Service Routine as you can't use loops but I've come up with an algorithm that does it with some pointers and a buffer for the readings. We add the current reading and subtract the oldest reading and return that sum divided by number in the buffer. Time will tell how large the buffer (eg the number of readings averaged) needs to be.
    Rod Webster
    www.vehiclemods.net.au

  20. #20
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    One more thought. I would also experiment with the 1/32 divider on the THCAD (Don't forget to adjust your calibration values). Its possible the slower sample time might help generate a more stable signal due to the THCAD's Sigma Delta ADC.
    Rod Webster
    www.vehiclemods.net.au

Page 1 of 3 123

Similar Threads

  1. Torch height control
    By drieslaas in forum CNC Plasma / Oxy Fuel Cutting Machines
    Replies: 5
    Last Post: 05-11-2015, 04:13 PM
  2. Torch height control
    By Bobnire in forum Waterjet General Topics
    Replies: 3
    Last Post: 12-16-2012, 10:48 AM
  3. Torch Height Control
    By Rxe in forum Waterjet General Topics
    Replies: 7
    Last Post: 04-07-2010, 12:09 PM
  4. Torch Height Control
    By luther in forum Plasma, EDM / Other similar machine Project Log
    Replies: 4
    Last Post: 07-12-2007, 09:51 PM
  5. Torch Height Control / Capacitive Height Control
    By ahlbebuck in forum Open Source Controller Boards
    Replies: 0
    Last Post: 11-27-2006, 08:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •