Hi
I useing simplehomeindexfuctiontest for homeing and my question is how can I disable soft limits only for homeing button in Kmotioncnc?
I use 3 Limiting Switches on 3 axis for Homeing.
Homeing Soft limits
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2680
- Joined: Mon Dec 04, 2017 1:49 am
Re: Homeing Soft limits
Set the soft limits to huge values. ie 1e30 and -1e30. Then after homing finishes set to normal values.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 4
- Joined: Wed Jun 03, 2020 9:05 am
Re: Homeing Soft limits
Thank you! That will work i will add new soft limits in program before and after homing
Hi
-
- Posts: 4
- Joined: Wed Jun 03, 2020 9:05 am
Re: Homeing Soft limits
Hi
#Q1 I upgraded code but i have problem with randomly working limit switches.
Last day works good three times but at 4th just go back without touch limit switch.
Its randomly how its work.
I have 1 input for all 3 axes but can do more if that helps.
Limit Switches are reliably
Kind of Limit Switch:
and its connect to KFLOP all to port 0
#Q2
I use DoPC(PC_COMM_HALT); on end because i think it will restart my coords after moved from Limit Switches,how can i restart coords in C?
my code:
#Q1 I upgraded code but i have problem with randomly working limit switches.
Last day works good three times but at 4th just go back without touch limit switch.
Its randomly how its work.
I have 1 input for all 3 axes but can do more if that helps.
Limit Switches are reliably
Kind of Limit Switch:
and its connect to KFLOP all to port 0
#Q2
I use DoPC(PC_COMM_HALT); on end because i think it will restart my coords after moved from Limit Switches,how can i restart coords in C?
my code:
Code: Select all
#include "KMotionDef.h"
#include "SimpleHomeIndexFunction.c"
#define TMP 10
#include "KflopToKMotionCNCFunctions.c"
main()
{
int result;
ch0->LimitSwitchOptions=0x0;
ch0->SoftLimitPos=1e30;
ch0->SoftLimitNeg=-1e30;
ch1->LimitSwitchOptions=0x0;
ch1->SoftLimitPos=1e30;
ch1->SoftLimitNeg=-1e30;
ch2->LimitSwitchOptions=0x0;
ch2->SoftLimitPos=1e30;
ch2->SoftLimitNeg=-1e30;
// HOME Z
result = SimpleHomeIndexFunction(2, // axis number to home
10000.0, // speed to move toward home
+1, // direction to move toward home (+1 or -1)
0, // limit bit number to watch for
1, // limit polarity to wait for (1 or 0)
100.0, // speed to move while searching for index
-1, // index bit number to watch for (use -1 for none)
1, // index polarity to wait for (1 or 0)
15000); // amount to move inside limits
if (result==0)
{
printf("Home Z succeded\n");
}
else
{
printf("Home Z failed\n");
return;
}
// HOME X
result = SimpleHomeIndexFunction(0, // axis number to home
5000.0, // speed to move toward home
+1, // direction to move toward home (+1 or -1)
0, // limit bit number to watch for
1, // limit polarity to wait for (1 or 0)
100.0, // speed to move while searching for index
-1, // index bit number to watch for (use -1 for none)
1, // index polarity to wait for (1 or 0)
45000); // amount to move inside limits
if (result==0)
{
printf("Home X succeded\n");
}
else
{
printf("Home X failed\n");
return;
}
// HOME Y
result = SimpleHomeIndexFunction(1, // axis number to home
10000.0, // speed to move toward home
-1, // direction to move toward home (+1 or -1)
0, // limit bit number to watch for
1, // limit polarity to wait for (1 or 0)
100.0, // speed to move while searching for index
-1, // index bit number to watch for (use -1 for none)
1, // index polarity to wait for (1 or 0)
43000); // amount to move inside limits
ch0->LimitSwitchOptions=0x0;
ch0->SoftLimitPos=46000;
ch0->SoftLimitNeg=-46000;
ch1->LimitSwitchOptions=0x0;
ch1->SoftLimitPos=60000;
ch1->SoftLimitNeg=-4e+4;
ch2->LimitSwitchOptions=0x0;
ch2->SoftLimitPos=18000;
ch2->SoftLimitNeg=-30000;
DoPC(PC_COMM_HALT); // stop KMotionCNC
if (result==0)
{
printf("Home Y succeded\n");
}
else
{
printf("Home Y failed\n");
return;
}
}
Hi
- TomKerekes
- Posts: 2680
- Joined: Mon Dec 04, 2017 1:49 am
Re: Homeing Soft limits
Hi Remixter01,
KFLOP Input Bit 0 must be driven low (< 0.4V) and driven high (> 2.4V) to work reliably. A simple switch can not do this. How do you have it wired?
KFLOP Input Bit 0 must be driven low (< 0.4V) and driven high (> 2.4V) to work reliably. A simple switch can not do this. How do you have it wired?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 4
- Joined: Wed Jun 03, 2020 9:05 am
Re: Homeing Soft limits
limit switches are connected indirectly through the optical module I/O.
If limit switch its activated then gives 4V if not 0V
Axis go back even if limit switch wasn't give a signal
If limit switch its activated then gives 4V if not 0V
Axis go back even if limit switch wasn't give a signal
Hi
- TomKerekes
- Posts: 2680
- Joined: Mon Dec 04, 2017 1:49 am
Re: Homeing Soft limits
Hi Remixter01,
You might try adding a filter capacitor (~0.1uF Ceramic) close to KFLOP to filter noise spikes.
Does this mean the axis was moving toward the limit switch but then reversed as if it hit the switch but had not reached the limit switch yet? In this case the most likely thing would be noise causing a false limit condition.Last day works good three times but at 4th just go back without touch limit switch.
What kind of optical module? How long is the wiring between it and KFLOP?limit switches are connected indirectly through the optical module I/O.
You might try adding a filter capacitor (~0.1uF Ceramic) close to KFLOP to filter noise spikes.
Is it driven to 0V? Or just left "floating"?If limit switch its activated then gives 4V if not 0V
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.