Programmable 'stop' during jogging.....

Moderators: TomKerekes, dynomotion

SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

Programmable 'stop' during jogging.....

Post by SamMarrocco » Sat Jan 06, 2024 3:54 pm

What is a good method of having a programmable 'stop' on an axes? Would using a soft limit be best for this, or another method?

I'd like it to honor manual jogging of axes, as well as my custom pendant/encoder wheel, which uses KFlop C Code to move an axes. I would prefer that it didn't decellerate, but rather came to an abrupt halt, as would a manual operation cranking a lathe with a physical stop in place.

User avatar
TomKerekes
Posts: 2546
Joined: Mon Dec 04, 2017 1:49 am

Re: Programmable 'stop' during jogging.....

Post by TomKerekes » Sat Jan 06, 2024 10:03 pm

Hi Sam,

You might use Soft Limits. Normally Soft Limits begin to stop at the limit and result in a small overshoot of the actual limit. There is a technique to adjust the limit such that the stop begins before the limit and comes to a stop right at the limit. See this Thread.

But why would you want an abrupt stop rather than a controlled stop? An abrupt stop might cause loss of position or damage to the machine.

You can always monitor axis positions in a forever loop and do whatever you want.
Regards,

Tom Kerekes
Dynomotion, Inc.

SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

Re: Programmable 'stop' during jogging.....

Post by SamMarrocco » Sun Jan 07, 2024 1:41 pm

Loss of position wouldn’t be an issue in this case it’s a manual operation being controlled by a pendant, so the forever loop might be the way to go.

I’ll look at the thread you suggested as well, thank you.

SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

Re: Programmable 'stop' during jogging.....

Post by SamMarrocco » Fri Mar 01, 2024 5:28 am

Tom,
Took me a while to get back to this.....
I implemented Soft Limits as you suggested, with the goal of coming to a controlled stop. As expected, when a Pos X is set of +.5 (allowing for counts) and I Jog right towards that value, the soft limit triggers a feedhold and slows the axis to a stop. Again, as expected, the stop is triggered at +.5, then gradually slows to a stop somwhere close to .52

I have followed the technique you suggested and am running a loop in KFlop thread 7 of the AdjustSoftLimits.c code. However, I'm not seeing any actual difference in the 'stopping distance' as the axis still slows to a stop past the actual soft limit value.

The KFlop AdjustSoftLimits C code seems to be running with no errors, and I'm assuming that the "integrated functions" called by that code obtain all their required values from the KFlop dynamically as the loop runs and that with that code running, the axis should slow to a stop right on +.5

Am I missing a step here or do you have a suggestion for something I can check to determine why it isn't having the desired effect?

User avatar
TomKerekes
Posts: 2546
Joined: Mon Dec 04, 2017 1:49 am

Re: Programmable 'stop' during jogging.....

Post by TomKerekes » Fri Mar 01, 2024 8:16 am

Hi Sam,

I just tested with Version 5.3.2 and it seems to work correctly.

What Version are you running?

Is 0.5 inches or mm?

Where are youstarting to Jog from?

Are you running AdjustSoftLimitsTest.c in Thread 7?

Please post your Initialization C Program.

Please Post your GCodeConfigCNC.txt file.
Regards,

Tom Kerekes
Dynomotion, Inc.

SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

Re: Programmable 'stop' during jogging.....

Post by SamMarrocco » Fri Mar 01, 2024 2:56 pm

Tom,

Running 5.3.1.

.5 is in inches units.

Parked at 0.0, then begin jogging to the right, with a PosX for the X-Axis of .5"

Sorry, I should have said, AdjustSoftLimitsTest.c is running in Thread 7.

I don't have a GCodeConfigCNC.txt per se.....As this is my own vb.net application and not KMotionCNC, and I set most of my KFlop values from code. Are there some particular values you would like to see? Perhaps I can write a quick "data dump to text file" of those values. Is it the Axes settings you'd like to see?

User avatar
TomKerekes
Posts: 2546
Joined: Mon Dec 04, 2017 1:49 am

Re: Programmable 'stop' during jogging.....

Post by TomKerekes » Fri Mar 01, 2024 3:48 pm

I’d like to try with the same axis settings and Jog speed. All the axes in the Coordinate System can be relevant. You might try with KMotionCNC to see if it works.
Regards,

Tom Kerekes
Dynomotion, Inc.

SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

Re: Programmable 'stop' during jogging.....

Post by SamMarrocco » Sun Mar 03, 2024 8:59 pm

Tom,
I will try to 'port' my settings from my custom app to KMotionCNC when I have a chance.

In the meantime, here is a 'debugging output' from my app of the controller's settings (inline). I think it includes everything you were requesting. If not, let me know and I will add more info.

