Hi all.
As I work with wood, the grain variation and wood species varies a lot in final hardness and feed requeriments.
My machine has spindle load feedback and i converted it to A. The spindle is capable of 15A max load, but sometimes it can go as high as 19A in some grains.
Is there a way to control feed based on the feedback return ?
I can implement in the loop that controls the speed:
If( amperage>18)
{
feed = 80%
} else
feed = 100%
Can someone help me and provide the variables for this ?
Thanks!
Feed control based on spindle load
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: Feed control based on spindle load
Hi Gabriel,
Its not clear what you mean by "A" or how the Amperage is interfaced to KFLOP.
But you can set the current feed rate to 80% with:
SetFRO(0.8);
HTH
Its not clear what you mean by "A" or how the Amperage is interfaced to KFLOP.
But you can set the current feed rate to 80% with:
SetFRO(0.8);
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 79
- Joined: Thu Aug 13, 2020 10:07 pm
Re: Feed control based on spindle load
Hi Tom,
the kanalog is reading the "A", amperage from the motor this way:
double IPR = KANALOG_CONVERT_ADC_TO_VOLTS(ADC(7)) * 5;
Can i read the actual feedrate? to return after the adjust?
int actual_feed = "GetFRO()";
if(IPR>15)
{
SetFRO(0.8);
}else
{
SetFRO(actual_feed);
}
Thanks!
the kanalog is reading the "A", amperage from the motor this way:
double IPR = KANALOG_CONVERT_ADC_TO_VOLTS(ADC(7)) * 5;
Can i read the actual feedrate? to return after the adjust?
int actual_feed = "GetFRO()";
if(IPR>15)
{
SetFRO(0.8);
}else
{
SetFRO(actual_feed);
}
Thanks!
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: Feed control based on spindle load
Hi Gabriel,
The variable CS0_LastFRO contains the last commanded FRO.
You can look these things up yourself in KMotionDef.h
There is also a function SetFROTemp() to temporarily change the Rate without effecting CS0_LastFRO. The original rate can then be resumed with SetFROTemp(CS0_LastFRO);
HTH
The variable CS0_LastFRO contains the last commanded FRO.
You can look these things up yourself in KMotionDef.h
There is also a function SetFROTemp() to temporarily change the Rate without effecting CS0_LastFRO. The original rate can then be resumed with SetFROTemp(CS0_LastFRO);
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 79
- Joined: Thu Aug 13, 2020 10:07 pm
Re: Feed control based on spindle load
Hi Tom.
The final code:
Thanks for the help.
The final code:
Code: Select all
int adjust_rpm; //outside funcion, global scope
void controlspeed()
{
double IPR = KANALOG_CONVERT_ADC_TO_VOLTS(ADC(7)) * 5; // Voltage return from VFD
if (IPR > 10) // if amperage > 10A
{
SetFROTemp(0.8); // Set feed 80%
adjust_rpm = 1; // set variable to confirm feed was modified.
}
if ( IPR < 10 && adjust_rpm == 1) // if amperage is ok and feed was modified, bring it back to normal.
{
SetFROTemp(CS0_LastFRO);
adjust_rpm = 0;
}
}
-
- Posts: 79
- Joined: Thu Aug 13, 2020 10:07 pm
Re: Feed control based on spindle load
Hi Tom.
Need one more help.
I need a non-blocking way to control the maximum spindle amperage and disable the machine if it stays above X value for X time.
Tried using this code, but it just disables.
Need one more help.
I need a non-blocking way to control the maximum spindle amperage and disable the machine if it stays above X value for X time.
Code: Select all
#define DT 3
double LAST_A;
void disable_machine_overload()
{
double IPR = KANALOG_CONVERT_ADC_TO_VOLTS(ADC(7)) * 5; // Voltage return from VFD
static double T0=0.0; // remember the last time we turned on
double T=Time_sec(); // get current Time_sec
if (IPR > 13 && LAST_A > 13 && (T0==0.0 || T > T0 + DT)) {
T0=T;
DoPC(PC_COMM_ESTOP);
printf("T0%5.1f T%5.1f A%5.1f IPR%5.1f sec", T0,T, LAST_A, IPR);
}
LAST_A = IPR;
}
-
- Posts: 79
- Joined: Thu Aug 13, 2020 10:07 pm
Re: Feed control based on spindle load
Me again.
i think the logic for the code was wrong.
This seem to work, but need more testing:
i think the logic for the code was wrong.
This seem to work, but need more testing:
Code: Select all
#define DT 3
double LAST_A;
//static double T0; // remember the last time we turned on
void disable_machine_overload()
{
double IPR = KANALOG_CONVERT_ADC_TO_VOLTS(ADC(7)) * 5; // Voltage return from VFD
static double T0=0.0; // remember the last time we turned on
double T=Time_sec(); // get current Time_sec
//if(T0==0.0)
//T0=T;
if (IPR > 15 && LAST_A > 15) {
T0=T;
DoPC(PC_COMM_ESTOP);
printf("T0%5.1f T%5.1f A%5.1f IPR%5.1f sec", T0,T, LAST_A, IPR);
}
if(T0==0.0 || T > T0 + DT)
{
T0=T;
LAST_A = IPR;
}
}