Hi Rod,
I show you a piece of code that works good when normal cutting without using the probe function.
I tested this code on a test board next to my pc.
It was hard to solve the float issue's. Turning them into integer, was not a good idea.
Now i used the orginal float value's and added a min and max difference of 0.1mm
in the same code line. This works good !
And this 0.1 value is only to compare the different float's.
Usage with Mesa, will also be easy in this code example. If you have the raw input voltage for example
120 volts. And we know our torch destination voltage for example 130 volts (from cutting charts). If we then do the Torch_up signal, the torch is moving up and when reached 130 volts, we are finished.
So i can write a short code with a mesa raw arc voltage / encoder input. Do you think this is usable for you?
If handy, i can make a gmocappy load in side screen to test the code by other users, when i am finisched.
Code:
if(Normal){
if(!Torch_on_in){
Offset = Travelheight;
Pause_machine = 1;
Torch_on_out = 0;
Cutting_trigger = 0;
}
if(!Torch_on_in && ( (Axis_z_eoffset >(Travelheight-0.1)) && (Axis_z_eoffset <(Travelheight+0.1)) ) ){ // if no torch on in goto travelheight.
Pause_machine = 0;
}
if(Torch_on_in && !Torch_on_out){ // if torch on in goto pierceheight.
Offset = Pierceheight;
Pause_machine = 1;
}
if(Torch_on_in && !Torch_on_out && ( (Axis_z_eoffset > (Pierceheight-0.1)) && (Axis_z_eoffset <(Pierceheight+0.1)) ) ){ // if at pierceheight.
Torch_on_out = 1;
Pause_machine = 1;
}
if(Torch_on_in && Torch_on_out && Piercetime_reached){ // if torch on in and piercetime oke, goto cutheight.
Offset = Cutheight;
Pause_machine = 1;
}
if(Torch_on_in && Torch_on_out && Piercetime_reached && ( (Axis_z_eoffset >(Cutheight-0.1)) && (Axis_z_eoffset <(Cutheight+0.1)) ) ){ // add ark ok signal
Pause_machine = 0;
Cutting_trigger = 1; // we are cutting
}
//if(Torch_on_in && Torch_on_out && Piercetime_reached && ( (Axis_z_eoffset >(Cutheight-0.1)) && (Axis_z_eoffset <(Cutheight+0.1)) ) && !Ark_ok_in) {
// Pause_machine = 1;
// Torch_on_out = 0;
// }
if(Torch_up && Torch_on_out && Cutting_trigger && (Axis_z_eoffset <= Travelheight) ){ // torch up and limited to travelheight
Offset = Axis_z_eoffset + Up_down_resolution ;
Pause_machine = 0;
}
if(Torch_down && Torch_on_out && Cutting_trigger && (Axis_z_eoffset >= Probe_search_limit) ){ // torch down and limited to probe search limit
Offset = Axis_z_eoffset - Up_down_resolution ;
Pause_machine = 0;
}
if(!Torch_down && !Torch_up && Torch_on_out && Cutting_trigger){ // if no torch up or down, stay at current height
Offset = Axis_z_eoffset;
Pause_machine = 0;
}
}