caxis.comp - problems
It sure looks like an oversight. I will have a crack at adding something.This appears not to be in the LCNC manual config/ini section?
I am not sure if that would cause issues for non trivial kinematics, although it wouldn't be too difficult to do that only for trivkins configs.I wonder if there's a reason LCNC shouldn't default to the [JOINT] TYPE = N if the [AXIS] TYPE is not specified.
Yes it is, I am not sure how other GUI's behave.Now that I searched the code on GH, I see that this is an AXIS GUI thing and not LCNC.
Please Log in or Create an account to join the conversation.
I didn't do an exhaustive search on GH, but axis.py was the only file I found with similar max_vel settings based on [AXIS] TYPE.
PNCconf & Stepconf don't include an [AXIS] TYPE line in generated INI files.
Please Log in or Create an account to join the conversation.
Spindle commands work fine.
PID tuning is, as usual, driving me nuts.
Right now I've got the values as such:
P = 0.23
I = 0
D = 0.01
FF0 = 0
FF1 = 0.00125
FF2 = 0.00002
FF3 = 0
maxoutput = 0
deadband = 0.1
stepgen max_vel = 100
stepgen max_accel = 2000
[AXIS] / [JOINT] max_vel = 3600
[AXIS] / [JOINT] max_accel = 3600
[DISPLAY] max_angular_vel = 3600
[TRAJ] max_angular_vel = 7200
If the deadband is set lower, it behaves oddly. A B90 or B179 command works fine and settles quickly. But a B180 or greater result in the axis reaching position and then after a brief pause it keeps going all the way around and pausing again at B180. No faulting, but it'll keep repeating that until I stop it. Strange.
The FF1 value is suggesting (to me) that something is still wrong with various scaling or values.
Haven't really be able to get the f-error better than below without it going unstable.
Attachments:
Please Log in or Create an account to join the conversation.
Any I-term results in unstable, wild moves. Increasing P or D results in huge f-error increase.
With deadband = 0.1, it'll stay put at B180. But B270 results in the pause-and-keep-going routine.
If I set deadband to 0.09, it'll sit there for a minute or two and do a single flip. Then do it again a minute later.
A back and forth program B0-B180 seems to work fine with the above PID values, but B0-B270 causes this:
Attachments:
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
- Posts: 677
- Thank you received: 117
Please Log in or Create an account to join the conversation.
Encoder is 2500ppr, so 10k post-quad. That's 27.11 counts per degree.
If pid deadband is degrees (not sure about that), then 0.1 degree should be ~2 counts.
I'll bump it up to 0.2, but that still doesn't explain why it doesn't try to servo back or just dither a bit instead of freaking out and whipping around another rev.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19209
- Thank you received: 6438
Deadband has something to do with counts, forgot what exactly that was.
Please Log in or Create an account to join the conversation.
This component has a built in auto tune mode. It works by setting up a limit cycle to characterize the process. This is called the Relay method and described in the 1984 Automation paper Automatic Tuning of Simple Regulators with Specifications on Phase and Amplitude Margins by Karl Johan Ãström and Tore Hägglund (doi:10.1016/0005-1098(84)90014-1), lup.lub.lu.se/search/ws/files/6340936/8509157.pdf. Using this method, Pgain/Igain/Dgain or Pgain/Igain/FF1 can be determined using the Ziegler-Nichols algorithm. When using FF1 tuning, scaling must be set so that output is in user units per second.During auto tuning, the command input should not change. The limit cycle is setup around the commanded position. No initial tuning values are required to start auto tuning. Only tune-cycles, tune-effort and tune-mode need be set before starting auto tuning. Note that setting tune-mode to true disable the control loop. When auto tuning completes, the tuning parameters will be set, the output set to bias and the controller still be disabled. If running from LinuxCNC, the FERROR setting for the axis being tuned may need to be loosened up, as it must be larger than the limit cycle amplitude in order to avoid a following error.To perform auto tuning, take the following steps. Move the axis to be tuned somewhere near the center of it’s travel. Set tune-cycles (the default value should be fine in most cases) and tune-mode. Set tune-effort to a small value. Set enable to true. Set tune-mode to true. Set tune-start to true. If no oscillation occurs, or the oscillation is too small, slowly increase tune-effort. Set tune-start to true. If no oscillation occurs, or the oscillation is too small, slowly increase tune-effort Auto tuning can be aborted at any time by setting enable or tune-mode to false.
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
- Posts: 677
- Thank you received: 117
Please Log in or Create an account to join the conversation.
Re-reading the PID manual, deadband should be set slightly greater than 1/2 count to stop hunting. Your example is (I suspect) referencing a linear axis where you've got a very high count-per-unit (like thousands of counts per mm or inch). Just like my X/Z axes with 1um encoders where I've got ~25400 counts/inch.
My subspindle is a direct-drive rotary axis where units = degrees. So I've got ~27 counts per degree; significantly coarser feedback per unit.
The encoder signal is output from the drive, and I've got it set as high a resolution as possible.
@Aciera,
I tried the PID autotune a couple times on my Z-axis a while ago and the results were just dumb. While I may give it a try, I haven't read a single report on the forum where someone was pleased with the results.
@smc.collins,
I have the pos-cmd and pos-fb up in halshow, but haven't yet scoped them. Nothing odd or way off during a programmed back-and-forth move. It homes to index fine and the counts/position/velocity all look like they should even when it flips out. Doesn't lose track of where it is.
I'm going to try connecting it like an open-loop stepper tonight - connect stepgen pos-fb to pid.b.feedback and joint motor-pos-fb. That should help me see if my issue is with the PID or not.
Please Log in or Create an account to join the conversation.