Contact me: hankecnc@gmail.com

CNC 等离子 THC 集成 #1260

推推 grbl 3年前 (2023-01-23) 252次浏览
关闭
bduplan 打开了这个问题 2017 年 7 月 6 日 · 27条评论
关闭

CNC 等离子 THC 集成#1260

bduplan 打开了这个问题 2017 年 7 月 6 日 · 27条评论

注释

CNC 等离子 THC 集成 #1260

我正在运行带有 v3.51 grbl 防护罩的 0.9j。它在我的 4×4 英尺数控等离子工作台上运行良好,但我很难让割炬高度控制器工作。我编写了第二个 arduino uno 作为火炬高度控制器 (THC),它一直工作到等离子电源打开。等离子弧会产生大量 EMI,我无法阻止 THC uno 在切割过程中崩溃和重启。有时效果很好,但其他时候却不行。我已经屏蔽并接地了所有东西,grbl 控制器很好。我在设计、构建和故障排除之间尝试了几个月。无论如何,我现在正准备硬着头皮购买像 Proma THC 这样的集成装置。我真的需要让机器工作并使用它。

THC 获取 SpinEn 输出,在不使用 THC 时触发等离子弧继电器,并拦截它。它首先使用它作为触发器进行探测,然后将信号发送到继电器以启动等离子体。然后它会等待一段预定的时间(~0.5 秒)并向 CNC 控制器发送一个“Arc OK”信号,告诉它开始 X 和 Y 运动。当我的海宝等离子机检测到电弧已穿透金属时,它也可以发送电弧正常。

所以我的问题是:“arc OK”反馈可以作为恢复命令发送到 grbl,但我一开始不知道如何保持它。我希望有一种方法可以在后处理器中放置一个命令,使 grbl 进入暂停状态。我对此很陌生,所以我试着放一个“!” 在紧跟在 M03 命令之后的行上,我相信您知道这会为不受支持的 g 代码命令引发错误。但我提到这一点是为了说明我正在努力实现的目标。有没有办法让 grbl 在继续之前基本上等待 Arc OK 信号?

谢谢你的帮助!

CNC 等离子 THC 集成 #1260
作者
计划 评论了 2017 年 7 月 8 日  

我偶然发现了一点,认为我找到了解决方案。

在 gcode.c 文件中,我找到了以下用于主轴控制的代码块:

// [7. Spindle control ]:  
if (gc_state.modal.spindle != gc_block.modal.spindle) {

  // Update spindle control and apply spindle speed when enabling it in this block.    

  spindle_run(gc_block.modal.spindle, gc_state.spindle_speed);

  gc_state.modal.spindle = gc_block.modal.spindle;

}

并向其添加了另一个 if 语句。所以目的是,如果命令是打开主轴,它会使用我在文件其他地方找到的代码执行进给保持。

// [7. Spindle control ]:
if (gc_state.modal.spindle != gc_block.modal.spindle) {

  // Update spindle control and apply spindle speed when enabling it in this block.   
 
  spindle_run(gc_block.modal.spindle, gc_state.spindle_speed);

  gc_state.modal.spindle = gc_block.modal.spindle;

  if (gc_block.modal.spindle == SPINDLE_ENABLE_CW) {

    //Execute a feed hold so that the THC has time to probe.  The THC will resume via the resume pin

    bit_true_atomic(sys_rt_exec_state, EXEC_FEED_HOLD); // Use feed hold for program pause.

  }

}

所以现在当 gcode 发送 M03 命令时,它会进入暂停状态。我在一个 gcode 文件上测试了这个,该文件在切割一些字母的过程中两次触发手电筒。将屏蔽上的恢复引脚接地,然后恢复程序。通过 UGCS 发送的“~”恢复命令在此保留时将不起作用,但我应该可以接受。我只是想知道这是否表明我忽略了可能导致问题的事情。

CNC 等离子 THC 集成 #1260

G4 会停留一定的时间来暂停,为你想要的工作吗?

CNC 等离子 THC 集成 #1260
作者

不会,因为探头将花费不同的时间,具体取决于开始时割炬头与工件的距离。完成探测后,THC 会向等离子电源发送信号以点燃电弧,因此 CNC 控制器需要在与该电弧相关的精确时间恢复运动。