The soft limits themselves seem to be working, but the AdjustSoftLimitsText.c seems to be ignored. I'm certain it's running in thread 7 (if I introduce a typo, it fails to compile in my app and run). Interesting....

My app's debugging output follows:

Application Info:
MillDroid v7.0.2494
Debugging info output on 3/3/2024 3:45:37 PM

KFLOP Information:
FIRMWARE v2
Boards total: 1
Board ID: 27
Board Type: 2
Board is connected: True
Board is ready: 0

KFLop motion parameters:
CoordMotion.MotionParameters:
.CountsPerInchX: 40000
.CountsPerInchY: 40000
.MaxVelX: 3
.MaxVelY: 3
.MaxAccelA: 3
.MaxAccelA: 3

KFlop tuning parameters
X-Axis
Controller
AxisID: 0
.Velocity: 0
.Acceration: 200000
.TuningParams
.InputMode:0
.OutputMode:6
.Jerk:4000000
.Pgain:0
.Igain:0.01
.Dgain:0
.FFAccel:0
.FFVel:0
.MaxI:200
.MaxErr:1000000
.MaxOutput:200
.DeadBandGain:1
.InputChan0:0
.InputChan1:0
.OutputChan0:8
.OutputChan1:0
.MasterAxis:-1
.SoftLimitNeg:-20000
.SoftLimitPos:20000
.InputGain0:1
.InputGain1:1
.InputOffset0:0
.InputOffset1:0
.OutputGain:1
.OutputOffset:0
.SlaveGain:1
.InvDistPerCycle:1
.Lead:0
.MaxFollowingError:1000000000
.StepperAmplitude:20
.SetIIR0(1, 0, 0, 0, 0)
.SetIIR1(1, 0, 0, 0, 0)
.SetIIR2(0.000769, 0.001538, 0.000769, 1.92076, 0.923833)
.BacklashMode:1
.BacklashAmount:210
.BacklashRate:5000

Y-Axis
Controller
AxisID: 1
.Velocity: 0
.Acceration: 200000
.TuningParams
.InputMode:0
.OutputMode:6
.Jerk:4000000
.Pgain:0
.Igain:0.01
.Dgain:0
.FFAccel:0
.FFVel:0
.MaxI:200
.MaxErr:1000000
.MaxOutput:200
.DeadBandGain:1
.InputChan0:0
.InputChan1:0
.OutputChan0:9
.OutputChan1:0
.MasterAxis:-1
.SoftLimitNeg:-999999
.SoftLimitPos:999999
.InputGain0:1
.InputGain1:1
.InputOffset0:0
.InputOffset1:0
.OutputGain:-1
.OutputOffset:0
.SlaveGain:1
.InvDistPerCycle:1
.Lead:0
.MaxFollowingError:1000000000
.StepperAmplitude:20
.SetIIR0(1, 0, 0, 0, 0)
.SetIIR1(1, 0, 0, 0, 0)
.SetIIR2(0.000769, 0.001538, 0.000769, 1.92076, 0.923833)
.BacklashMode:1
.BacklashAmount:336
.BacklashRate:5000

User avatar
TomKerekes
Posts: 2546
Joined: Mon Dec 04, 2017 1:49 am

Re: Programmable 'stop' during jogging.....

Post by TomKerekes » Mon Mar 04, 2024 12:46 am

Hi Sam,

It seems you only have 2 axes XY? Is your AdjustSoftLimitsTest.c adjusting 4 axes or 2? How is your Coordinate system defined? You might check with DefineCS in the KMotion Console. Only X and Y? What is your Jog Speed into the Soft Limit?

You might check if Thread 7 is actually running using KMotion.exe C Programs Screen. There should be a green bar over Thread #7. Just because it is being compiled doesn't necessarily mean it is executing or hasn't been stopped somehow. You might run it from KMotion.exe as another check.

To get Axis settings for KMotionCNC you might configure the axes with your App. Upload Axis 0 and 1 to KMotion. Then Export to a C Program.
Regards,

Tom Kerekes
Dynomotion, Inc.

SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

Re: Programmable 'stop' during jogging.....

Post by SamMarrocco » Mon Mar 04, 2024 1:33 am

Yes, for testing this I'm only using my Lathe (which only uses two axes, labeled X and Y, against common nomenclature).

I'm using AdjustSoftLimitsTest.c to adjust all four, even though they aren't all in use at the moment.
My Jog Speed into the soft limit during testing (using my pendant) is pretty slow, approximately .25 to .5 Inches per second.

Good point about possibly being compiled but possibly being stopped. I'll check into the 'green bar' and get back to you. Thanks.

Post Reply