CNC BRIDGE SAW FOR MARBLE

More
11 Aug 2018 22:37 #115924 by tommylight
I think all you need is to issue an MDI command with G1 X2000 Fnnnn where nnnn is the speed you want the cutting head to move, in your case the circular saw.
More
12 Aug 2018 09:48 #115948 by fixer
Replied by fixer on topic CNC BRIDGE SAW FOR MARBLE
Yannis, I belive that I know what you want to achieve. You want to manually rotate your saw (C axis), then you would like to move the X-Y in line with the angle the saw is pointing to. All this manually, without programming. This is possible with some custom hal component logic.

I am attaching a component and hal file that I use on my lathes for jogging in G95 feed per rev mode. I am using spindle encoder as an MPG for axes. You could use the same hack to move XY axes in jog mode, you just need to calculate axis.jog-scale for x and y with some trigonometric functions based in an angle of C axis. The handwheel increment counter could be generated in SW for your needs.

component code:
component lathe_jog "Manual lathe jogging, by Mit Zot";



pin in signed spindle_count;
pin in signed hwheel_count;
pin in bit jog_rapid;
pin in bit jog_zp;
pin in bit jog_zm;
pin in bit jog_xm;
pin in bit jog_xp;
pin in bit hwheel_x;
pin in bit hwheel_z;
pin in float hwheel_increment;
pin in float jog_rapid_speed;
pin in float jog_feed;
pin in unsigned spindle_counts_per_rev;
pin in float feed;
pin in float override;
pin in bit is_g95;
pin in bit spindle_on;
pin in bit abort;

pin out signed jog_z_count;
pin out signed jog_x_count;
pin out float jog_scale_x;
pin out float jog_scale_z;
pin out bit jog_x_enable;
pin out bit jog_z_enable;
pin out bit g94_jog_zp;
pin out bit g94_jog_zm;
pin out bit g94_jog_xp;
pin out bit g94_jog_xm;
pin out float g94_jog_speed;
pin out bit set_manual;



variable int spindle_count_old;
variable uint spindle_count_diff;
variable int hwheel_count_old;
variable uint hwheel_count_diff;


function _;
license "GPL";
;;

FUNCTION(_){
        if( jog_rapid || !is_g95 || !spindle_on){  //rapid jog or G94
          jog_x_enable=0;
	  jog_z_enable=0;
	  g94_jog_zp=jog_zp;
  	  g94_jog_zm=jog_zm;
	  g94_jog_xp=jog_xp;
	  g94_jog_xm=jog_xm;
          if( jog_rapid )g94_jog_speed=jog_rapid_speed * override;
	  else 	         g94_jog_speed=jog_feed * override;
        }
        else if (is_g95 && spindle_on) { //G95 feed per rev
          jog_x_enable=1;
	  jog_z_enable=1;	
	  g94_jog_zp=0;
	  g94_jog_zm=0;
	  g94_jog_xp=0;
	  g94_jog_xm=0;
	  jog_scale_z= (feed * override) / spindle_counts_per_rev;
          jog_scale_x = jog_scale_z / 2;
        }//else rapid

        if(hwheel_x && (!jog_rapid && !jog_zp && !jog_zm && !jog_xp && !jog_xm)){
          jog_x_enable=1;	
	  jog_scale_x=hwheel_increment/2;  //diameter
        }

        if(hwheel_z && (!jog_rapid && !jog_zp && !jog_zm && !jog_xp && !jog_xm)){
          jog_z_enable=1;	
	  jog_scale_z=hwheel_increment;
        }

	spindle_count_diff = abs(spindle_count - spindle_count_old);
	spindle_count_old = spindle_count;
	hwheel_count_diff = hwheel_count - hwheel_count_old;
	hwheel_count_old = hwheel_count;

	if(jog_zp)jog_z_count += spindle_count_diff;
	if(jog_zm)jog_z_count -= spindle_count_diff;
	if(jog_xp)jog_x_count += spindle_count_diff;
	if(jog_xm)jog_x_count -= spindle_count_diff;

	if(hwheel_z & !(jog_zp || jog_zm) )jog_z_count+=hwheel_count_diff;
	if(hwheel_x & !(jog_xp || jog_xm) )jog_x_count+=hwheel_count_diff;

        set_manual=jog_zp || jog_zm || jog_xp || jog_xm || abort;

}//FUNCTION

########################################################
#jog.hal
#######################################################

net fovr halui.feed-override.counts
net fovr halui.rapid-override.counts
setp halui.feed-override.direct-value  1  
setp halui.rapid-override.direct-value 1
setp halui.rapid-override.count-enable 1
setp halui.feed-override.count-enable  1
setp halui.feed-override.scale         0.01
setp halui.rapid-override.scale        0.01