CNC 等离子 THC 集成 #1260
危机 评论了 2017 年 7 月 8 日 通过电子邮件
CNC 等离子 THC 集成 #1260
危机 评论了 2017 年 7 月 10 日 通过电子邮件
CNC 等离子 THC 集成 #1260
作者

感谢您的全面回复。我不得不承认我需要一点时间来消化其中的大部分内容。我了解 THC 操作,因为我在设计我的第一个时花了很多心思。第二个 Uno 处理了您概述的所有功能。我遇到的问题是不稳定。有时切割时它会崩溃。削减几次然后重置就可以了。因为我通过串行监视器处理了材料厚度识别,它会重置并询问用户切割中间的厚度。我遇到的另一个问题是获得准确的电弧电压。它非常准确地读取电池电压和 0-5V 之间的任何数据,但切割电压有点嘈杂,通常低于应有的水平。我拥有的 Hypertherm Powermax 45XP 给出了分弧电压,但我猜它没有过滤好。这是我需要测试的东西。我可以在运算放大器板上制作一个 RC 滤波器来测量电压。我必须使用运算放大器,因为 Hypertherm 在 (+) 和 (-) 引脚上提供分弧电压 (50:1),但两者都没有接地参考。所以我制作了一个运算放大器电路,接地参考电压测量,以便 arduino 可以在模拟引脚上读取它。我还有一个让 arduino 更稳定的想法,我将通过简单地测量电弧电压并查看 Uno 的性能来对其进行测试。所以我制作了一个运算放大器电路,接地参考电压测量,以便 arduino 可以在模拟引脚上读取它。我还有一个让 arduino 更稳定的想法,我将通过简单地测量电弧电压并查看 Uno 的性能来对其进行测试。所以我制作了一个运算放大器电路,接地参考电压测量,以便 arduino 可以在模拟引脚上读取它。我还有一个让 arduino 更稳定的想法,我将通过简单地测量电弧电压并查看 Uno 的性能来对其进行测试。

昨天,我设法在我的后处理器中获得了可靠的探测序列。有趣的是,如果探测后跟一个圆弧,我会得到错误 33 并且它不会被执行。圆弧确实位于 0.0005 以内的路径上。通过将我的引导从圆弧更改为直线,它起作用了。我在最新的 grbl 1.1 和 0.9j 上验证了这种行为。

(作为旁注,最新的稳定 UGCS (1.0.9) 在 grbl 1.1 上不显示机器位置,但在 0.9j 上显示。)

我买了 SheetCAM 来编写 gcode。SheetCAM 存储工具,我为每种材料厚度准备了一个工具。不同厚度的再加工对我来说不是问题。我使用了 Mach3_plasma 帖子并对其进行了一些修改。这部分给了我探测:
function OnPenDown() --Probe post.ModalText (" G38.2") post.ModalNumber (" Z", -10, "0.0000") post.ModalNumber (" F", 300, "0.####") post.Eol() --Reset Z axis and feed rate post.Text (" G92 Z-4.8500\n") post.ModalNumber (" F", 4500, "0.####") post.Eol() --Move up above pierce height (for backlash) post.Text (" G00 Z7.0000\n") --Move to pierce height post.NonModalNumber (" Z", pierceHeight * scale, "0.0000") --Below here was already in the post post.Text ("\n M03\n") if (pierceDelay > 0.001) then post.Text (" G04 P") post.Number (pierceDelay,"0.###") post.Eol() end end

以上工作正常,所以剩下的就是切割时根据分弧电压进行调整。如果我能让我的另一个 Uno 处理这个问题,我可能会使用它。根据经验,我希望看到的问题是:
1.) 调整缓慢。使用 AccelStepper 库可能是原因。也许我应该只使用步进器库来加快移动速度。我试着调高加速度,但速度仍然很慢。它在 5Hz 时平均这些值,但当它必须进行调整时,它不会比 1Hz 快。
2.) 通过 THC 传递 grbl Z 步骤。也许这是中断功能的工作?请记住,我对此很陌生。这实际上是我的第一个 arduino 项目。我之前通过让 THC Uno 控制一个传递 grbl 步数或 THC 步数和方向的继电器来让它工作。它起作用了,但是很粗糙而且有点不可靠。根据文档,Proma THC SD 实际上似乎也使用继电器。
3.) 如前所述,准确测量输入电压。
4.) 存储 Arduino 断电后消耗品寿命的起弧时间。这只是我必须在开机时手动输入的内容吗?我不经营生产车间,所以我的耗材应该可以使用很多次。

