Spindle Interface
Moderators: TomKerekes, dynomotion
Spindle Interface
Hi Tom,
I have my spindle mostly working. I can turn it on and off, change rotation and change speed. However, having some problems with getting requested speed and actual speed to agree. From the console I did Jog6=100000 and set V out from my C6 board to 10 volts which gave me 24,000 RPM on the inverter display. I did a Jog6=50000 and measured the voltage again and it was 5volts like I would expect. However, instead of 12,000 RPM I had 14,500. I took 100,000/24,000 RPM = 4.166 and used that number in the spindle programs "Factor" variable. I then did an M3 S10000 and got something like 14,000 RPM. As I increased S the difference between the requested RPM and actual got closer. At 24,000 it was right on. The different line slopes between requested RPM and Actual RPM I believe is an inverter issue but I don't see a setting to help correct that problem in the invert documentation. What is the best way to over come this issue in Kmotion? Should I come up with a formula that I can use in the Factor variable or is there a better way?
Jack
I have my spindle mostly working. I can turn it on and off, change rotation and change speed. However, having some problems with getting requested speed and actual speed to agree. From the console I did Jog6=100000 and set V out from my C6 board to 10 volts which gave me 24,000 RPM on the inverter display. I did a Jog6=50000 and measured the voltage again and it was 5volts like I would expect. However, instead of 12,000 RPM I had 14,500. I took 100,000/24,000 RPM = 4.166 and used that number in the spindle programs "Factor" variable. I then did an M3 S10000 and got something like 14,000 RPM. As I increased S the difference between the requested RPM and actual got closer. At 24,000 it was right on. The different line slopes between requested RPM and Actual RPM I believe is an inverter issue but I don't see a setting to help correct that problem in the invert documentation. What is the best way to over come this issue in Kmotion? Should I come up with a formula that I can use in the Factor variable or is there a better way?
Jack
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Spindle Interface
Hi Jack,
If the measured voltages respond linearly then KFLOP and the C6 are working correctly. I agree the issue seems to be with the Inverter.
Is there an encoder output from the Spindle or Inverter? If so you could run closed loop for exact speed control.
Otherwise I think you would need to include a correction formula.
If the measured voltages respond linearly then KFLOP and the C6 are working correctly. I agree the issue seems to be with the Inverter.
Is there an encoder output from the Spindle or Inverter? If so you could run closed loop for exact speed control.
Otherwise I think you would need to include a correction formula.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Spindle Interface
Hi Tom,
I found that moving the inverter and C6 as far from the control panel and wiring as possible and running a shielded CAT 5 cable between the Kflop and C6 seems to have fixed the non linear issues and any other strange occurrences.
It does appear that there is an output that could be used for feedback to the Kflop with a couple of different operating modes. See attachment. This is all the documentation I can find at the moment. Is there a sample C program that I might be able to use for this feedback loop?
The only remaining minor issue is that when the spindle is running, if I adjust the spindle speed slider the spindle turns off. If I then click the ON CW button the spindle restarts and goes to the new speed set by the slider. I'm using the Spindle C programs provided with Kmotion, i.e., SpindleMillJogDir.c, SpindleOnCCWJogDir.c, SpindleOnCWJogDir.c and SpindleOffJogDir.c. Why is the Spindle turning off?
Jack
I found that moving the inverter and C6 as far from the control panel and wiring as possible and running a shielded CAT 5 cable between the Kflop and C6 seems to have fixed the non linear issues and any other strange occurrences.
It does appear that there is an output that could be used for feedback to the Kflop with a couple of different operating modes. See attachment. This is all the documentation I can find at the moment. Is there a sample C program that I might be able to use for this feedback loop?
The only remaining minor issue is that when the spindle is running, if I adjust the spindle speed slider the spindle turns off. If I then click the ON CW button the spindle restarts and goes to the new speed set by the slider. I'm using the Spindle C programs provided with Kmotion, i.e., SpindleMillJogDir.c, SpindleOnCCWJogDir.c, SpindleOnCWJogDir.c and SpindleOffJogDir.c. Why is the Spindle turning off?
Jack
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Spindle Interface
Hi Jack,
I can't think of a reason the Spindle would stop.
What is printed on the KMotion.exe Console when you move the slider and the Spindle stops?
What Version of KMotion are you running?
Usually you are required to modify those program's defines for your system. Please post the exact 4 programs you are using.
Also post KMotionCNC's Tool Setup's configuration for those files.
I can't think of a reason the Spindle would stop.
What is printed on the KMotion.exe Console when you move the slider and the Spindle stops?
What Version of KMotion are you running?
Usually you are required to modify those program's defines for your system. Please post the exact 4 programs you are using.
Also post KMotionCNC's Tool Setup's configuration for those files.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Spindle Interface
Hi Tom,
Jogging Spindle 50832.000000 counts/sec //Now click on slider. Slider display still says 1.00 but counts increase
Jogging Spindle 52008.000000 counts/sec //Clicking on Off stops the spindle.
Jogging Spindle Stop
KFLOP 4.35h Build 14:31:18 Sep 19 2022
KFLOP 4.35h
Ready
Am I using KMVAR correctly?
Jack
Today's issue is slightly different. If I start my spindle out at 12,000 RPM (50832 counts/sec) and click on the slider the spindle doesn't stop but immediately slows to 6000 RPM even though the console shows an increase in counts/sec.What is printed on the KMotion.exe Console when you move the slider and the Spindle stops?
Jogging Spindle 50832.000000 counts/sec //Now click on slider. Slider display still says 1.00 but counts increase
Jogging Spindle 52008.000000 counts/sec //Clicking on Off stops the spindle.
Jogging Spindle Stop
versionWhat Version of KMotion are you running?
KFLOP 4.35h Build 14:31:18 Sep 19 2022
KFLOP 4.35h
Ready
See Attached.Usually you are required to modify those program's defines for your system. Please post the exact 4 programs you are using.
See Attached.Also post KMotionCNC's Tool Setup's configuration for those files.
Am I using KMVAR correctly?
Jack
- Attachments
-
- SpindleOnCWJogDir.c
- (1.07 KiB) Downloaded 241 times
-
- SpindleOnCCWJogDir.c
- (1.05 KiB) Downloaded 238 times
-
- SpindleOffJogDir.c
- (645 Bytes) Downloaded 234 times
-
- SpindleMillJogDir.c
- (991 Bytes) Downloaded 242 times
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Spindle Interface
Hi Jack,
I think I see the problem. In SpindeMillJogDir.c this:
Commands the speed without using the FACTOR but prints using it. Try changing to:
I think I see the problem. In SpindeMillJogDir.c this:
Code: Select all
Jog(SPINDLEAXIS, LastState * speed);
printf("Jogging Spindle %f counts/sec\n", speed * FACTOR);
Code: Select all
Jog(SPINDLEAXIS, speed * FACTOR);
printf("Jogging Spindle %f counts/sec\n", speed * FACTOR);
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Spindle Interface
Hi Tom,
Thanks, that was it. I must have changed that line when I was getting my spindle working and forgot to change it back.
Next question, if I change the slider while running a program that new slider multiplier does not reset when I start the next program. How can I get the slider to reset to 1 when I start the next program? Same question for resetting the forward speed slider.
Jack
Thanks, that was it. I must have changed that line when I was getting my spindle working and forgot to change it back.
Next question, if I change the slider while running a program that new slider multiplier does not reset when I start the next program. How can I get the slider to reset to 1 when I start the next program? Same question for resetting the forward speed slider.
Jack
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Spindle Interface
Hi Jack,
Its not clear if an Operator would always want that.
But calling this from a forever loop should reset them whenever execution begins.
Its not clear if an Operator would always want that.
But calling this from a forever loop should reset them whenever execution begins.
Code: Select all
// Reset all sliders whenever execution starts
void ResetSliders(void)
{
static int PrevJobActive=-1;
int NewJobActive;
NewJobActive = JOB_ACTIVE; //sample
if (NewJobActive != PrevJobActive) // changed?
{
PrevJobActive = NewJobActive; //save
if (NewJobActive) // started?
{
DoPCFloat(PC_COMM_SET_FRO,1); // Reset Sliders
DoPCFloat(PC_COMM_SET_RRO,1);
DoPCFloat(PC_COMM_SET_SSO,1);
}
}
}
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Spindle Interface
Hi Tom,
That worked. Took a little bit of thinking for a copy and paste programmer like me but I finally figured it out.
Jack
That worked. Took a little bit of thinking for a copy and paste programmer like me but I finally figured it out.
Jack