net buttonReset lathe-jog.0.abort
net force-manual lathe-jog.0.set-manual halui.mode.manual
setp lathe-jog.0.spindle-counts-per-rev 4096
setp lathe-jog.0.hwheel-increment       0.0025
setp lathe-jog.0.jog-rapid-speed        2000               
net buttonZm     lathe-jog.0.jog-zm					#tipke, stikala
net buttonZp     lathe-jog.0.jog-zp
net buttonXm     lathe-jog.0.jog-xm
net buttonXp     lathe-jog.0.jog-xp
net buttonRapid  lathe-jog.0.jog-rapid
net hwheel-sel-z lathe-jog.0.hwheel-z 
net hwheel-sel-x lathe-jog.0.hwheel-x 
net handwheelcnt lathe-jog.0.hwheel-count  <= hm2_5i25.0.encoder.05.count  #handwheel encoder count
net s-pos-rawcounts   lathe-jog.0.spindle-count    #spindle encoder count
net overrideui   lathe-jog.0.override <= halui.feed-override.value
net gmoccapyfeed lathe-jog.0.feed  
setp lathe-jog.0.jog-feed 500
net isg95        lathe-jog.0.is-g95
net xjogcounts   axis.0.jog-counts  <= lathe-jog.0.jog-x-count 
net zjogcounts   axis.2.jog-counts  <= lathe-jog.0.jog-z-count
net xjogcntena   axis.0.jog-enable  <= lathe-jog.0.jog-x-enable
net zjogcntena   axis.2.jog-enable  <= lathe-jog.0.jog-z-enable  
net jogscalex    axis.0.jog-scale   <= lathe-jog.0.jog-scale-x
net jogscalez    axis.2.jog-scale   <= lathe-jog.0.jog-scale-z
net haluixp      halui.jog.0.plus   <= lathe-jog.0.g94-jog-xp
net haluixm      halui.jog.0.minus  <= lathe-jog.0.g94-jog-xm
net haluizp      halui.jog.2.plus   <= lathe-jog.0.g94-jog-zp
net haluizm      halui.jog.2.minus  <= lathe-jog.0.g94-jog-zm
net haluijogsp   halui.jog-speed    <= lathe-jog.0.g94-jog-speed  
setp axis.0.jog-vel-mode 1
setp axis.2.jog-vel-mode 1

net sp-is-on lathe-jog.0.spindle-on
More
12 Aug 2018 10:58 #115951 by andypugh
Replied by andypugh on topic CNC BRIDGE SAW FOR MARBLE

fixer wrote: Yannis, I belive that I know what you want to achieve. You want to manually rotate your saw (C axis), then you would like to move the X-Y in line with the angle the saw is pointing to. All this manually, without programming. This is possible with some custom hal component logic.


There are other (possibly easier) ways to do this too.

Take a look at the G10 commands:
linuxcnc.org/docs/2.7/html/gcode/g-code.html#gcode:g10-l2

That allows you to rotate the XY coordinate system around the Z axis.
So, a hardware button that runs an MDI_COMMAND could be set up that runs G10 L2 R[something] would mean that a G1 F100 X2000 (on a second button maybe) would follow the current line of the saw

You could do a similar thing with polar coordinates, but you still need the G10 L20 X0 Y0 to make the current position the centre of the polar coordinate system.

In fact there are three things to do on the button-press so making the MDI_COMMAND button call a G-code subroutine is probably the way to go.

You might need some mathematics in the subroutine to calculate exactly how far the saw can run (then making that request will not cause a "move exceeds limits" warning.
The following user(s) said Thank You: Yannis
More
12 Aug 2018 12:00 #115953 by fixer
Replied by fixer on topic CNC BRIDGE SAW FOR MARBLE
Yep, there are always different solution for the same problem. You could also have your subroutine calculate end points of a move without using any rotations and polar coordiantes, using some simple sin-cos math.

He propably wants to use this machine in some kind of semi manual mode, using G10 will cause him trouble because he will not be able to use the DRO and G5x zero points.
The following user(s) said Thank You: Yannis
More
13 Aug 2018 05:50 - 13 Aug 2018 06:33 #115989 by Yannis
Replied by Yannis on topic CNC BRIDGE SAW FOR MARBLE
Thanks for all the suggestions
The task is done with ngc code nicely
The problem is that the machine have different x and y dimentions
If i put x max dimention in the ngc code and rotate the saw parallel to y i get an y limit error
As for the zeroing position i use the g92 and g92.1 commands thanks toTodd Zuercher suggestion
Attachments:
Last edit: 13 Aug 2018 06:33 by Yannis.
More
13 Aug 2018 10:04 #115991 by andypugh
Replied by andypugh on topic CNC BRIDGE SAW FOR MARBLE
I think that the answer is a user M-code.
linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m100-m199
So that M100 P80 will run to the furthest extent possible at 80mm/min
Then in the G-code subroutine that the M-code is associated with, you need some trigonometry to calculate the furthest possible target point.

I, personally, very rarely use G92. I use G10 to set offsets in coordinate systems and G53 for absolute moves.
I suspect that your user M-code .ngc routine would end up making a G53 G1 move.
More
13 Aug 2018 19:09 #116014 by Todd Zuercher

andypugh wrote: LinuxCNC will never allow a move that hits the limit switch.
You will have to find a different way to achieve whatever it is you want to do.
(What is it you want to do?)


What if the "limit" switch was configured as a probe input, and the move done as a probe move?
More
13 Aug 2018 21:07 #116017 by andypugh
Replied by andypugh on topic CNC BRIDGE SAW FOR MARBLE

Todd Zuercher wrote: What if the "limit" switch was configured as a probe input, and the move done as a probe move?


That would work, but only if the machine was set up without limits (or no effective limits)
Time to create page: 0.078 seconds
Powered by Kunena Forum