1 Attachment(s)
SnapAMP soft limit issue ?
Hi i finish to setup and make homing on my machine but got some issue whit soft limit switch
on Z-axi i got 250 encoder cont over shoot on soft limit ,that not critical just anoing
but on X axis the soft limit not work ! ,debug console tell me limit reach and go into feed hold ,but motor still move until physically spindle hit rotary table :eek:
any idea ? i try many may option for LimitSwitchOptions=0x whit similar result
Best regard Marc Alphatronique
that config i use
#include "KMotionDef.h"
// Configuration and Homing program for a 3 axis System
// Limit switches are disabled and used as a home switch
// then they are re-enabled
main()
{
int SaveXLimits,SaveYLimits,SaveZLimits; //place to save limit switch settings
DisableAxis(0); // Disable all axes
DisableAxis(1);
DisableAxis(2);
// Set the axis parameters here
// after everything is configured in the KMotion Screens
// use copy C Code to clipboard on the configuration screen
// then paste here. Repeat for each axis
WriteSnapAmp(SNAP0+SNAP_PEAK_CUR_LIMIT0,10);
WriteSnapAmp(SNAP0+SNAP_PEAK_CUR_LIMIT1,10);
ch0->InputMode=ENCODER_MODE;
ch0->OutputMode=DC_SERVO_MODE;
ch0->Vel=100000;
ch0->Accel=2e+06;
ch0->Jerk=900000;
ch0->P=30;
ch0->I=0;
ch0->D=10;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=500;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=8;
ch0->InputChan1=0;
ch0->OutputChan0=8;
ch0->OutputChan1=0;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x120;
ch0->LimitSwitchNegBit=0;
ch0->LimitSwitchPosBit=0;
ch0->SoftLimitPos=100;
ch0->SoftLimitNeg=-290000;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000;
ch0->StepperAmplitude=20;
ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;
ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;
ch0->iir[2].B0=1;
ch0->iir[2].B1=0;
ch0->iir[2].B2=0;
ch0->iir[2].A1=0;
ch0->iir[2].A2=0;
ch1->InputMode=NO_INPUT_MODE;
ch1->OutputMode=STEP_DIR_MODE;
ch1->Vel=10000;
ch1->Accel=400000;
ch1->Jerk=4e+06;
ch1->P=0;
ch1->I=0.01;
ch1->D=0;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=200;
ch1->MaxErr=1e+06;
ch1->MaxOutput=200;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=0;
ch1->InputChan1=0;
ch1->OutputChan0=5;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x100;
ch1->LimitSwitchNegBit=0;
ch1->LimitSwitchPosBit=0;
ch1->SoftLimitPos=1e+06;
ch1->SoftLimitNeg=1e+06;
ch1->InputGain0=1;
ch1->InputGain1=1;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=20;
ch1->StepperAmplitude=20;
ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;
ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;
ch1->iir[2].B0=1;
ch1->iir[2].B1=0;
ch1->iir[2].B2=0;
ch1->iir[2].A1=0;
ch1->iir[2].A2=0;
ch2->InputMode=ENCODER_MODE;
ch2->OutputMode=STEP_DIR_MODE;
ch2->Vel=10000;
ch2->Accel=400000;
ch2->Jerk=4e+06;
ch2->P=0;
ch2->I=0.01;
ch2->D=0;
ch2->FFAccel=0;
ch2->FFVel=0;
ch2->MaxI=200;
ch2->MaxErr=1e+06;
ch2->MaxOutput=200;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=0;
ch2->InputChan1=0;
ch2->OutputChan0=4;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x110;
ch2->LimitSwitchNegBit=0;
ch2->LimitSwitchPosBit=0;
ch2->SoftLimitPos=100;
ch2->SoftLimitNeg=-27000;
ch2->InputGain0=-2.5;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=20;
ch2->StepperAmplitude=20;
ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2->iir[0].A1=0;
ch2->iir[0].A2=0;
ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;
ch2->iir[2].B0=1;
ch2->iir[2].B1=0;
ch2->iir[2].B2=0;
ch2->iir[2].A1=0;
ch2->iir[2].A2=0;
// disable the limits (first save how they were set)
SaveXLimits = ch0->LimitSwitchOptions;
SaveYLimits = ch1->LimitSwitchOptions;
SaveZLimits = ch2->LimitSwitchOptions;
// ch0->LimitSwitchOptions = 0;
// ch1->LimitSwitchOptions = 0;
// ch2->LimitSwitchOptions = 0;
// enable all 3 axes and begin servoing where we are
EnableAxis(0);
EnableAxis(1);
EnableAxis(2);
// Home Z up first - jog until it sees the limit
ch2->SoftLimitPos=270000;
ch2->SoftLimitNeg=-270000;
Jog(2,500); // jog slowly positive
while (!ReadBit(76)) ; // loop until IO bit goes high
Jog(2,0); // stop
while (!CheckDone(2)) ; // loop until motion completes
DisableAxis(2); // disable the axis
Zero(2); // Zero the position
ch2->SoftLimitPos=100;
ch2->SoftLimitNeg=-26000;
EnableAxis(2); // re-enable the ServoTick
Move(2,-1000.0); // move some amount inside the limits
while (!CheckDone(2)) ; // loop until motion completes
//ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
// Home X next - jog until it sees the limit
ch0->SoftLimitPos=290000;
ch0->SoftLimitNeg=-290000;
Jog(0,1000); // jog slowly negative
while (!ReadBit(77)) ; // loop until IO bit goes high
Jog(0,0); // stop
while (!CheckDone(0)) ; // loop until motion completes
DisableAxis(0); // disable the axis
Zero(0); // Zero the position
ch0->SoftLimitPos=100;
ch0->SoftLimitNeg=-290000;
EnableAxis(0); // re-enable the ServoTick
Move(0,-1000.0); // move some amount inside the limits
while (!CheckDone(0)) ; // loop until motion completes
//ch0->LimitSwitchOptions = SaveXLimits; // restore limit settings
// Home Y next - jog until it sees the limit
// Jog(1,-100); // jog slowly negative
// while (!ReadBit(9)) ; // loop until IO bit goes high
// Jog(1,0); // stop
// while (!CheckDone(1)) ; // loop until motion completes
// DisableAxis(1); // disable the axis
// Zero(1); // Zero the position
// EnableAxis(1); // re-enable the ServoTick
// Move(1,1000.0); // move some amount inside the limits
// while (!CheckDone(1)) ; // loop until motion completes
ch1->LimitSwitchOptions = SaveYLimits; // restore limit settings
// DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
}
Re: SnapAMP soft limit issue ?
i use version KMotion434k
Re: SnapAMP soft limit issue ?
Hi Marc,
Strange. I'm not sure why. Here are some things to check:
The Soft Limits issue a Feedhold which only stops the Axes defined in the Coordinated Motion System. I see you have your
//DefineCoordSystem(0,1,2,-1); //Define XYZ coordinated motion axes
commented out. Did you exclude X from the Coordinated Motion System? Please define the Coordinate System.
Have you Flashed any changes to KFLOP? If so please restore by doing a "New Version".
I see Axis 1 has the Neg Limit set to a Positive number. This may trigger an immediate Feedhold when enabled.
ch1->SoftLimitPos=1e+06;
ch1->SoftLimitNeg=1e+06;
Please check that your Init program actually finishes and the Soft Limits are set properly.
Regards
Re: SnapAMP soft limit issue ?
Hi
system init and the tread end so that part seem good
Ch1 not have or use limit Switch it a rotary table "A" axis
will test Coordinated Motion System
i commented it since not idea what that do , have assumed that is for G-code part and not yet a that step , so probably bad idea ;-)
Re: SnapAMP soft limit issue ?
ok uncommnet the DefineCoordSystem(0,1,2,-1) and still same issue ,and i able to move 30000 over the limit that is ~1 feet !!
1 Attachment(s)
Re: SnapAMP soft limit issue ?
Hi Marc,
So your resolution is ~ 2500 counts/inch?
You are commanding a Velocity of 100000 counts/sec. That's 40ips (2400ipm). Can your system really move that fast??
You are also specifying a fairly low Jerk of 900000 counts/sec^3. With these settings you are forcing KFLOP to accelerate and decelerate over ~ 1 foot.
Here is a plot of your settings. Notice it takes about 35000 counts to accelerate and 35000 counts to decelerate:
Attachment 391238
Can you reduce your Max Velocity and increase Jerk to allow KFLOP to stop in a shorter distance?
Regards
Re: SnapAMP soft limit issue ?
HI this may help figure the machine no extremely fast i slow down speed https://youtu.be/PMksI43K_gw
on the X each encoder count = 6um
the hight velocity come from the 5,000 cont encoder so Kflop see 20,000 per revolution , 6 feet of travel = ~290,000 cont
so 4027 count per inch
i must admit that the "jerk" confuse me a bit ..
Best regard
Re: SnapAMP soft limit issue ?
have increase jerk ,move start to be bit bit violent and got axi following error
it bit help a bit but still 16000 cont so 4" , need to be under 1/2" or better
did the trajectory planet on the CNC soft help a bit on this ?? i try to have fist layer reliable before put G-code over head
Re: SnapAMP soft limit issue ?
i end up whit 1/2 delrin rod as shock absorber for avoid spindle hit
increase jerk and velocity and even slower accel and still need significant deceleration time
Re: SnapAMP soft limit issue ?
Hi Mark,
It seems your system really needs a large distance to start and stop.
In this case you can add a User Program that will monitor Velocity, Acceleration, and Distance to the Soft Limits to begin stopping before reaching the Soft Limits.
See the AdjustSoftLimits.c and AdjustSoftLimitsTest.c examples.
Here is the code you will need to add:
Code:
#include "KMotionDef.h"
#include "AdjustSoftLimits.c"
// tests functionality of adjusting softlimits feedhold based on
// Velocity and Acceleration using the CheckDistToStop Calculations
main()
{
for (;;)
{
WaitNextTimeSlice();
CheckDistToStop(ch0);
CheckDistToStop(ch2);
}
}
HTH
Regards