-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix synched spindle moves exceeding linear axis limits #479
base: 2.7
Are you sure you want to change the base?
Fix synched spindle moves exceeding linear axis limits #479
Commits on Mar 2, 2017
-
tp: Improve position-mode spindle sync performance with new error cal…
…culation. The 2.x target velocity calculation in position-sync mode causes jitter around the target position. This commit replaces the error calculation with a simpler version that better tracks spindle velocity. Other changes: * Rename and refactor to be clearer about scope and purpose * Create a separate header for missing math functions from C math (signum and integer min / max). * Rename the signed spindle position helper function to something more meaningful Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e40d93c - Browse repository at this point
Copy the full SHA e40d93cView commit details -
tp: new formula for spindle position tracking
The original "error velocity" formula was correct if the initial and final velocity was zero. However, during spindle position tracking, the target velocity is non-zero (or it wouldn't be tracking!). This lead to a slight over-correction, and steady-state jitter even with a perfect encoder signal. The new formula accounts for the ideal target velocity, and should therefore over-correct less. This fixes the jitter (in simulation with a perfect encoder, at least). Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 54773de - Browse repository at this point
Copy the full SHA 54773deView commit details -
sim: Add a simple component for quantizing a signal (useful for simul…
…ating encoders) Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b05f413 - Browse repository at this point
Copy the full SHA b05f413View commit details -
sim: First cut of spindle encoder simulation with quantized output
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 52f432e - Browse repository at this point
Copy the full SHA 52f432eView commit details -
canon: Add a missing forward declaration
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8051a18 - Browse repository at this point
Copy the full SHA 8051a18View commit details -
canon: Minor whitespace cleanup
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8f12589 - Browse repository at this point
Copy the full SHA 8f12589View commit details -
canon: Replace unit conversion macro with a function
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8c80a85 - Browse repository at this point
Copy the full SHA 8c80a85View commit details -
canon: Enable smarter blending in spindle-synchronized motion.
Since Canon knows the spindle speed for a given segment, it's trival to calculate the nominal feed for a synchronized motion segment (assuming ideal spindle behavior). This nominal velocity is passed to motion so that blend arcs can be sized correctly. Also, report a canon error if the planner can't meet the required feed for spindle synchronization. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7f74424 - Browse repository at this point
Copy the full SHA 7f74424View commit details -
tp: disallow blending when entering position-synch mode
Fixes issue machinekit#68 by preventing any blending between position-synced motions (G33) and other motion modes (velocity-sync and normal), according to this table. Mode Transitions | blending allowed --------------------+----------------- normal -> position | no position -> normal | yes all others | yes These now cases match 2.6.x behavior, though the blending itself can be done with tangent / arc blends. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2b15d34 - Browse repository at this point
Copy the full SHA 2b15d34View commit details -
tp: Limit max feed scale in position-sync blends.
We know that feed override can't exceed 1.0 during position-sync moves, so it's a waste to plan blend arcs that allow for higher feed overrides. This makes blend arcs a bit smaller in position-synced moves. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 72304b8 - Browse repository at this point
Copy the full SHA 72304b8View commit details -
canon: Automatically limit spindle speed in spindle-sync motion.
Previously, the user could command an arbitrarily large spindle speed with G33 / G95 motion, even if the machine axes couldn't keep up. The user has no way of knowing that this is happening (except in extreme cases). This fix does two things: 1) Pop a warning message to the user telling them the maximum spindle speed possible for the current motion. 2) Attempt to limit the spindle speed by issuing a new speed command in the background before the synced motion starts. Note that (2) will have no effect if the machine does not have active spindle speed control. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6092454 - Browse repository at this point
Copy the full SHA 6092454View commit details -
tp: Fix debug level for some debug print statements
Reduce spam in TP debug logs. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9ee8d38 - Browse repository at this point
Copy the full SHA 9ee8d38View commit details -
tp: Re-order checks for parabolic blends
Parabolic blends require reduced max acceleration, so that the worst-case blend does not exceed the limits. If a parabolic blend can be "upgraded" to a tangent / arc blend, then we don't need this restriction. Previously, this check occured too early in the process of creating a new segment, which meant some segments ended up with reduced acceleration unnecessarily. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bf45059 - Browse repository at this point
Copy the full SHA bf45059View commit details -
tp: Add debug information for spindle sync
Mostly for troubleshooting, doesn't affect end-user performance Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 75d2ca1 - Browse repository at this point
Copy the full SHA 75d2ca1View commit details -
sim: Improve simulation of inertia in spindle sim
Instead of just low-pass filtering the measured speed, filter the spindle speed command sent to the simulated spindle. Now, both the position and velocity signals will simulate a spindle with inertia. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 30f3831 - Browse repository at this point
Copy the full SHA 30f3831View commit details -
tp: Use motion's spindle-speed-in input for spindle velocity
The spindle-speed-in pin will in many cases be a better estimate of velocity than the internal estimate we currently use in the TP. Encoder counters can have much finer time resolution than the servo thread, leading to smoother velocity estimates. One benefit is that the "sync_accel" phase actually works now. With a low-count encoder, the estimated velocity could sometimes be zero if there were no counts within one servo timestep (sam's test case shows this). Then, sync_accel ends early, and the position tracker is left with a large error to correct. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 80b0ad7 - Browse repository at this point
Copy the full SHA 80b0ad7View commit details -
motion: Add spindle velocity estimator
Like the PID component, motion can now estimate spindle velocity if the spindle-speed-in pin is left unconnected. motion computes a simple 2-point backward difference, which is usable at high speeds and with high PPR encoders. Thanks to Peter Wallace for this suggestion (and Jeff Epler for the original idea in pid.c). Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e3ce246 - Browse repository at this point
Copy the full SHA e3ce246View commit details -
motion: Refactor spindle status for clarity and organization.
Now, all spindle command settings are collected into one status struct. Similarly, spindle feedback statuses (position, velocity, etc.) are collected into a single struct. Note that this change is internal to motion. HAL pin names and externally-facing status fields should be unaffected. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d83c600 - Browse repository at this point
Copy the full SHA d83c600View commit details -
tp: Remove discontinuous spindle positions in rigid tapping internals.
Rigid tapping used to estimate spindle position both from the measured spindle revs, and the commanded direction. This approach is numerically dangerous, however, because the spindle position itself could be large. Therefore, flipping the sign on the position would cause an apparent jump. The previous approach to rigid tapping accounted for this. However, this new approach should be cleaner and simpler. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2da063e - Browse repository at this point
Copy the full SHA 2da063eView commit details -
tp: Fix spindle position tracking to work with motion's new spindle d…
…ata. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 87e480a - Browse repository at this point
Copy the full SHA 87e480aView commit details -
canon: actually return angular feed rate when asked
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 52fad91 - Browse repository at this point
Copy the full SHA 52fad91View commit details -
test: Test case for steady state error
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 70ad411 - Browse repository at this point
Copy the full SHA 70ad411View commit details -
test: Match sam's lathe config settings (axis vel / acc).
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c010312 - Browse repository at this point
Copy the full SHA c010312View commit details -
Re-arrange a calculation to remove a division
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b606adc - Browse repository at this point
Copy the full SHA b606adcView commit details -
motion: Add a HAL pin to motion to let users control how aggressive p…
…osition tracking should be. Currently, we correct position errors in spindle-sync as aggressively as possible, given machine acceleration limits. This new HAL pin lets the user control how aggressive it should be. The valid range is [0.0,1.0], where 0.0 means no position tracking (pure velocity). 1.0 is equivalent to 2.x position tracking. In some cases, reducing the gain will greatly shrink the acceleration jitter, without appreciably affecting position tracking performance. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f8b0f09 - Browse repository at this point
Copy the full SHA f8b0f09View commit details -
sim: model velocity quantization in encoder near 360RPM
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1100e0b - Browse repository at this point
Copy the full SHA 1100e0bView commit details -
tp: Allow switching between position-sync algorithms based on a HAL pin.
This commit adds a new spindle tracking algorithm based on the trapezoidal motion profile. Particularly for high resolution encoders, this algorithm should have significantly reduced acceleration jitter. This also adds a (probably temporary) pin to HAL: motion.pos-tracking-mode: 0 (default) = new spindle tracking algorithm based on trapezoidal velocity calcs 1 = 2.7.x stock algorithm 2 = 2.7.x algorithm with a correction (here for completeness, but doesn't offer much over the trapezoidal method) Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b549472 - Browse repository at this point
Copy the full SHA b549472View commit details -
canon: Simplify spindle speed limits for synced motion
Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a637aa9 - Browse repository at this point
Copy the full SHA a637aa9View commit details -
canon: don't restore spindle speed after limiting it for spindle-sync…
…hed motion. Feed / speed synch is always disabled after a synced segment (even if it's then re-enabled for the next one). Unfortunately, this means that limiting spindle RPM, and then restoring it, has the effect of inserting two spindle speed commands between each segment of synched motion. This completely disrupts blending, and affects the acceleration used during the motion (potentially affecting threading performance). A safer and easier approach is to pop up a nuisance message to the user informing them that the spindle speed will be limited, and then just leave it at the limited speed. Generally, the user will set a new spindle speed for the next operation anyway. Signed-off-by: Robert W. Ellenberg <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3d02b64 - Browse repository at this point
Copy the full SHA 3d02b64View commit details -
Unit test for maxvel violations in spindle-synched moves
In a spindle-synched G33 move, it is possible to specify a feed per revolution and spindle speed that requires linear motion exceeding axis velocity limits. This test sets up this kind of condition and measures actual pitch during the motion, failing if pitch is not within an epsilon value. See LCNC machinekit#167 for more discussion. LinuxCNC#167 Signed-off-by: John Morris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7424e86 - Browse repository at this point
Copy the full SHA 7424e86View commit details -
Before run, warn if spindle-synched move violates axis limits
During a spindle-synched move, too high a spindle speed may require an axis to move faster than it is able. This patch looks for that situation using programmed spindle speed and INI per-axis max velocity settings. See LinuxCNC issue machinekit#167 for more information. Signed-off-by: John Morris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 24810a7 - Browse repository at this point
Copy the full SHA 24810a7View commit details -
Fix feed rate handling problem
The test in LinuxCNC#180 fails because that issue is also dealing with feed per rev. This patch adapts Seb Kuzminsky's fix to Rob Ellenberg's "Enable smarter blending in spindle-synchronized motion" patch.
Configuration menu - View commit details
-
Copy full SHA for 8b7c5b8 - Browse repository at this point
Copy the full SHA 8b7c5b8View commit details