Hi All,
I'm running a PNP-style machine with MB6HC(SBC Pi5), 5x 1HCL. During continuous operation I noticed some drift in the A-axis. The drift was large enough that when commanding the (rotational) A axis to a 0 position (which looks square to the gantry after a homing cycle), it looks visibly off by about 10 or 15 degrees.
I was running some g-code which "unwraps" the A axis by calculating % 360 of the last position (I generate my code with python) and running a G92 A{remainder} to avoid a lengthy travel back to the normal range. I thought this might be causing the cumulative positional drift, and disabled it which seemed to fix the issue. But I was frustrated that what seemed like an obvious solution to the lengthy unwind wasn't working, so I ran some tests.
How I'm testing for deviation:
G91
G53 G1 H4 A-360 F3000
G53 G1 A2
G53 G1 H4 A-4 F100
G90
G4 S0.5 ; wait for motion to complete and allow OM to settle (nessecary? or maybe the issue?)
echo {"deviation from home position: "^move.axes[3].machinePosition + 142.5}
; 142.5 is the offset I specify in homea.g
The deviation tests involve running a homing-style motion but not setting any position, and then observing how far the current position is from the supposed home position by polling the OM. To me this seemed a viable method of recording the deviation, and I hope it does to everyone else as well. I've used similar tests in the past to verify the position of open loop systems during operation.
The two test files which simulate an identical set of motions that my machine currently makes during normal operation, one with the G92 unwrap and the other without:
My testing script:
echo "homing the A axis to reset"
G28 A
echo "initial tolerance score"
M98 P"/macros/test_a_issues/print_deviation.g"
;default
M203 A25000 M201 A2000
;slow 1
;M203 A10000 M201 A500
while iterations < 20
echo "iteration ", iterations + 1
;M98 P"/macros/test_a_issues/with_python_mod.g"
M98 P"/macros/test_a_issues/with_no_wrap.g"
M98 P"/macros/test_a_issues/print_deviation.g"
This allowed me to observe the deviation over time as the problematic macro(s) were repeatedly run, and the results were quite worrisome. Graphing my console output csv from multiple runs produced this:
I tried the same motion macros with several different configurations, open loop mode, closed loop mode, assisted, slow accel and feedrate etc. Uncommented lines in my testing script and homing files should show how I produced the varying tests, and attached are my testing_x.g and print_deviation_x.g files that I used as a "control".
A axis runs the following hardware:
X axis uses a 1HCL, Nema23 motor and a 40T GT2 Pulley with 9mm Gates belt on a high quality linear rail.
The accumulation I observed with the G92
wrapping was apparent, but shockingly, its omission showed a serious drift moving in the opposite direction. This led me to think that this was a hardware issue, so I added tests with my simple belt driven (direct drive) X axis as a control. This showed a continual deviation increase of 0.5-1mm across the standard 20 iterations with the same file, despite the mode of operation.
So I have the following set of questions to ask on the forum:
- Is this a viable way to determine the deviation, and if not why? Do I need to give the object model more time to sync up before I make the comparison? If that is the case why are upward/downward trends visible?
- Is the issue related to the high speed at which I am running the A axis motor shaft, and why did a reduction of speed and acceleration not solve the cumulative error issue?
- Due to the 10x gear reduction of my A axis, could I be running into floating point errors for the shaft position/micro-step calculation? Maybe some tests with low micro stepping could answer this.
- On the X axis control, what other than a slipping belt pulley could cause the visible increase in X error.
Attached is my m122.txt M122 report after a single run of the with_python_mod.g
macro. No blazing issues stand out to me from the report.
I'm happy to run additional tests and provide more information to diagnose the issue.
Cheers and hoping to figure this out,
T