Closed MarkJB closed 1 year ago
Doesn't seem to be related to acceleration settings or work offsets...
Seems the serial port is a red herring.
I wrote the gcode to a file (attached), uploaded it and ran it from the webui and am seeing the same issue. mind-glyphs.txt
Note: If the z moves look different between this file and the original console output, its because I added /axes/z/homing/mpos_mm 5
and now I have Z5 = pen up and Z0 = pen down.
I can replicate the problem. It looks like a feed rate compensation problem.
It was the feed rate compensation. There is a new branch you can compile and test. We would love some feedback on the fix.
So far so good.
I have a few longer running plots to try and I'll report back.
Not seen the servo move slowly in a couple of hours, but the next move is happening before the servo finishes its travel. Is there a setting to control the settle time? (Was looking for something like /axes/z/homing/settle_ms
but for moves rather than homing).
Something odd happened while I was attempting to speed up the servo. After cranking up the z_axis feedrate and acceleration, I was manually sending G0 Z0
& G0 Z5
to test and the machine went off in a random direction and nan
shows in the console.
I'm not able to reproduce it yet, but if I can, I'll open another issue.
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
G0 Z5
ok
G0 Z0
ok
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
G0 Z5
ok
<Idle|MPos:-93.937,-544.058,5.000|FS:0,0>
G0 Z0
ok
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
G0 Z5
ok
<Idle|MPos:-93.937,-544.058,5.000|FS:0,0|WCO:0.000,-0.000,0.001>
G0 Z5
ok
<Run|MPos:19.352,-449.975,5.000|FS:5175,0|Ov:100,100,100>
<Run|MPos:155.031,-237.756,5.000|FS:5175,0>
G0 Z0
ok
<Run|MPos:201.193,43.803,5.000|FS:5175,0>
<Run|MPos:158.648,nan,5.000|FS:5175,0>
<Run|MPos:167.553,nan,4.380|FS:5175,0>
<Run|MPos:200.435,-1.909,3.110|FS:5175,0>
<Run|MPos:144.513,-263.240,1.840|FS:5175,0>
<Run|MPos:-0.411,-469.699,0.570|FS:5175,0>
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0|WCO:0.000,-0.000,0.001>
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0|Ov:100,100,100>
G0 Z0
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
ok
<Run|MPos:65.364,-396.611,0.000|FS:5175,0>
<Run|MPos:176.207,-173.108,0.000|FS:5175,0>
<Run|MPos:198.476,nan,0.000|FS:5175,0>
<Run|MPos:131.678,nan,0.000|FS:5155,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0|WCO:0.000,-0.000,0.001>
<Idle|MPos:119.671,nan,0.000|FS:0,0|Ov:100,100,100>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0|WCO:0.000,-0.000,0.001>
<Idle|MPos:119.671,nan,0.000|FS:0,0|Ov:100,100,100>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
Off the back of tweaking the feeds and speeds for the z-axis, I've noticed the servo is slower going from Z5 -> Z0, than it is the other way.
This was after setting the acceleration to 1000mm/s/s.
The nan
means something is wrong. The wallbot kinematics was contributed by someone not on the development team. We are trying to patch it up without a machine to test with. It could be moving into a bad area. The 119 is close to the Y position of the anchor. We can add code to warn you if you are getting out of the valid area of motion.
kinematics:
WallPlotter:
left_axis: 0
left_anchor_x: -326.500
left_anchor_y: 120.000
right_axis: 1
right_anchor_x: 326.000
right_anchor_y: 120.000
segment_length: 10.000
I noticed your servo range is this.
[MSG:INFO: Axis Z (-5.000,0.000)]
Do you have a G54 offset?
Yes, I am using this offset G10 L2 P2 X-140 Y-550 Z5
The servo range should be 0.000,5.000.
The -5.000,0.000 might have been from before I added mpos_mm: 5
to the config.
I noticed you don't have limit switches.
Can you sent a link to the hardware you are using, exactly how you start a job and why you set that offset?
The range is in machine space. If you want 0 to 5mm, you need to set the homing mpos_mm to 5, because you home positive on Z
The controller board is one of my own design, but pin compatible with one of yours.
The rest of the machine is a self build.
The offset is to make working with the machines coordinate system easier. The semi-circle at the top is 'home' and the processing sketch starts at the 0,0 bottom left of the page, hence the offset.
Sorry - forgot to say I start a job by homing (if the gondola isn't at the home position when the machine thinks it is the plot will be skewed) then applying the offset, either manually or as part of the gcode (the processing sketch will send the offset and activate it), then it starts streaming the gcode.
But for the recent tests, I've been starting the gcode files from the webui with the play button.
(edited) I am not sure, but I assume you manually move the gondola to the center of X and 120 below the "anchors" and then start the controller.
(edited) I am not sure, but I assume you manually move the gondola to the center of X and 120 below the "anchors" and then start the controller.
Yes, that's correct.
I pushed a change to that branch that probably fixes the problem. The trigger for the problem was a move that went nowhere, in this case G0 Z5 right after G0 Z5.
So far so good. Been plotting on and off for 24hrs and not seen nan
or crazy moves.
When this plot is finished I'll try and force some crazy moves and see what happens.
R.e. the issue with the next move starting before the servo reaches its expected position, is this expected? Is there a setting to delay until the servo has likely finished moving? Or should I raise a separate issue for it?
The servo is not closed loop (with FluidNC) . It is just doing its best to track the position. If you set the speed and acceleration higher than the servo can go, the next move will start before the servo completes it motion.
Try lowering the max_rate_mm_per_min
for the Z axis.
Most servos can do a full move in a little less than a second. For a 5mm Z move, I would try a rate in the 200-400 range. You can tune that value live by sending...
$axes/z/max_rate_mm_per_min=300
Once you like the performance you need to save your config file with that value so it reads it a start up.
Controller Board
ESP32_Plotter_Controller (Emerald Dingo RevB)
Machine Description
Wallbot
Input Circuits
No response
Configuration file
Startup Messages
User Interface Software
Processing sketch
What happened?
I'm attempting to live plot visualizations of the data from a MindFlex headset over the serial port.
The problem I am seeing is that the servo (pen down) randomly becomes painfully slow (taking ~15 seconds to drop the pen). You can see its pretty random from the blotches in the photo and a video if you want to see it happening.
I appreciate this may not be a fluidnc problem, but the gcode send script, while basic, is something I've used on and off over the years and not seen this problem with grbl or grblesp.
For some more context:
The processing sketch gets the data from the headset, converts that to a set of coordinates the represent a shape and plots the shape on screen and also sends the coordinates as gcode over the serial port, one line at a time (it waits to receive the 'ok' string so I guess its filling the buffer and blocking until it can send a new gcode command). Originally, I was checking the serial port every 50ms for new characters, but slowed it to 1sec, thinking that maybe I was sending data too fast, but I'm still seeing the problem.
My intial thought was filling the buffer might be causing it, but I just ran it again and on the first move, the servo was slow. At that point I had only sent 3 gcode commands. You can see the servo moving slowly (as part of debugging I added a status command output).
The first move, is
G0 X9.000 Y13.000 Z-5 F1500.000
followed by the first drawG1 X9.000 Y13.000 Z5 F1500.000
which is where the servo starts to move really slowly. While debugging I've slowed down the poll for the 'ok' received from fluidnc to 1000ms and each subsequent gcode command sent will also get the status. From the status outputs you can see the servo moving really slowly (and x and y not changing as expected). I guess its taking around ~12seconds when normally it takes less than a second. But there is also a few seconds after the servo stops moving before it starts the next move.