CNC 等离子 THC 集成 #1260
危机 评论了 2017 年 7 月 10 日 通过电子邮件
CNC 等离子 THC 集成 #1260
作者

回复:电弧电压校准。Hypertherm 背面有一个 amphenol 端口,该端口具有用于触发电弧的引脚、接地引脚、电弧正常引脚(干接触接地)以及用于分压电弧电压的 (+) 和 (-)。我首先尝试通过将 (+) 引脚连接到 THC Uno 上的模拟引脚并将 (-) 引脚接地来测量电压。这给出了非常不一致的值。(-) 引脚在切割时测量到接地时读取电压,有时它是正的和负的。所以我构建了一个微分器运算放大器电路来测量 (+) 和 (-) 之间的差异,然后输出该电压(这就是我所说的接地参考电压,因为电压现在是从所有的公共接地点测量的控制使用。)起初,我在运算放大器电路上的增益是 1,你是对的,它在 5V 时确实有问题。因此,我通过增加电阻将增益降低到 1/2,现在它可以准确地测量 1.63V 的电池、两个 3.26V 的串联电池和 5V 的 Vref。在 5V 时,它的测量值为 4.96。

我将不得不查找如何写入 eeprom,但我不知道这可以通过编程方式实现,所以这是个好消息。

grbl Uno 和我的 THC Uno 都通过 USB 连接到笔记本电脑。THC Uno 似乎没电了,所以我也用 1A 9V 直流壁式电源适配器为它供电。我认为这是导致我的崩溃问题的一个重要因素,因为电线没有屏蔽并且在我的电箱之外运行。

我有一个装有电子设备的家用断路器盒。它通过橡胶隔离器(电气和振动隔离)​​安装到台架上,并通过 4ga 绞线直接接地到 8′ 接地棒。台架也与接地棒单独接地。所有接线(电源线除外)均已屏蔽并接地到底座。在电线进入电子盒之前,我在电线上安装了铁氧体磁芯。箱体所有孔洞(一个120mm风扇孔,三个排风孔)都用铝窗纱盖住。grbl Uno 永远不会崩溃。

我的割炬头漂浮在轴承上,4.85 毫米是割炬头接触工件和触发探头开关之间的测量值。因此,当探头开关打开时,Z 轴低于零,因为它必须在割炬开始升起之前重新升起。然后,我将割炬提升到零以上 7 毫米,然后返回以解决运行 z 轴的螺杆驱动器中的反冲。这确保我获得正确的穿孔高度 (0.15″),并且只要 grbl 要求它下降到切割高度 (0.06″),z 轴就会响应。我已经证实这适用于千分表,并且始终在 0.003″ 以内。

非常感谢您抽出时间帮助我!我将研究 _BV 函数和中断。我正在使用中断来测量 X 和 Y 步,以便我可以确定它们是否足够快地进给以进行 Z 调整,或者我是否应该在减速转弯时停止 THC。稍后我将在删除探测例程后发布我的 THC 代码,因为它在 grbl 中工作。

在探头后放置 G02/G03 圆弧后,您是否遇到过错误 33?如果我注释掉 G38.2 行并保留其他所有内容,则弧工作正常。我现在使用线性导入而不是弧形导入。

CNC 等离子 THC 集成 #1260
危机 评论了 2017 年 7 月 10 日 通过电子邮件
CNC 等离子 THC 集成 #1260
作者

等离子工作台接地到接地棒,该接地棒被打入地下 8 英尺。我通常将大夹子从等离子电源夹到工件上,但我已经将它夹在工作台和接地棒上(Hypertherm 的 Jim Colt 给其他人的建议。)

我不明白你什么时候说不要将 THC 接地。你如何在不共用地面的情况下为它供电或让它向/从 grbl Uno 发送信号?

我的 gcode 是公制的,精度为 4 位小数。如果 G38.2 在那里,它只会出错。如果我将其注释掉并离开 G92,它不会出错。(坐标都是错误的,但不会抛出错误。)

CNC 等离子 THC 集成 #1260
危机 评论了 2017 年 7 月 11 日 通过电子邮件
CNC 等离子 THC 集成 #1260
作者
计划 评论了 2017 年 7 月 11 日 通过电子邮件
CNC 等离子 THC 集成 #1260

嗨,大家好,

