584,808 active members*
5,158 visitors online*
Register for free
Login
Page 2 of 3 123
Results 21 to 40 of 48
  1. #21
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by rodw View Post
    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.
    Right now it is checking the frequency every 10 milliseconds, you still think it would be better to divide it? I think the gate interval would need to be higher then because I have less digits in the frequency count and dropping a higher amount (I haven't figured out what volts I would be losing yet).

    I did a bit of work on the code today, added a min and max volt variable and lowered the min from 100 to 25. Also removed all serial commands and code timing and cleaned up unused variables.

  2. #22
    Join Date
    Feb 2008
    Posts
    644

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by tjb1 View Post
    Right now it is checking the frequency every 10 milliseconds, you still think it would be better to divide it? I think the gate interval would need to be higher then because I have less digits in the frequency count and dropping a higher amount (I haven't figured out what volts I would be losing yet).

    I did a bit of work on the code today, added a min and max volt variable and lowered the min from 100 to 25. Also removed all serial commands and code timing and cleaned up unused variables.
    If you are simply frequency counting you should use the 1:1 (~1 MHz full scale) THCAD setting to get the best resolution

    The reason you do not lose resolution at lower frequencies (say 1:32) with a Mesa/LinuxCNC setup is that the THCAD frequency
    is read via an encoder input and Mesa encoder hardware +LinuxCNC driver does n/t(n) velocity estimation which calculates frequency by counting pulses
    _and_ the time between the first and last pulse per interval (not just pulses per interval) so its frequency resolution is independent of actual frequency

  3. #23
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by PCW_MESA View Post
    If you are simply frequency counting you should use the 1:1 (~1 MHz full scale) THCAD setting to get the best resolution

    The reason you do not lose resolution at lower frequencies (say 1:32) with a Mesa/LinuxCNC setup is that the THCAD frequency
    is read via an encoder input and Mesa encoder hardware +LinuxCNC driver does n/t(n) velocity estimation which calculates frequency by counting pulses
    _and_ the time between the first and last pulse per interval (not just pulses per interval) so its frequency resolution is independent of actual frequency

    I've looked at switching to FreqMeasure but even dividing at the max, its still too high to use due to the 1k max (THCAD output at F/128 = 935 low, 7238 high) - https://www.pjrc.com/teensy/td_libs_FreqMeasure.html

  4. #24
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by tjb1 View Post
    Right now it is checking the frequency every 10 milliseconds, you still think it would be better to divide it? I think the gate interval would need to be higher then because I have less digits in the frequency count and dropping a higher amount (I haven't figured out what volts I would be losing yet).

    I did a bit of work on the code today, added a min and max volt variable and lowered the min from 100 to 25. Also removed all serial commands and code timing and cleaned up unused variables.
    For what reason did you use that mesa thc card?
    I mean you could sample the analog voltage with an A/D converter on the Teensy. Isn't there an analog port on it?
    You just need some resistors to divide the voltage and some capacitors to smooth it out.
    Then you could get rid of the THC card making the controller much cheaper and easier to get for others. (in case you want to make a product out of it.)

  5. #25
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by OlfCNC View Post
    For what reason did you use that mesa thc card?
    I mean you could sample the analog voltage with an A/D converter on the Teensy. Isn't there an analog port on it?
    You just need some resistors to divide the voltage and some capacitors to smooth it out.
    Then you could get rid of the THC card making the controller much cheaper and easier to get for others. (in case you want to make a product out of it.)
    I was originally using it with LinuxCNC but I moved away from that because I was struggling with Linux and it made using the Teensy very easy. I don't really have enough electronics knowledge to do it myself.

  6. #26
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    I see. I understand you have not much knowledge in electronics, but it looks to me that you have knowledge in programming.
    And I think you know that with 2 resistors you can divide the voltage and if the Teensy has an analog input channel then you can sample the voltage of it.

  7. #27
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by OlfCNC View Post
    I see. I understand you have not much knowledge in electronics, but it looks to me that you have knowledge in programming.
    And I think you know that with 2 resistors you can divide the voltage and if the Teensy has an analog input channel then you can sample the voltage of it.
    I originally started doing that when I first built my table - https://www.cnczone.com/forums/stepp...t-control.html

    Now that this works I guess I could make another board with room for a divider and see if I could get it working that way.

  8. #28
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    I've added a new function to button hold. Holding the encoder button when not on ButtonPress 1 or 2 (not editing Tip Target or Hysteresis) will disable the voltage monitoring and outputs. It also writes this status to the EEPROM so it is remembered on power change.

    I'm thinking of adding a function to double press that would work the same (when not on ButtonPress 1 or 2) that would alternate toggling the outputs for testing but it seems a bit too easy to enter and unintentionally toggle the outputs.

    Does anyone have any ideas for new features to add?

  9. #29
    Join Date
    Sep 2005
    Posts
    287

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by OlfCNC View Post
    For what reason did you use that mesa thc card?
    I mean you could sample the analog voltage with an A/D converter on the Teensy. Isn't there an analog port on it?
    You just need some resistors to divide the voltage and some capacitors to smooth it out.
    Then you could get rid of the THC card making the controller much cheaper and easier to get for others. (in case you want to make a product out of it.)
    A couple of years ago I used an AVR to interface between a Mesa THCAD and the PC. Initially I looked into a basic voltage dividing and smoothing circuit feeding into the AVR A/D converter. I asked a few electronic gurus about filtering and they made out it's not that simple for something like a plasma arc (noisy, spikey, etc). I've also traced the circuit of a commercial THC high voltage board and it certainly has more than just some capacitors. There's inductors for suppressing rate of rise of current, capacitors to smooth voltage, and zener diodes and voltage suppressors. They were all in an "H-bridge" type of arrangement with the components being in both the positive and negative legs.

    In my search for filtering circuits I also came across the increasing delay effects as the smoothing is made more effective. So basically I just thought it would be easier to get a THCAD card and use an AVR to measure the frequency. The THCAD has everything built in - filtering, Sigma Delta A/D (which I've heard are one of the best for noisy signals), and opto isolation with a TTL frequency O/P. I could choose what voltage sampling rate I used simply by how long I count the raw pulses (i.e. not divided).

    So definitely agree, it's a bit more expensive but it was more of a convenience issue for myself, and saved me a lot of research, testing, etc.

    It worked well and I had the voltage readings being displayed in real time on a PC terminal at 62 times/sec during cutting. The readings were quite close to what was displayed on my plasma screen. For a basic THC UP/DOWN output system (not a PID system) that's plenty. There's so much talk of fast PID systems and they have their place for when you're cutting thin sheet and need very fast THC speed and reaction, but for a lot of general cutting of not so thin stuff I think they are over-rated, and certainly NOT necessary. Even at a fast XY feedrate of 10,000 mm/min the torch only travels 2.7mm between THC UP/DOWN signals from the THC, so for the more common slower cutting there's no problem.

    The THCAD also has reasonable resolution when measuring the undivided span of approx. 800,000 counts (zero to max voltage = 100,000 to 900,000 hz) 62 times/sec. You get 1,613 - 14,516 counts for 0 - full scale volts.

    It's just a nice convenient little board ready to perform. I just hope Mesa have got their act together since the time I bought. Back then I waited 6 weeks, and sent multiple emails (which were ignored) only to finally find my board had not even been sent. Mesa didn't even give a tiny apology. I was furious at their attitude. Pity because Mesa products are quite highly regarded. I ended up paying significantly more and buying from a distributor (also overseas) who delivered very fast. There were many other people back then having the same problem but maybe that's changed now.

  10. #30
    Join Date
    May 2015
    Posts
    684

    Re: Teensy Up/Down Torch Height Control

    As far as I'm concerned, Mesa provide service second to none. I had an accident and fried my THCAD and the encoder input that it was connected to. Rather than just take my money and sell new hardware, they told me how to check if the encoder was working or not (it wasn't) and suggested I try replacing a $3 chip on the THCAD initially. That did not work but as I had fried the encoder A input on my $300 mesa 7i76e board, they wrote new firmware for me to put the encoder A input on the encoder B input while I was sleeping!

    In fact, Peter from Mesa has already provided clarity about one issue on this thread already.

    My take on previous supply issues is that Mesa are more of a wholesale distributor and not geared up for retail sales. These days, they've appointed a reseller to look after guys like you and I which is run by one of the LinuxCNC stalwarts John Thornton. I've had excellent service from John on his store at https://mesaus.com/
    Rod Webster
    www.vehiclemods.net.au

  11. #31
    Join Date
    Sep 2005
    Posts
    287

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by rodw View Post
    As far as I'm concerned, Mesa provide service second to none. I had an accident and fried my THCAD and the encoder input that it was connected to. Rather than just take my money and sell new hardware, they told me how to check if the encoder was working or not (it wasn't) and suggested I try replacing a $3 chip on the THCAD initially. That did not work but as I had fried the encoder A input on my $300 mesa 7i76e board, they wrote new firmware for me to put the encoder A input on the encoder B input while I was sleeping!

    In fact, Peter from Mesa has already provided clarity about one issue on this thread already.

    My take on previous supply issues is that Mesa are more of a wholesale distributor and not geared up for retail sales. These days, they've appointed a reseller to look after guys like you and I which is run by one of the LinuxCNC stalwarts John Thornton. I've had excellent service from John on his store at https://mesaus.com/
    That's great to know about Rod. I'll buy from there next time.

    Product support, and the selling system are 2 different things.

    Your take on the previous supply issues means they should not have had a selling website where the public could go and buy one product. Either you sell retail or you don't. You can't just put up an ecommerce site with a minimum quantity of one, take credit card payments, then simply not deliver and blatantly ignore customers emails for weeks on end. THAT is exactly what happened to me and a few others back then. If there were some problem then advise the customer but don't just ignore them. As I said I got no explanation and no apology. I didn't even need to get a refund because if I remember correctly, no money had been taken from my card and after 4 weeks it could not be taken. So for 2 weeks after that 4 week period I was pointlessly waiting for an order that could not even be paid for without a new order.

    I feel very unlucky because I'd only ever heard good things about Mesa products and Peter I believe it is, and despite my experience, as you can see from my previous post, I'm actually recommending Mesa products. I just wanted to warn potential buyers in case this situation was still happening.

    I'm glad your experience has been great.

    Keith.

  12. #32
    Join Date
    Jul 2003
    Posts
    1753

    Re: Teensy Up/Down Torch Height Control

    BTW - the video rob posted earlier (cutting corrugated sheet) was using a mesa THCAD, mesa 5i25 interface card and hal. No other hardware. The pid loop was closed within linuxcnc. It was a proof of concept and I haven't gotten back to finish it up. (although any one could do it - I think even with the printer port)

    sam

  13. #33
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Tonight I've done some more testing with the code and a Teensy LC which will also fit the PCB with no modification. The Teensy LC has a loop time of 15.5 microsecond using "Faster with LTO" optimization and 48MHz CPU speed while the Teensy 3.1 has a loop time of 5.5 microsecond using "Fastest with LTO" optimization with 96MHz CPU speed. I also tried 120MHz CPU speed on the 3.1 but results weren't much different so I left it alone. Teensy LC is ~$12 while the 3.1 (3.2) is ~$20 so it's a small savings if someone is interested in building their own. Teensy 3.2 looks to have no benefits over 3.1 in this application so do not worry about getting it if you already have a 3.1 board.

    Also some more small fixes to LCD printing where it wasn't clearing "SAVED" in certain circumstances. Tomorrow I'm going to mess around with how I set outputs to see if I can get a little more speed out of it by checking to see if it's already active, right now it's only checking voltage vs target and hysteresis and always does something to an output. Probably at the point of diminishing returns but it's a fun little project.

  14. #34
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by tjb1 View Post
    Tonight I've done some more testing with the code and a Teensy LC which will also fit the PCB with no modification. The Teensy LC has a loop time of 15.5 microsecond using "Faster with LTO" optimization and 48MHz CPU speed while the Teensy 3.1 has a loop time of 5.5 microsecond using "Fastest with LTO" optimization with 96MHz CPU speed. I also tried 120MHz CPU speed on the 3.1 but results weren't much different so I left it alone. Teensy LC is ~$12 while the 3.1 (3.2) is ~$20 so it's a small savings if someone is interested in building their own. Teensy 3.2 looks to have no benefits over 3.1 in this application so do not worry about getting it if you already have a 3.1 board.

    Also some more small fixes to LCD printing where it wasn't clearing "SAVED" in certain circumstances. Tomorrow I'm going to mess around with how I set outputs to see if I can get a little more speed out of it by checking to see if it's already active, right now it's only checking voltage vs target and hysteresis and always does something to an output. Probably at the point of diminishing returns but it's a fun little project.
    Another idea for your project is to send data back to the UCCNC, like the set voltage and maybe even make it setable onscreen.
    Here is a nice example video of what I mean, it is UCCNC with modified screenset (NeuronTHC screenset):


  15. #35
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by OlfCNC View Post
    Another idea for your project is to send data back to the UCCNC, like the set voltage and maybe even make it setable onscreen.
    Here is a nice example video of what I mean, it is UCCNC with modified screenset (NeuronTHC screenset):

    That requires using modbus correct? I've been looking to learn modbus just for more inputs without buying another board but just haven't had the time.

  16. #36
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    KICAD and gerber files for the PCB have been added to Github, I haven't fixed the issue of the IDC socket hanging off the edge of the board yet but that's minor and it will still work.

  17. #37
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    I think the Neuron THC using ethernet connection and it's own communication via plugin, but the UCCNC has a modbus master plugin.
    I have used that for some experiments and it is simple to use. You just setup a communication channel, a COM port or virtual COM on USB or TCP/IP and you write and read into the UCCNC modbus registers and then it sends the data via the communication channel. The harder part is probably the Teensy side of coding to receive and send data.

  18. #38
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    Quote Originally Posted by OlfCNC View Post
    I think the Neuron THC using ethernet connection and it's own communication via plugin, but the UCCNC has a modbus master plugin.
    I have used that for some experiments and it is simple to use. You just setup a communication channel, a COM port or virtual COM on USB or TCP/IP and you write and read into the UCCNC modbus registers and then it sends the data via the communication channel. The harder part is probably the Teensy side of coding to receive and send data.
    I've found a few examples of modbus on arduino but it's all a bit over my head at the moment. Do you know of any examples with modbus on UCCNC? Most of what I find is for Mach.

  19. #39
    Join Date
    Jun 2015
    Posts
    943

    Re: Teensy Up/Down Torch Height Control

    There's a document of the modbus plugin in the Documentation folder of the UCCNC. It shows how to read and write registers, how to setup a communication channel etc.

  20. #40
    Join Date
    Oct 2010
    Posts
    317

    Re: Teensy Up/Down Torch Height Control

    I did more research and it doesn't look like I can add the SD card off the LCD without having a detrimental effect on the loop time at least for logging purposes. On the Teensy 3.1 the loop is running around 175k times per second and at minimum I would like to store incoming frequency/voltage, target, hysteresis, and output status. I don't see a way to buffer that much information and then do a write when incoming voltage drops to near 0, I also used a pin required for the SD library as an output so the PCB would need modified. I did purchase an OpenLog so I'll see how far I can get sending the information over serial and letting it handle the buffer.

Page 2 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
  •