Acceleration of U-Axis asynchronous to XYZ

More
25 Jun 2012 14:35 - 25 Jun 2012 14:40 #21303 by poolspieler
Hi @all,
I am trying to get my 3D-Printer running with LinuxCNC 2.5.0
I am using a wades extruder ( reprap.org/wiki/Wade's_Geared_Extruder ) on my CNC.

As a matter of principle it is running fine BUT:
The extruder is NOT generating the correct amount of PLA during acceleration/deceleration of the axis.
Please note the attached picture of the result:


The higher I set the Axis-speed, the higher I get bad printing results.
For the left print I reduced the XYZ-speed to 10mm/s --> this ist too slow for bigger prints (they would take more than 10 hours...) :dry:
For the right print I used 30mm/s and got this bad result...

Question:
Is there a way to get the U-Axis moving (accelerating) BEFORE the XYZ-Axis are moving for each G1-command?
Of course I would have to configure the time or something else for this asynchronous moves.

I already downloaded the source code on LinuxCNC - and tried to find the section for acceleration - but it does not look as simple as meant... :unsure:
Do you need further information?


Could someone help me? Thanks!

Best Regards,

poolspieler
Attachments:
Last edit: 25 Jun 2012 14:40 by poolspieler. Reason: added the image as "attached file"

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 14:41 #21304 by poolspieler
Here is the picture:


... its a little bit complicated to attach a picture to a post... :S
Attachments:

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 15:16 #21305 by andypugh
How is the extruder "axis" set up?

What is required is for the extruder to extrude at a rate proportional to axis speed to give a constant volume-per-mm
If U is being moved as a coordinated motion with the XY axes, then that ought to be what happens.
It might be worth tweaking the U-axis accelleration settings to see if you can make an improvement. Unfortunately I don't think you can do this live.

There are other possible approaches, you could pass X and Y velocities into the "hypot" HAL function to convert to a linear velocity, and then scale that and pass it as an extrusion rate to a velocity-mode stepgen connected to U.

Can you paste a snippet of the G-code?

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 15:24 - 25 Jun 2012 15:25 #21306 by PCW
Is "U" calculated from velocity?

Since it looks like the error is a phase lag in the extruder,
I would be tempted to delay the motion axis a fixed number
of servo cycles (fixed time) but leave the "U" calculation in
real time so the extruder rate is "ahead" of the mechanics

a hal comp with a circular buffer could generate a variable
(in servo thread increments) delay in the commanded positions
Last edit: 25 Jun 2012 15:25 by PCW. Reason: sp

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 15:27 - 25 Jun 2012 15:28 #21307 by PCW
Or as Andy is suggesting is the U value not set to the axis velocity?
Last edit: 25 Jun 2012 15:28 by PCW.

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 16:17 #21308 by poolspieler
Hi,
thank you for your answers!

How is the extruder "axis" set up?

A snippet of my .hal File:
net xdir => parport.0.pin-02-out
net xstep => parport.0.pin-03-out
setp parport.0.pin-03-out-reset 1

net ydir => parport.0.pin-04-out
net ystep => parport.0.pin-05-out
setp parport.0.pin-05-out-reset 1

net zdir => parport.0.pin-06-out
net zstep => parport.0.pin-07-out
setp parport.0.pin-07-out-reset 1

net udir => parport.0.pin-08-out
setp parport.0.pin-08-out-invert 0
net ustep => parport.0.pin-09-out
setp parport.0.pin-09-out-reset 1

net charge-pump => parport.0.pin-16-out

net estop-ext <= parport.0.pin-11-in
net all-home <= parport.0.pin-13-in

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
net all-home => axis.0.home-sw-in

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
net all-home => axis.1.home-sw-in

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 35000
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable
net all-home => axis.2.home-sw-in

setp stepgen.6.position-scale [AXIS_6]SCALE
setp stepgen.6.steplen 1
setp stepgen.6.stepspace 0
setp stepgen.6.dirhold 35000
setp stepgen.6.dirsetup 35000
setp stepgen.6.maxaccel [AXIS_6]STEPGEN_MAXACCEL
net upos-cmd axis.6.motor-pos-cmd => stepgen.6.position-cmd
net upos-fb stepgen.6.position-fb => axis.6.motor-pos-fb
net ustep <= stepgen.6.step
net udir <= stepgen.6.dir
net uenable axis.6.amp-enable-out => stepgen.6.enable
net all-home => axis.6.home-sw-in

A snippet of my ini-file:
[TRAJ]
AXES = 8
COORDINATES = X Y Z U
MAX_ANGULAR_VELOCITY = 360.00
DEFAULT_ANGULAR_VELOCITY = 36.00
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 4.00
MAX_LINEAR_VELOCITY = 40.00

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl


[AXIS_0]
TYPE = LINEAR
HOME = 418.0
MAX_VELOCITY = 38.0
MAX_ACCELERATION = 240.0
STEPGEN_MAXACCEL = 260.0
SCALE = 400.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = 0.0
MAX_LIMIT = 420.0
HOME_OFFSET = 420.000000
HOME_SEARCH_VEL = -20.000000
HOME_LATCH_VEL = 1.000000
HOME_SEQUENCE = 1

[AXIS_1]
TYPE = LINEAR
HOME = 478.0
MAX_VELOCITY = 38.0
MAX_ACCELERATION = 240.0
STEPGEN_MAXACCEL = 260.0
SCALE = 400.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = 0.0
MAX_LIMIT = 480.0
HOME_OFFSET = 480.000000
HOME_SEARCH_VEL = -20.000000
HOME_LATCH_VEL = 1.000000
HOME_SEQUENCE = 2

[AXIS_2]
TYPE = LINEAR
HOME = 128.0
MAX_VELOCITY = 38.0
MAX_ACCELERATION = 240.0
STEPGEN_MAXACCEL = 260.0
SCALE = 400.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = 5.0
MAX_LIMIT = 130.0
HOME_OFFSET = 130.000000
HOME_SEARCH_VEL = -20.000000
HOME_LATCH_VEL = 1.000000
HOME_SEQUENCE = 0

[AXIS_6]
TYPE = LINEAR
HOME = 0
MAX_VELOCITY = 40.0
MAX_ACCELERATION = 240.0
STEPGEN_MAXACCEL = 260.0
SCALE = 746.1
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -999999
MAX_LIMIT = 999999
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = 1.000000
HOME_LATCH_VEL = 1.000000
HOME_SEQUENCE = 0




Can you paste a snippet of the G-code?

G17
G90
G54
G92 U0
G0 U0
G21
G64 P0.1 Q0.1
G92 U0
G0 U0
G21
G1 X-5.803 Y0.915 Z0.5 F1200.0
G1 F1200.0
G1 U1.05
G1 F1200.0
G1 X-5.601 Y21.154 Z0.5 F450.0 U2.3486
G1 X-2.404 Y24.74 Z0.5 F450.0 U2.6569
G1 X0.915 Y25.803 Z0.5 F450.0 U2.8805
G1 X21.347 Y25.6 Z0.5 F450.0 U4.1915
G1 X25.62 Y21.327 Z0.5 F450.0 U4.5792
G1 X25.654 Y-1.186 Z0.5 F450.0 U6.0237
G1 X21.417 Y-5.599 Z0.5 F450.0 U6.4161
G1 X0.915 Y-5.803 Z0.5 F450.0 U7.7316
G1 X-2.234 Y-4.794 Z0.5 F450.0 U7.9438
G1 X-4.794 Y-2.234 Z0.5 F450.0 U8.1761
G1 X-5.803 Y0.915 Z0.5 F450.0 U8.3882

What is required is for the extruder to extrude at a rate proportional to axis speed to give a constant volume-per-mm

The extruder should give a constant volume-per-mm.
But at acceleration, the extruder takes some time to increase its internal preasure. I would say, this takes about 100-400 milliseconds.
This time depends on the acceleration of the extruder. At very low speeds I don't see this behavior.

It might be worth tweaking the U-axis accelleration settings to see if you can make an improvement. Unfortunately I don't think you can do this live.

I just looked around the code --> and I AGREE :laugh:

There are other possible approaches, you could pass X and Y velocities into the "hypot" HAL function to convert to a linear velocity, and then scale that and pass it as an extrusion rate to a velocity-mode stepgen connected to U.

How can I do this. Is there a documentation or a HOWTO somewhere?

Since it looks like the error is a phase lag in the extruder,
I would be tempted to delay the motion axis a fixed number
of servo cycles (fixed time) but leave the "U" calculation in
real time so the extruder rate is "ahead" of the mechanics

a hal comp with a circular buffer could generate a variable
(in servo thread increments) delay in the commanded positions

This sounds good. Could you give me an example - or a link to a documentation?


An "off-topic question":
Would it better to use the A-axis in stead of the U-axis?
--> If I use the U-axis, the 3D-graph is not correct. there is a displacement in the x-axis
I attached to screenshots...

File Attachment:

File Name: axis-2f041...d6a8.zip
File Size:48 KB




Thank you for your support!
Do you need further information?


Best Regards,

Andy
Attachments:

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 16:41 #21309 by andypugh
poolspieler wrote:

Would it better to use the A-axis in stead of the U-axis?
--> If I use the U-axis, the 3D-graph is not correct. there is a displacement in the x-axis
I attached to screenshots...


This is a moderately easy fix. See the "GEOMETRY" setting in the INI file.
www.linuxcnc.org/docs/html/config/ini_co...ub_display_section_a

Back the real problem.
The first thing to try is probably to make sure that the axis acellerations are as high as possible, so that your machine slows less for corners.
I was going to suggest G64, but you have already done that.

I can imagine a HAL component that would modify the extruder speed dependant on axis accelleration, but I am not clear if it would work or not.

It is probably worth graphing X, Y and U in Halscope to make sure that the U move is properly coordinating.

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 17:42 - 25 Jun 2012 17:45 #21312 by poolspieler
Hi Andy,
I added "GEOMETRY = XYZ" to my DISPLAY-Section - now everything is displayed right. Thank you!

The first thing to try is probably to make sure that the axis acellerations are as high as possible, so that your machine slows less for corners.
I was going to suggest G64, but you have already done that.

The G64 command is a very good improvement - but only for lower speeds.
Whithout the G64 the results really awful!

I can imagine a HAL component that would modify the extruder speed dependant on axis accelleration, but I am not clear if it would work or not.

It is probably worth graphing X, Y and U in Halscope to make sure that the U move is properly coordinating.


I attached two screenshots of the HAL oscilloscope --> a really nice tool. I didn't know this up to now :)

File Attachment:

File Name: HAL_Osci.zip
File Size:124 KB


In my opinion - it is doing everything right - doesn't it?
--> But this is the problem. Axis6 (the extruder) shold move before the other axis are moving...


Best Regards,
Andy
Attachments:
Last edit: 25 Jun 2012 17:45 by poolspieler.

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 18:38 #21314 by PCW
I think the plots would be easier to understand if velocities were plotted rather than position
and even simpler if the extruder rate were calculated with the hypot comp as Andy P suggested

This also allows you to drop "U" entirely from the HAL file and G code

As far as the extruder delay goes like I said I would delay the X and Y with a delay comp
This delay comp (one per axis) would have a float input pin (X command for example)
and a float output (delayed X command) pin and one u32 input pin to set the delay (so it can be
set to 0 for startup / homing or changed to match the extruder characteristics ) and perhaps a reset
pin (that sets the whole delay array to the current input value)

The delay comp would need an array of floats as large as the maximum delay in servo periods so there is a limit to how large this can be since this is allocated from kernel memory

The HAL manual has the information on making components:

www.linuxcnc.org/docs/HAL_User_Manual.pdf

Please Log in or Create an account to join the conversation.

More
25 Jun 2012 19:10 #21315 by poolspieler
Hi PCW,
thank you for your answer!

I am sorry, I overlooked the hint for plotting velocities instead of positions.
--> Could you say me, the exact pin for velocities in the HAL scope - I am not able to find them :unsure:

Sorry for this stupid question: HOW can I enable or use the hypot comp? :blink:

At linuxcnc.org/docs/html/hal/components.html I found, that hypot is a "Three-input hypotenuse (Euclidean distance) calculator."
--> But how to install and use it?

Best Regards,

Andy

Please Log in or Create an account to join the conversation.

Time to create page: 0.257 seconds
Powered by Kunena Forum