我刚刚连接好我们的测试平台,并将在太平洋夏令时间明天下午 6:00 运行 plasma/grbl 测试,在我们的 youtube 频道上直播。我们使用的是带有 CNC 直割炬的 Lotos LTP5000D。Grlb 版本 1.1f。

优酷直播!

谢谢

CNC 等离子 THC 集成 #1260

@zentoolworks 是否有更多技术数据,例如 LTP5000D 的引出线、接线和技术数据?

CNC 等离子 THC 集成 #1260
作者
计划 评论了 2017 年 7 月 12 日  

Here is how I have the Uno THC wired up with the relays and the Z driver. The X and Y drivers (and the cloned X on A) are 8825’s on the grbl shield. My next step was to take the wall wart that’s powering the THC and get power from inside of the metal box, after the EMI filter. It’s similar to this: https://www.picclickimg.com/d/w1600/pict/121235665835_/1pc-NEW-AC-Power-Line-EMI-Filter-10A.jpg

Diagram:
http://sickspeedmonte.com/Wiring.jpg

I don’t really need to have the THC hooked to the computer while cutting, if it’s a problem.

Here’s a picture of the wiring from before I put the op-amp in for the divided arc voltage.
http://sickspeedmonte.com/IMG_7323.JPG

The op amp circuit:
http://hades.mech.northwestern.edu/images/3/36/Opamp_differential_amp.gif
R1 = 2kohm, R2 = 1kohm

CNC 等离子 THC 集成 #1260

@mkeyno

LTP4000D Lotos is a 50A machine without any probe feedback. I am using Pin12, spindle enabling, to control the plasma torch trigger. Currently, I just have X and Z axis setup, so it will only cut out a straight line. Eventually, I want to probe the cutting area first, and use that data to compensate the torch height.

Here is a sample gcode sequence that will be sent over to grbl shield. We assume that the surface is flat for now.

S1000
M5
G4 P0.5 (the delay can be adjusted based on test results)
G1 X20 F100 (the federate will also need to be adjusted according to result)
M3
X0

CNC 等离子 THC 集成 #1260
cri-s commented 2017 年 7 月 12 日 via email
CNC 等离子 THC 集成 #1260
Author
bduplan commented 2017 年 7 月 12 日 via email
CNC 等离子 THC 集成 #1260
Author
bduplan commented 2017 年 7 月 12 日  

Here is the code on the THC Uno. I haven’t run this particular sketch yet. I had been running another version which included probing, so I just removed the probe pieces and this is what’s left for the closed-loop arc voltage feedback portion.

// Libraries ===========================================
#include <AccelStepper.h>

// Pin Assignments =====================================
const byte arcVoltPin = 1;                              //analog input

const byte xStepInPin = 2;                              //digital input  0 and 1 are reserved for TX/RX
const byte yStepInPin = 3;                              //digital input  2 and 3 are the only valid interrupt pins
const byte spinEnInPin = 5;                             //digital input

const byte zStepControl = 6;                            //digital output  High Level Trigger Relay
const byte zDirControl = 7;                             //digital output  Low Level Trigger Relay
const byte zStepOutPin = 10;                            //digital output
const byte zDirOutPin = 13;                             //digital output

// Parameters to tune ==================================
float vHyst = 1;                                        //Hysteresis for OK-Band during THC closed-loop operation (undivided arc voltage, V).  If the measured voltage is within the target, +/- vHyst, tortch height is not changed
float zBacklash = 1.81;                                 //mm, backlash in z axis
float THCsteps = 0.5;                                   //mm of adjustment on every THC iteration in closed feedback loop control
float loopFreq = 5;                                     //Hz, frequency of Z adjustment in closed-loop
float zMaxSpd = 10;                                     //mm/s
float zMaxAccel = 1000;                                 //mm/s^2
float ArcVoltDivisor = 100.6;                           //Voltage divider, set at 50:1 (times a 2.012 op amp gain)
float xstepspmm = 20.32;                                //X steps per mm
float ystepspmm = 20.32;                                //Y steps per mm
float zstepspmm = 102.00;                               //Z steps per mm
float closedLoopSpeed = 400;                            //Z steps per sec
float closedLoopAccel = 50000;                          //Z steps per sec^2
int sampleSize = 80;                                    //Number of samples for running average.  Max of (1000/loopFreq)

