Code: Select all
DefineCoordSystem6(0,1,2,-1,-1,5);
Code: Select all
DefineCoordSystem6(0,1,2,-1,-1,-1);
Moderators: TomKerekes, dynomotion
Code: Select all
DefineCoordSystem6(0,1,2,-1,-1,5);
Code: Select all
DefineCoordSystem6(0,1,2,-1,-1,-1);
Code: Select all
// coordinate systems #0 - axis definitions
extern int CS0_axis_x; // Axis channel number to use as x
extern int CS0_axis_y; // Axis channel number to use as y
extern int CS0_axis_z; // Axis channel number to use as z
extern int CS0_axis_a; // Axis channel number to use as a
extern int CS0_axis_b; // Axis channel number to use as b
extern int CS0_axis_c; // Axis channel number to use as c
extern int CS0_axis_u; // Axis channel number to use as u
extern int CS0_axis_v; // Axis channel number to use as v
Code: Select all
.......
.......
EnableAxis (0);
EnableAxis (1);
EnableAxis (2);
EnableAxis (5); //Spindle
DefineCoordSystem6(0,1,2,-1,-1,5); //Spindle as C axis
.......
.......Code: Select all
#include "KMotionDef.h"
#include "Milling_Machine_24K40_Hardware.h"
/*
//==== All defined in "Milling_Machine_24K40_Hardware.h" ====
#define FACTOR (11468.8/60.0) //1000 counts/sec / 100 counts/rev = 1 RPS = 60 RPM
#define Last_SPEED persist.UserData[2] //save in user variable Last_SPEED the last desired speed
#define Desired_SPEED persist.UserData[3] //desired speed is passed from KMotionCNC in variable Desired_SPEED.
#define Spindle_STATE persist.UserData[4] //save in user variable Spindle_STATE whether it was off, CW, or CCW (0,1,-1)
*/
main()
{
DefineCoordSystem6(0,1,2,-1,-1,-1); //Spindle as Spindle (Off C axis)
printf("M03 start\n");
float speed = *(float *)&Last_SPEED; // value stored is actually a float
float LastState = Spindle_STATE; // get last state
printf("Prewiew spindle state= %f\n",LastState);
if (LastState==-1)
{
Jog(Spindle,0);
while (!CheckDone(Spindle)) StopCoordinatedMotion();
ResumeCoordinatedMotion();
}
printf("Spindle speed= %f\n",speed);
Jog(Spindle,speed * FACTOR);
while ((ch5->last_vel <=(speed * FACTOR/100*95))||(ch5->last_vel >= (speed * FACTOR/100*105))) StopCoordinatedMotion(); //while speed window = 95- 105%
ResumeCoordinatedMotion();
printf("Jogging Spindle %f counts/sec\n",speed * FACTOR);
Spindle_STATE = 1; // remember we are CW
}
Code: Select all
#include "KMotionDef.h"
#include "Milling_Machine_24K40_Hardware.h"
/*
//==== All defined in "Milling_Machine_24K40_Hardware.h" ====
#define FACTOR (11468.8/60.0) //1000 counts/sec / 100 counts/rev = 1 RPS = 60 RPM
#define Last_SPEED persist.UserData[2] //save in user variable Last_SPEED the last desired speed
#define Desired_SPEED persist.UserData[3] //desired speed is passed from KMotionCNC in variable Desired_SPEED.
#define Spindle_STATE persist.UserData[4] //save in user variable Spindle_STATE whether it was off, CW, or CCW (0,1,-1)
*/
main()
{
// spin down
Jog(Spindle,0); //Spindle stop
while (!CheckDone(Spindle)) StopCoordinatedMotion(); //Spindle full stop
ResumeCoordinatedMotion();
Spindle_STATE = 0; // remember we are Off
DefineCoordSystem6(0,1,2,-1,-1,5); //Spindle as C axis
printf("Jogging Spindle Stop\n");
}
As it says this indicates that your V A J settings for the C Axis are such that it would take 4 seconds to stop. Most systems can stop in a fraction of a second. Are they correct?But there's a problem: when you first run a G code, even if the code does not contain spindle or C-axis control, a warning appears:
What do you mean by this? Why are you using .out files? What happens exactly? What Version are you running?Periodically (sometimes), KMotionCNC does not run .C and .Out programs in KFLOP. Variables persist.UserData[] exchange is lost.
Yes, that's right. I have a heavy spindle that accelerates to 4000 rpm in 4 seconds. It can operate also as a C-axis and is controlled and feedback by a quadrature signal 8200 PPR. And it works great in both modes. However, if the C axis is activated immediately during initialization, the trajectory planner displays a message, even if the G code does not contain commands for the spindle or C axis. And I understand that too.As it says this indicates that your V A J settings for the C Axis are such that it would take 4 seconds to stop. Most systems can stop in a fraction of a second. Are they correct?
I use .out files to avoid unnecessary compilation. I've also used .C files, and they've worked just as well. I don't think this has anything to do with the problem.What do you mean by this? Why are you using .out files? What Version are you running?
After receiving this message from the trajectory planner, there are three possible outcomes:What happens exactly?
Thank you! I updated from version 5.3.7 to version 5.4.1 and the problem did not occur.But please upgrade to the latest Version.
Lubrication.ngcCan you post a small GCode file that demonstrates the error?
Code: Select all
G53 G01
G53 Z-1 F6000
G53 X-10 Y-10
G53 X-610 Y-405
M99