Problem matching velocitys

More
12 Jul 2018 12:41 #114052 by casetero
Hello all,

I have a problem with the velocities of my machine. If i go under 300 mm/min there is no problem and everything works OK. But if i try to work at 600 mm/min the real velocities of the axis doesnt match the requested velocity. I realize because the GUI shows the end of the movement while the real axis continues moving to reach the requested position ( but at a lower speed). The result are errors in the machining because of non correct syncronization of the axis movements.

Any help would be great! Sorry for my english!

Thank you.

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

More
12 Jul 2018 13:55 #114058 by tommylight
What do you have set for min_f_error and f_error in the ini file?
Those should be left as is.
The following user(s) said Thank You: casetero

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

More
12 Jul 2018 15:01 - 12 Jul 2018 15:01 #114066 by PCW
Replied by PCW on topic Problem matching velocitys
Yes, as tommylight said, you likely have very large following error setting or this error between commanded and actual position would generate an immediate fault. (as it should since it indicates a configuration error)
Last edit: 12 Jul 2018 15:01 by PCW.
The following user(s) said Thank You: casetero, tommylight

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

More
13 Jul 2018 10:22 #114123 by casetero
Replied by casetero on topic Problem matching velocitys
Hello,

Ok, its solved now. My problem was the MAX_VELOCITY of each axis, it did let work just at 300 mm/min speed. The thing is a little bit weird because the value was set at 10, that would be 600 mm/min i guess. But no, for a value of 10 it limits at 300 mm/min. I had terrible high the FERROR and MIN_ERROR and it could work.

What its more weird its in the TRAJ section i have set MAX_VELOCITY and MAX_LINEAR_VELOCITY at 10 value, and it shows 600 mm/min as max speed with jog.

The problem is solved. Thank you!

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

More
13 Jul 2018 19:44 #114142 by PCW
Replied by PCW on topic Problem matching velocitys
Can you post your hal and ini files? I suspect there is some additional issue since the TRAJ max velocity does work normally in my experience

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

More
17 Jul 2018 12:02 #114366 by andypugh
Replied by andypugh on topic Problem matching velocitys
This sounds to me like the stepgen.max_velocity is low and is limiting the step rate.

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

More
18 Jul 2018 12:24 #114464 by casetero
Replied by casetero on topic Problem matching velocitys
Sorry for the delay.

Here is my Ini File:

# Generated by stepconf at Fri Apr 26 12:30:46 2013
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
MACHINE = MESA
DEBUG = 0

[DISPLAY]
DISPLAY = gmoccapy
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.5
MAX_SPINDLE_OVERRIDE = 1.5
DEFAULT_SPINDLE_SPEED = 1000
MIN_SPINDLE_OVERRIDE = 0.2
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/cnc/Escritorio/Mecanizados
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
DEFAULT_LINEAR_VELOCITY = 5
MAX_LINEAR_VELOCITY = 10
MIN_VELOCITY = 0.8
MAX_LINEAR_VELOCITY = 10
MIN_LINEAR_VELOCITY = 0.3

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = linuxcnc.var

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
#BASE_PERIOD = 100000
SERVO_PERIOD = 1000000

[HAL]
HALFILE = MESA.hal
HALFILE = xhc-hb04.hal
POSTGUI_HALFILE = custom_postgui.hal
HALUI = halui

[HALUI]
MDI_COMMAND = G1 X0 F100
MDI_COMMAND = G1 Y0 F100
MDI_COMMAND = G1 Z0 F100
MDI_COMMAND = G1 X0 Y0 F100
MDI_COMMAND=G10 L20 P1 X0
MDI_COMMAND=G10 L20 P1 Y0
MDI_COMMAND=G10 L20 P1 Z0
MDI_COMMAND=G0 X0 Y0 Z0

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 5
MAX_LINEAR_VELOCITY = 10
MAX_VELOCITY = 10
MAX_ACCELERATION = 10000

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

