Since I've been using my little milling machine quite a bit lately, I'm working through the to do/finish list.
One thing that's causing me problems, is soft limits.
If I jog the Y-axis using the MPG (I'm using MPGServiceSmoothHardwareEncFiltered.c ), I can physically see that it overshoots the soft limit, then moves back to the soft limit (using AdjustSoftLimits.c).
In the positive direction, this can result in the physical limit switch being hit. I've obviously been a bit more conservative in the negative direction, as there is enough travel for the axis to bounce without hitting the limit switch.
I say Y-axis, as that's the axis it's most notable on for some reason, despite Vel,Acc, and Jerk being identical on all axis.
I do have my Init written so only once axis gets serviced per time slice.
Could it be I need to increase the CALC_TIME_CLICKS value in AdjustSoftLimits?
I would have thought the default 2ms was a long enough period, given there is only one active thread.
Soft Limit Overshooting
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: Soft Limit Overshooting
Hi Moray,
Strange it would behave differently on the axis with the same code and parameters. Possibly it might be a following error issue. For example if the axis is moved too fast which results in a large following error so that when the axis catches up it overshoots even though the commanded trajectory does not. You might set the Max Following Error to a small value to see if this is the case. The axis should then fault if it is.
Otherwise please post your Initialization Program with any include files.
I assume you must move the MPG fast for this to occur? Can you estimate what speed is required?
Strange it would behave differently on the axis with the same code and parameters. Possibly it might be a following error issue. For example if the axis is moved too fast which results in a large following error so that when the axis catches up it overshoots even though the commanded trajectory does not. You might set the Max Following Error to a small value to see if this is the case. The axis should then fault if it is.
Otherwise please post your Initialization Program with any include files.
I assume you must move the MPG fast for this to occur? Can you estimate what speed is required?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Soft Limit Overshooting
I should have mentioned this is a basic stepper driven machine, although now you mention it, I can wind the MPG faster than the axis can move, however the MPG code should limit movement to the axis soft limit.
Could it be the MPG and Soft Limit code are somehow fighting against each other?
I've attached all the files used for the main init (With the exception of KMotionDef and KFltoptoKMotionCNC, as they're the standard files.
I was trying to think of some way to catch the relevant data, but I'm struggling to think of a simple method that would only log when there is MPG/Axis movement.
Could it be the MPG and Soft Limit code are somehow fighting against each other?
I've attached all the files used for the main init (With the exception of KMotionDef and KFltoptoKMotionCNC, as they're the standard files.
I was trying to think of some way to catch the relevant data, but I'm struggling to think of a simple method that would only log when there is MPG/Axis movement.
- Attachments
-
- TriacInit.c
- (8.57 KiB) Downloaded 52 times
-
- TriacTC.c
- (10.99 KiB) Downloaded 60 times
-
- TriacEStop.c
- (3.74 KiB) Downloaded 50 times
-
- TriacControlPanel.c
- (3.24 KiB) Downloaded 51 times
-
- triac.h
- (4.26 KiB) Downloaded 50 times
-
- MPGServiceSmoothHardwareEncFiltered.c
- (3 KiB) Downloaded 51 times
-
- AdjustSoftLimits.c
- (4.21 KiB) Downloaded 51 times
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: Soft Limit Overshooting
Hi Moray,
I'm having difficulty reproducing the problem. I only see about 20 counts of overshoot. I set the soft limit to 200000. But I had to comment out much of everything other than your MPG routine as I don't have your hardware. You might temporarily comment out everything other than the MPG call to see if the overshoot still occurs. I'm Jogging Axis 5 in quadrature mode 10000 counts/sec to simulate a fast spinning MPG. I've attached the modified files that can run without any hardware that I used and also the data capture program. Again strange it would only do it on one axis.
I'm having difficulty reproducing the problem. I only see about 20 counts of overshoot. I set the soft limit to 200000. But I had to comment out much of everything other than your MPG routine as I don't have your hardware. You might temporarily comment out everything other than the MPG call to see if the overshoot still occurs. I'm Jogging Axis 5 in quadrature mode 10000 counts/sec to simulate a fast spinning MPG. I've attached the modified files that can run without any hardware that I used and also the data capture program. Again strange it would only do it on one axis.
- Attachments
-
- CaptureXYZMotionToFileWithHeaderMoray.c
- (977 Bytes) Downloaded 48 times
-
- TriacInit.c
- (8.61 KiB) Downloaded 51 times
-
- triac.h
- (4.27 KiB) Downloaded 48 times
-
- MPGServiceSmoothHardwareEncFiltered.c
- (3.18 KiB) Downloaded 49 times
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Soft Limit Overshooting
I'm just going to sit in the corner and pretend I never started this thread.
Spent a bit time tonight testing things, and after much code testing, I found the the Y-axis is bouncing of the rear bellows before it reaches the negative limit switch, which then means it runs into the positive limit switch because the axis has lost position
That's one more problem located, just need to work on solving it now..
Spent a bit time tonight testing things, and after much code testing, I found the the Y-axis is bouncing of the rear bellows before it reaches the negative limit switch, which then means it runs into the positive limit switch because the axis has lost position
That's one more problem located, just need to work on solving it now..
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: Soft Limit Overshooting
Haha. Thanks for taking the time to post back.
Good luck
Good luck
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.