// Initialize variables ================================
String tTarg;
float startx;
float starty;
float startt;
float endt;
float freqx;
float freqy;
float freqPythag;
volatile unsigned int xsteps;
volatile unsigned int ysteps;
float arcVsum;
float arcVavg;
float vTarg;
float frTarg;
boolean validInput = false;
boolean lastMoveUp;
unsigned int charCount;
float i;
unsigned int floatLowCount;
unsigned int floatHighCount;
float arcV2Counts = (1024/(5*ArcVoltDivisor));
unsigned int SpinEnInCount;

// Define a stepper and the pins it will use ===========
AccelStepper stepper(AccelStepper::DRIVER, zStepOutPin, 
  zDirOutPin);


void setup() {
  // Set input pins ====================================
  pinMode(xStepInPin, INPUT);
  pinMode(yStepInPin, INPUT);
  pinMode(spinEnInPin, INPUT);
  pinMode(zStepControl, OUTPUT);
  pinMode(zDirControl, OUTPUT);
  pinMode(zStepOutPin, OUTPUT);
  pinMode(zDirOutPin, OUTPUT);
  
  // AccelStepper Parameters ===========================
  stepper.setPinsInverted(true, false, false);          //Direction, Step, En, TB6600 Driver
  
  // Interrupt Parameters for measuring X/Y speed ======
  attachInterrupt(digitalPinToInterrupt(xStepInPin), 
    xcount, RISING);
  attachInterrupt(digitalPinToInterrupt(yStepInPin), 
    ycount, RISING);

  // Get target thickness from serial monitor ==========
  Serial.begin(9600);                                   //Start the serial buffer
  while (!validInput) {                                 //Until a valid input has been entered
    tTarg = SerialInput("material thickness");          //Target thickness
    
    // Correlate material thickness ====================//Hypertherm Powermax 45XP
    if      (tTarg == "16ga") {
      frTarg = 249*25.4/60;                             //inches/min to mm/s
      vTarg = 128;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("16 ga identified");
    }
    else if (tTarg == "14ga") {
      frTarg = 225*25.4/60;                             //inches/min to mm/s
      vTarg = 128;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("14 ga identified");
    }
    else if (tTarg == "10ga") {
      frTarg = 129*25.4/60;                             //inches/min to mm/s
      vTarg = 128;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("10 ga identified");
    }
    else if (tTarg == "3/16") {
      frTarg = 85*25.4/60;                              //inches/min to mm/s
      vTarg = 129;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("3/16 identified");
    }       
    else if (tTarg == "1/4") {      
      frTarg = 48*25.4/60;                              //inches/min to mm/s
      vTarg = 130;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("1/4 identified");
    }       
    else if (tTarg == "3/8") {      
      frTarg = 33*25.4/60;                              //inches/min to mm/s
      vTarg = 136;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("3/8 identified");
    }       
    else if (tTarg == "1/2") {      
      frTarg = 18*25.4/60;                              //inches/min to mm/s
      vTarg = 141;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("1/2 identified");
    }
    else if (tTarg == "0.1") {      
      frTarg = 184*25.4/60;                             //inches/min to mm/s
      vTarg = 128;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("0.100\" identified");
    }
    else if (tTarg == "1/8") {      
      frTarg = 144*25.4/60;                             //inches/min to mm/s
      vTarg = 128;                                      //Volts
      validInput = true;                                //boolean
      Serial.println("1/8\" identified");
    }
    else {
      Serial.println("Invalid Response");
    }
  }
}

// Interrupt Functions for XY steps ====================
void xcount() {
  xsteps++;
}

void ycount() {
  ysteps++;
}

void moveWithBlock() {
  while (stepper.run()) {                               //Could this be while (stepper.run()) ?
    stepper.run();
  }
}

// Serial Input Function ===============================
String SerialInput(String InputParam) {
  Serial.print("Enter the ");
  Serial.print(InputParam);
  Serial.println(". [16ga, 14ga, 10ga, 1/8, 3/16, 1/4, 3/8, 1/2, 0.1]");
  String Input;
  while(Serial.available() == 0) { }                    // There really is nothing between the {} braces, delays until something is entered.
  if (Serial.available() > 0) {                         //If there is anything in the buffer
    Input = Serial.readString();                        //parse the input from the buffer   
  }     
  return Input;
}