[AXIS_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 20
MAX_ACCELERATION = 10000
# BACKLASH = 0.03
STEPGEN_MAXACCEL = 12500
#SCALE = 1400
FERROR = 1
MIN_FERROR = 0.3
MIN_LIMIT = -1000
MAX_LIMIT = 1000.0
HOME_OFFSET = 0.0
PGAIN = 20
IGAIN = 0
DGAIN = 0
BIAS = 0
FF0 = 0
FF1= 1.969
FF2 = 0
DEADBAND = 0.005
MAXOUTPUT = 80

[AXIS_1]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 20
MAX_ACCELERATION = 10000
STEPGEN_MAXACCEL = 12500
# BACKLASH = 0.03
#SCALE = 1400
FERROR = 1
MIN_FERROR = 0.3
MIN_LIMIT = -1000
MAX_LIMIT = 1000.0
HOME_OFFSET = 0.0
PGAIN = 20
IGAIN = 0
DGAIN = 0
BIAS = 0
FF0 = 0
FF1= 1.97
FF2 = 0
DEADBAND = 0.005
MAXOUTPUT = 80

[AXIS_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 20
MAX_ACCELERATION = 500
STEPGEN_MAXACCEL = 12500
#SCALE = 2756
FERROR = 1
MIN_FERROR = 0.3
MIN_LIMIT = -100
MAX_LIMIT = 1000.0
HOME_OFFSET = 0.0
PGAIN = 10
IGAIN = 0
DGAIN = 0
BIAS = 0
FF0 = 0
FF1= 1.97
FF2 = 0
DEADBAND = 0.005
MAXOUTPUT = 80


And here it is my HAL file:

# Mesa driver hecho por Pablo Grupo Volund S.A.


loadrt trivkins



loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

# base_period_nsec=[EMCMOT]BASE_PERIOD (esto va en la linea de arriba para activar el base-thread)

# loadrt threads name1=pablo period1=40000000

loadrt scale count=2

loadrt hostmot2

loadrt hm2_pci config="num_encoders=4 num_stepgens=3 num_pwmgens=1 sserial_port_0=000xxx"

loadrt pid num_chan=3

loadrt lincurve count=5 personality=6,4,6,4,12




#loadrt pwmgen output_type=0

setp hm2_5i25.0.watchdog.timeout_ns 10000000

# ################################################
# THREADS
# ################################################

addf hm2_5i25.0.read servo-thread

addf motion-command-handler servo-thread
addf motion-controller servo-thread


addf pid.0.do-pid-calcs servo-thread
addf pid.1.do-pid-calcs servo-thread
addf pid.2.do-pid-calcs servo-thread

addf hm2_5i25.0.write servo-thread


addf lincurve.0 servo-thread
addf lincurve.1 servo-thread

addf lincurve.2 servo-thread
addf lincurve.3 servo-thread

addf lincurve.4 servo-thread

addf scale.0 servo-thread
addf scale.1 servo-thread



# addf pwmgen.update servo-thread
# addf pwmgen.make-pulses base-thread



# Salidas GPIO y PWM para SPIN1x

setp hm2_5i25.0.gpio.001.is_output 1

setp hm2_5i25.0.gpio.002.invert_output 1

net spindle-enable motion.spindle-on => hm2_5i25.0.gpio.001.out hm2_5i25.0.pwmgen.00.enable

#net spindle-speed-cmd motion.spindle-speed-out => hm2_5i25.0.pwmgen.00.value

setp scale.0.offset 3700
setp scale.0.gain 1

net spindle-speed.cmd1 motion.spindle-speed-out => lincurve.4.in

setp lincurve.4.x-val-00 1
setp lincurve.4.x-val-01 1000
setp lincurve.4.x-val-02 2000
setp lincurve.4.x-val-03 3000
setp lincurve.4.x-val-04 4000
setp lincurve.4.x-val-05 6000
setp lincurve.4.x-val-06 8000
setp lincurve.4.x-val-07 10000
setp lincurve.4.x-val-08 12000
setp lincurve.4.x-val-09 14000
setp lincurve.4.x-val-10 16000
setp lincurve.4.x-val-11 18000



setp lincurve.4.y-val-00 1
setp lincurve.4.y-val-01 890
setp lincurve.4.y-val-02 1680
setp lincurve.4.y-val-03 2410
setp lincurve.4.y-val-04 3290
setp lincurve.4.y-val-05 5015
setp lincurve.4.y-val-06 6715
setp lincurve.4.y-val-07 8430
setp lincurve.4.y-val-08 10120
setp lincurve.4.y-val-09 11800
setp lincurve.4.y-val-10 11800
setp lincurve.4.y-val-11 11800





net spindle-speed.cmd2 lincurve.4.out => scale.0.in


net spindle-speed.cmd3 scale.0.out => hm2_5i25.0.pwmgen.00.value


setp hm2_5i25.0.pwmgen.00.scale 20000

setp hm2_5i25.0.pwmgen.00.output-type 1

setp hm2_5i25.0.pwmgen.pwm_frequency 5000







# Eje X

# timing parameters

setp hm2_5i25.0.stepgen.00.dirsetup 1000
setp hm2_5i25.0.stepgen.00.dirhold 1000

setp hm2_5i25.0.stepgen.00.steplen 1000
setp hm2_5i25.0.stepgen.00.stepspace 1000

setp hm2_5i25.0.stepgen.00.position-scale 1400

setp hm2_5i25.0.stepgen.00.maxvel [AXIS_0]MAX_VELOCITY
setp hm2_5i25.0.stepgen.00.maxaccel [AXIS_0]MAX_ACCELERATION

setp hm2_5i25.0.stepgen.00.step_type 0

setp hm2_5i25.0.stepgen.00.control-type 1

net xenable axis.0.amp-enable-out => hm2_5i25.0.stepgen.00.enable => pid.0.enable

# Parafernaria made in volund

net xpos-fb axis.0.motor-pos-fb <= hm2_5i25.0.encoder.00.position => pid.0.feedback
net xpos-cmd axis.0.motor-pos-cmd => pid.0.command
net xpos-out pid.0.output => hm2_5i25.0.stepgen.00.velocity-cmd lincurve.0.in lincurve.1.in

# Parametros del PID

setp pid.0.Pgain [AXIS_0]PGAIN
setp pid.0.Igain [AXIS_0]IGAIN
setp pid.0.Dgain [AXIS_0]DGAIN
setp pid.0.bias [AXIS_0]BIAS
setp pid.0.FF0 [AXIS_0]FF0
setp pid.0.FF1 [AXIS_0]FF1
setp pid.0.FF2 [AXIS_0]FF2
setp pid.0.deadband [AXIS_0]DEADBAND
setp pid.0.maxoutput [AXIS_0]MAXOUTPUT



setp hm2_5i25.0.encoder.00.scale 200




# net x-vel axis.0.joint-vel-cmd => lincurve.0.in lincurve.1.in

# net x-vel pid.0.output => lincurve.0.in lincurve.1.in

#net x-Pgain lincurve.0.out-io => pid.0.Pgain

#net x-Dgain lincurve.1.out-io => pid.0.Dgain

# Eje y

# timing parameters

setp hm2_5i25.0.stepgen.01.dirsetup 1000
setp hm2_5i25.0.stepgen.01.dirhold 1000

setp hm2_5i25.0.stepgen.01.steplen 1000
setp hm2_5i25.0.stepgen.01.stepspace 1000

setp hm2_5i25.0.stepgen.01.position-scale 1400

setp hm2_5i25.0.stepgen.01.maxvel [AXIS_1]MAX_VELOCITY
setp hm2_5i25.0.stepgen.01.maxaccel [AXIS_1]MAX_ACCELERATION

setp hm2_5i25.0.stepgen.01.step_type 0

setp hm2_5i25.0.stepgen.01.control-type 1

net yenable axis.1.amp-enable-out => hm2_5i25.0.stepgen.01.enable => pid.1.enable

# Parafernaria made in volund

net ypos-fb axis.1.motor-pos-fb <= hm2_5i25.0.encoder.01.position => pid.1.feedback
net ypos-cmd axis.1.motor-pos-cmd => pid.1.command
net ypos-out pid.1.output => hm2_5i25.0.stepgen.01.velocity-cmd lincurve.2.in lincurve.3.in

# Parametros del PID

setp pid.1.Pgain [AXIS_1]PGAIN
setp pid.1.Igain [AXIS_1]IGAIN
setp pid.1.Dgain [AXIS_1]DGAIN
setp pid.1.bias [AXIS_1]BIAS
setp pid.1.FF0 [AXIS_1]FF0
setp pid.1.FF1 [AXIS_1]FF1
setp pid.1.FF2 [AXIS_1]FF2
setp pid.1.deadband [AXIS_1]DEADBAND
setp pid.1.maxoutput [AXIS_1]MAXOUTPUT



setp hm2_5i25.0.encoder.01.scale 200




# net x-vel axis.0.joint-vel-cmd => lincurve.0.in lincurve.1.in

# net x-vel pid.0.output => lincurve.0.in lincurve.1.in

#net y-Pgain lincurve.2.out-io => pid.1.Pgain

#net y-Dgain lincurve.3.out-io => pid.1.Dgain




# Eje Z

# timing parameters

setp hm2_5i25.0.stepgen.02.dirsetup 1000
setp hm2_5i25.0.stepgen.02.dirhold 1000

setp hm2_5i25.0.stepgen.02.steplen 1000
setp hm2_5i25.0.stepgen.02.stepspace 1000

setp hm2_5i25.0.stepgen.02.position-scale 1380

setp hm2_5i25.0.stepgen.02.maxvel [AXIS_2]MAX_VELOCITY
setp hm2_5i25.0.stepgen.02.maxaccel [AXIS_2]MAX_ACCELERATION

setp hm2_5i25.0.stepgen.02.step_type 0

setp hm2_5i25.0.stepgen.02.control-type 1

net zenable axis.2.amp-enable-out => hm2_5i25.0.stepgen.02.enable => pid.2.enable

# Parafernaria made in volund

net zpos-fb axis.2.motor-pos-fb <= hm2_5i25.0.encoder.02.position => pid.2.feedback
net zpos-cmd axis.2.motor-pos-cmd => pid.2.command
net zpos-out pid.2.output => hm2_5i25.0.stepgen.02.velocity-cmd

# Parametros del PID

setp pid.2.Pgain [AXIS_2]PGAIN
setp pid.2.Igain [AXIS_2]IGAIN
setp pid.2.Dgain [AXIS_2]DGAIN
setp pid.2.bias [AXIS_2]BIAS
setp pid.2.FF0 [AXIS_2]FF0
setp pid.2.FF1 [AXIS_2]FF1
setp pid.2.FF2 [AXIS_2]FF2
setp pid.2.deadband [AXIS_2]DEADBAND
setp pid.2.maxoutput [AXIS_2]MAXOUTPUT

setp hm2_5i25.0.encoder.02.scale 200


# Finales de Carrera

net X-lim- hm2_5i25.0.encoder.03.input-a => axis.0.neg-lim-sw-in
net X-lim+ hm2_5i25.0.encoder.03.input-b => axis.0.pos-lim-sw-in

net Y-lim- hm2_5i25.0.encoder.03.input-index => axis.1.neg-lim-sw-in
net Y-lim+ hm2_5i25.0.encoder.02.input-index => axis.1.pos-lim-sw-in

net Z-lim- hm2_5i25.0.encoder.00.input-index => axis.2.neg-lim-sw-in
net Z-lim+ hm2_5i25.0.encoder.01.input-index => axis.2.pos-lim-sw-in

# Basura final

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared


Thank you!!

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

More
18 Jul 2018 13:45 #114472 by PCW
Replied by PCW on topic Problem matching velocitys
The reason for your speed discrepancy is that your stepgen scaling does not match your hardware.

If you are using ~2 as FF1 for tuning that means that your stepgen scale is only
~1/2 of what it should be. If things are properly scaled, FF1 should be very close to 1.

Effectively you have the stepgen calibrated in 1/2 mm units while the encoder is calibrated in 1 mm units...

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

More
18 Jul 2018 16:24 #114479 by casetero
Replied by casetero on topic Problem matching velocitys
How can i recalibrate it?

Is the

setp hm2_5i25.0.stepgen.00.position-scale 1400

line??

Thank you!!

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

More
18 Jul 2018 17:08 - 18 Jul 2018 17:09 #114482 by PCW
Replied by PCW on topic Problem matching velocitys
Yes I suspect that should be 2800 and FF1 should be 1.0

Plus you may need to reduce your P term since a given error will now generate twice the correction velocity

In other words the stepgen and encoder should both be scaled in counts per mm (or inches for a inch machine)
Last edit: 18 Jul 2018 17:09 by PCW. Reason: sp

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

Moderators: cmorley
Time to create page: 0.152 seconds
Powered by Kunena Forum