I'm having a glitch in Kmotion when trying to use G84.
I don't currently have spindle feedback so I was hoping to just use a floating tap holder.
The problem is when I execute G84 The command just goes to the R height, ignores the Z depth and goes to the next position.
G54X2.0Y0
G43H1Z.5
S200
G84R.2Z-.750F12.5
X1.0
G80
Is there a setting that needs to be changed to make G84 work.
Similar Threads:
sick minds demand sick toys!
I did a short video showing what the machine is doing
sick minds demand sick toys!
Hi crasher,
How is your Spindle controlled and do you have a Rigid Tapping C Program assigned to Action M119? See here. If there is no Action defined then no operation will be performed. Can you control Spindle Speed/Direction reasonably well with KFLOP Jog Commands as an Axis? If so then instead of the Z motion being slaved to the actual Spindle motion it can be slaved to the Commanded postition in a similar manner as if you had encoder feedback.
HTH
Regards
TK http://dynomotion.com
...write a Sub Program maybe
(SUB 1001)
:1001
G91 (MAY NOT BE NEEDED)
G1Z-.950F12.5
M5 (MAY NOT BE NEEDED)
M4
G4P1.0
Z.95
M5
M3
G4P1.0
G90
G0
M99
(MAIN PROGRAM)
:1000
G54X2.0Y0
G43H1Z.5
S200M3
X0 Y0
M98P1001
X1.0
M98P1001
G80
Last edited by machinehop5; 04-25-2021 at 03:21 PM.
The spindle reacts very very quickly it is controlled using a cnc 4pc C6 board to convert STEP/DIR to an analog signal. From what I saw manually programing a taping cycle, it should react fast enough as long as the spindle is under 300rpm. I have setup many Mitsubishi controls on boring bars that have no spindle rpm feedback and they use a macro program that is just a simple G/M code that pulls variables from the G84 command.
Is there any way for M119 to point to a simple G code program or does it have to be coded in "C"?
sick minds demand sick toys!
Hi crasher,
You didn't answer my question "Can you control Spindle Speed/Direction reasonably well with KFLOP Jog Commands as an Axis?"
I assume you have an axis configured as a Step/Dir axis that commands Jogs to control speeds?
There should then be an effective Steps/Rev Factor that will convert Revs/second to Steps/second. If you then command the Spindle Axis from the KMotion Console Screen to Move say 10 x Steps/Rev does the Spindle move approximately 10 revolutions?
If so, you should then be able to use the Attached C Program with just changes to the defines at the beginning.
A C program is required. Unless you want to use the method machinehop5 posted. But in that case there will be no synchronization at all between the Spindle motion and the Z motion.
Regards
TK http://dynomotion.com
I have never been able to jog the spindle as an axis. I have it configured as axis 7. But I cannot use bit 43 for the direction output.
In order to get the pulse width long enough to trigger the C6, I have to set the output to quadrature.
I had to change the OnCwJog.c and OnCCWJog.c to Setbit 41 for CCW and Setbit 39 for CCW.
From Kmotion Cnc it works good and vfd is setup to update the speed in .5 sec.
What command in the console should make the axis move?
I tried Move7=6000 and nothing happed. I also tried Move0=10 to try and move the X axis and nothing happened.
I have attached the spindle files.
Last edited by crasher455; 04-25-2021 at 11:16 PM.
Hi crasher,
Did you try increasing the Step Pulses to maximum 3.78us?I have never been able to jog the spindle as an axis. I have it configured as axis 7. But I cannot use bit 43 for the direction output.
In order to get the pulse width long enough to trigger the C6, I have to set the output to quadrature.
I had to change the OnCwJog.c and OnCCWJog.c to Setbit 41 for CCW and Setbit 39 for CCW.
The MySpindleDefs.h uses bits 39 and 43. Do they both need to be used?
Anyways it doesn't matter it would just be simpler if the Direction bit was handled automatically. If it needs to be handled manually you will need to change the bits each time the Spindle Moves in the Rigid Tap Program.
Those commands should work. Were the Axes Enabled? Did you set the appropriate direction bit? 10 Steps may be too small to see. Check the Axis Screen to see if they are enabled and if the Destination changes. You might use MoveRel for a relative move.Or MoveRelAtVel to specify the Velocity. ie:What command in the console should make the axis move?
I tried Move7=6000 and nothing happed. I also tried Move0=10 to try and move the X axis and nothing happened.
MoveRelAtVel7=1000 200
You can also try continuous running with a Jog command such as:
Jog7=200
Your MySpindleDefs.h has a Factor of:
#define FACTOR (6000/6000) // to convert RPM to counts/sec (counts/rev / 60.0sec)
Which is 1. This means that If you command a Speed of 60RPM (1 rev/second), the Spindle would be commanded a Jog Velocity of 60 quadrature Steps/Second. So this is 60 quadrature steps per revolution. So commanding a move of 600 should move 10 revs.
You didn't post the program for the S Action.
Regards
TK http://dynomotion.com
I've attached the SpindleJog.c program I think this is what sets the "S" action.
If I use the Jog7=200 command it outputs the step pulses to the VFD board but doesn't switch on the forward or reverse bits.
I saved the tapping program you sent and configured M119 to execute it as Thread 2, variable 1.
Also the SPINDLE_AXIS is set to 7.
I was expecting it to stall and wait for an encoder pulse to sync to. But instead the machine appeared to still ignore the G84 Z height and at the end of the program shot over another 2" in "X" axis after the G28 command.
Here is what comes up on the Console when G84 is executed.
"
Jogging Spindle 200.000000 counts/sec
Bottom = 0.000000
Retract = 0.000000
Peck = 0.000000
Pitch = 0.000000
RPM = 0.000000
Units = mm
Axis = 0
AxisRes = 0.000000
Bottom = 0.000000 Inches
Retract = 0.000000 Inches
Peck = 0.000000 Inches
Pitch = 0.000000 Inches
Z0 = -150000.000000 counts
Z0 = 17976931348623459339141845703125000000000000000000 00000000000000000000000000000000000000000000000000 00000000000000000000
000Z_Dist = 17976931348623459339141845703125000000000000000000 00000000000000000000000000000000000000000000000000 0000000000000
000000Jogging Spindle Stop
Jogging Spindle Stop
"
If I'm reading this right it doesn't look like any of the variables from the G84 and speed command are being read.
I was hoping to modify this program to read the Pitch, and convert it to inches per minute. Then feed the "Z" axis down at the that rate until the programed depth is achieved. Then reverse and feed out at the same rate to the "R" height.
Also one other odd thing is the spindle speed readout goes up when I spin the MPG handle. What variable sets the encoder input bits for the spindle speed?
sick minds demand sick toys!
Hi crasher,
Correct. You need to do this.If I use the Jog7=200 command it outputs the step pulses to the VFD board but doesn't switch on the forward or reverse bits.
change to use the same Var as the program, 60I saved the tapping program you sent and configured M119 to execute it as Thread 2, variable 1.
Regards
TK http://dynomotion.com
I've been busy at work and finally got back to this thing.
I changed the VAR to 60 and now I get readings on the console when I execute a G84. But now what happens is it will move to the R height then "Z" axis will take off at full speed up until it hits the limit switch.
I tried to set the spindle axis to axis 4 the same as the MPG encoder thinking that I might be able to synchronize the Z motion to it and found that the "Z" would move to the "R" height then take off down until it hit the limit switch.
Here is what comes up on the console:
Jogging Spindle 200.000000 counts/sec
Bottom = -0.750000
Retract = 0.200000
Peck = 0.000000
Pitch = 0.062500
RPM = 200.000000
Units = Inches
Axis = 2
AxisRes = 75000.000000
Bottom = -0.750000 Inches
Retract = 0.200000 Inches
Peck = 0.000000 Inches
Pitch = 0.062500 Inches
Z0 = 15000.000362 counts
Z0 = 0.200000 inches
Z_Dist = 0.950000 inches
Jogging Spindle Stop
TotalCut = 0.000000 inches
Jogging Spindle Stop
Is it possible that the program line "Move(Axis,Z0); // move back to where we started " should reference Z0_Inches?
Also is there a way to command a movement at a specific rate? Say if I just wanted the Z axis to only move at 12.5 inches per minute instead of slaving it to an advancing position.
sick minds demand sick toys!
To follow up with the last post.
After working on this further I changed the CNTS_PER_REV to 60 and the SPINDLE_AXIS to 7.
It acted very flakey when I hit the cycle start button but didn't shoot for the limit switch. Just for the hell of it I cycled it thru with the single block button.
I found that when I cycled it thru one line at a time it executed the G84. It fed the Z axis down then back up at a steady rate like it was tapping but the spindle wasn't turning. I Played around adding the forward and reverse setbits in the tapping program and was successful at getting it to cycle thru the tapping cycle.
The problem is if I automatically cycle the program using the cycle start button it does a bunch of random Z moves and doesn't go back to the home position. It's almost like the Kmotion cnc is cycling to the next operation before the tapping program has completed.
here is the g code:
G49
G90G00
G54X0Y0
S200
G43H1Z.2
G84X0Y0R.2Z-.75F.05
X1.0
G80
G00
G49
G28
M05
M30
I have also attached the modified tapping program.
The other thing I tried was changing the thread it starts in M119 to Thread 1 vs Thread 2 where I had it originally. This did the same thing except it disabled my external button program after the first run.
Is there some kind of delay function that needs to be sent back to Kmotion CNC to regulate when it is to execute the next command?
I am going to try to post a video of what it is doing tomorrow morning.
sick minds demand sick toys!
Hi Crasher,
Do you have the M119 Action configured to Execute, wait, and Synchronize before continuing?
Regards
TK http://dynomotion.com
Great thanks for taking the time to post back
Regards
TK http://dynomotion.com