void loop() {
  // Set Z-stepper Speed/Accel
  stepper.setMaxSpeed(zMaxSpd*zstepspmm);               //mm/s (scaled to steps)
  stepper.setAcceleration(zMaxAccel*zstepspmm);         //mm/s^2 (scaled to steps)
  
  //Give Z control to grbl through relay ===============
  Serial.println("Pass-through Z from grbl");
  digitalWrite(zStepControl, LOW);
  digitalWrite(zDirControl, HIGH);
  delay(10);
  SpinEnInCount = 0;
  while (SpinEnInCount < 3) {
    SpinEnInCount = SpinEnInCount+digitalRead(spinEnInPin); //If there is no spinEn command, wait
    delay(30);
  }

  // When SpinEn goes HIGH, take Control of the Z axis
  digitalWrite(zStepControl, HIGH);                     //Closes high
  digitalWrite(zDirControl, LOW);                       //Closes low (different relay type)

  // Closed loop THC ===================================
  Serial.print("Target Voltage: ");
  Serial.print(vTarg-vHyst);
  Serial.print(" to ");
  Serial.print(vTarg+vHyst);
  Serial.println(" volts");
  
  while (digitalRead(spinEnInPin) == HIGH){             //Only do when torch is on
    // Get starting X and Y positions ==================
    startx = xsteps;
    starty = ysteps;
    startt = millis();
    
    // Get the average arc voltage =====================
    i = 0;
    arcVsum = 0;
    while ((millis()-startt) <= ((1/loopFreq)*1000)){   //Calculate avg voltage over delay period
      //delay(((1/loopFreq)/sampleSize)*1000);            //(1/loopFreq) = Period.  Period/sampleSize => sampleSize samples during delay.  1/sampleSize * 1000 for ms
      arcVsum = arcVsum+analogRead(arcVoltPin);
      i++;
    }
    arcVavg = (arcVsum/i)/arcV2Counts;                  //Average arc voltage (sum/numel) * (D to A) * ArcVoltDivisor
    Serial.print(arcVavg);
    Serial.print(" ");
    
    // Calculate X and Y speeds ========================
    endt = millis();
    freqx = ((xsteps-startx)/xstepspmm)/
      ((endt-startt)/1000);                             //dx/dt, mm/s
    freqy = ((ysteps-starty)/ystepspmm)/
      ((endt-startt)/1000);                             //dy/dt, mm/s
    freqPythag = sqrt(sq(freqx)+sq(freqy));             //dv/dt, mm/s of torch head in XY plane
    
    // Control Torch Height ============================
    stepper.setMaxSpeed(closedLoopSpeed);               //Set stepper speed for closed-loop THC control
    stepper.setAcceleration(closedLoopAccel);           //Set stepper accel for closed-loop THC control
    if (freqPythag >= (0.8*frTarg)) {                   //If the speed is within 80% of the target
      // Too High, Move Down
      if (arcVavg > (vTarg+vHyst)) {                    //If the arc voltage is greater than the target plus the hysteresis window
        if (lastMoveUp) {                               //If the last move was up
          stepper.move(-((THCsteps+zBacklash)*zstepspmm));//Move target down with backlash compensation
          moveWithBlock();
        }
        else {                                          //If the last move was down
          stepper.move(-(THCsteps*zstepspmm));          //Move down without adding backlash
          moveWithBlock();
        }
        Serial.println("v");
        charCount++;
        lastMoveUp = false;                             //Indicate that the last move was down
      }
      // Too Low, Move Up
      else if (arcVavg < (vTarg-vHyst)) {               //If the arc voltage is less than the target minus the hysteresis window
        if (lastMoveUp) {                               //If the last move was up
          stepper.move(THCsteps*zstepspmm);             //Move up more without accounting for backlash
          moveWithBlock();
        }
        else {                                          //If the last move was down
          stepper.move((THCsteps+zBacklash)*zstepspmm); //Move up with backlash compensation
          moveWithBlock();
        }
        Serial.println("^");
        charCount++;
        lastMoveUp = false;                                 //Indicate that the last move was up
      }
      // OK, No Move
      else {
        Serial.println("-");
        charCount++;
      }
    }
    else {
        Serial.println("S");
        charCount++;
    }
    
    // Carriage return Up/Down feedback
    if (charCount >= 50) {
        Serial.println("");
        charCount = 0;
    }
  }
  Serial.println("");
}
CNC 等离子 THC 集成 #1260
cri-s commented 2017 年 7 月 12 日 via email
喜欢 (0)