Absolute linear scales

More
19 Aug 2016 04:33 #79035 by terkaa
Hi,

I have absolute linear scale connected to 7i74 channel 1(SSI). Now I would like to know how to modify this to work with these scales:

# Second axis
[AXIS_1]

TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 130
MAX_ACCELERATION = 508
BACKLASH = 0.000
INPUT_SCALE = 157.48
OUTPUT_SCALE = 1.000
MIN_LIMIT = -254
MAX_LIMIT = 254
FERROR = 1.27
MIN_FERROR = .254
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0

Scales have resolution of 0,1 um.

Tero

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

More
19 Aug 2016 14:00 #79074 by andypugh
Replied by andypugh on topic Absolute linear scales
Absolute encoders are supported in the current Master (development) version, and have a behaviour described in this commit message:
github.com/LinuxCNC/linuxcnc/commit/f59b...9e0fd6b15af29a0c29c3

And here in the homing docs:
linuxcnc.org/docs/devel/html/config/ini-...ome_absolute_encoder

You can get Master (2,8) from buildbot.linuxcnc.org

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

More
19 Aug 2016 18:56 #79095 by terkaa
Replied by terkaa on topic Absolute linear scales
Is there a way to get this working on 2.7.6?


Tero

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

More
19 Aug 2016 19:37 #79098 by PCW
Replied by PCW on topic Absolute linear scales
Not sure about homing with absolute encoders on 2.7.X

I would get the scaling and encoder setup working before moving to 2.8

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

More
20 Aug 2016 06:33 #79118 by terkaa
Replied by terkaa on topic Absolute linear scales
Hi,

This is what I had also in mind. I will also try to figure out a way to make homing work with 2.7.6. Since this is a production environment I would like to use "stable" version. I may consider upgrade to 2.8.X when version is at least 2.8.4 :woohoo:

Tero

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

More
20 Aug 2016 13:19 #79123 by andypugh
Replied by andypugh on topic Absolute linear scales
It is possible that the INI file option NO_FORCE_HOMING might be enough for your situation.

Certainly worth a try before we get creative :-)
linuxcnc.org/docs/2.7/html/config/ini-config.html#_traj_section

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

More
26 Aug 2016 09:02 #79460 by terkaa
Replied by terkaa on topic Absolute linear scales
I have connected feedback from linear scale (Correct reading on Y-Axis DRO). Now I would like to connect analog command to servo amplifier. I was thinking of modifying these lines(made by PNCCONF for 7i77) to suit SSI encoder:


#*******************
# AXIS Y
#*******************

setp pid.y.Pgain [AXIS_1]P
setp pid.y.Igain [AXIS_1]I
setp pid.y.Dgain [AXIS_1]D
setp pid.y.bias [AXIS_1]BIAS
setp pid.y.FF0 [AXIS_1]FF0
setp pid.y.FF1 [AXIS_1]FF1
setp pid.y.FF2 [AXIS_1]FF2
setp pid.y.deadband [AXIS_1]DEADBAND
setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
setp pid.y.error-previous-target true

net y-index-enable <=> pid.y.index-enable
net y-enable => pid.y.enable
net y-pos-cmd => pid.y.command
net y-vel-cmd => pid.y.command-deriv
net y-pos-fb => pid.y.feedback
net y-output => pid.y.output

# ---PWM Generator signals/setup---

setp hm2_5i25.0.7i77.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT

net y-output => hm2_5i25.0.7i77.0.1.analogout1
net y-pos-cmd axis.1.motor-pos-cmd
net y-enable axis.1.amp-enable-out

# ---Encoder feedback signals/setup---

setp hm2_5i25.0.encoder.07.counter-mode 0
setp hm2_5i25.0.encoder.07.filter 1
setp hm2_5i25.0.encoder.07.index-invert 0
setp hm2_5i25.0.encoder.07.index-mask 0
setp hm2_5i25.0.encoder.07.index-mask-invert 0
setp hm2_5i25.0.encoder.07.scale [AXIS_1]ENCODER_SCALE

net y-pos-fb <= hm2_5i25.0.encoder.07.position
net y-vel-fb <= hm2_5i25.0.encoder.07.velocity
net y-pos-fb => axis.1.motor-pos-fb
net y-index-enable axis.1.index-enable <=> hm2_5i25.0.encoder.07.index-enable
net y-pos-rawcounts <= hm2_5i25.0.encoder.07.rawcounts


Could it be:


#*******************
# AXIS Y
#*******************

setp pid.y.Pgain [AXIS_1]P
setp pid.y.Igain [AXIS_1]I
setp pid.y.Dgain [AXIS_1]D
setp pid.y.bias [AXIS_1]BIAS
setp pid.y.FF0 [AXIS_1]FF0
setp pid.y.FF1 [AXIS_1]FF1
setp pid.y.FF2 [AXIS_1]FF2
setp pid.y.deadband [AXIS_1]DEADBAND
setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
setp pid.y.error-previous-target true

net y-index-enable <=> pid.y.index-enable
net y-enable => pid.y.enable
net y-pos-cmd => pid.y.command
net y-vel-cmd => pid.y.command-deriv
net y-pos-fb => pid.y.feedback
net y-output => pid.y.output

# ---PWM Generator signals/setup---

setp hm2_5i25.0.7i83.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
setp hm2_5i25.0.7i83.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i83.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT

net y-output => hm2_5i25.0.7i83.0.1.analogout1
net y-pos-cmd axis.1.motor-pos-cmd
net y-enable axis.1.amp-enable-out

# ---Encoder feedback signals/setup---

net y-pos-fb <= hm2_5i25.0.ssi.01.yencoder.position
net y-pos-fb => axis.1.motor-pos-fb
net y-pos-rawcounts <= hm2_5i25.0.ssi.01.rawcounts

Do I need this:

net y-index-enable axis.1.index-enable <=> hm2_5i25.0.encoder.07.index-enable

And what should I do with this:

net y-vel-fb <= hm2_5i25.0.encoder.07.velocity

There is no pin .velocity with SSI encoder.

Am I even near correct track here?

Tero

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

More
26 Aug 2016 09:10 #79461 by andypugh
Replied by andypugh on topic Absolute linear scales
I think you are close.
You can't connect the index-enable, but as that is only used during homing, and you won't be homing, that's probably OK.
That pin works in conjunction with the INI option HOME_USE_INDEX. Probably not important, but bear it in mind for the future.

You won't be able to connect the velocity, but the PID component is clever enough to compute velocity internally if the pin is not linked. You have to make sure that the pin is not linked at the PID component, though.

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

More
26 Aug 2016 12:32 #79474 by terkaa
Replied by terkaa on topic Absolute linear scales
OK, I tried :

#*******************
# AXIS Y
#*******************

setp pid.y.Pgain [AXIS_1]P
setp pid.y.Igain [AXIS_1]I
setp pid.y.Dgain [AXIS_1]D
setp pid.y.bias [AXIS_1]BIAS
setp pid.y.FF0 [AXIS_1]FF0
setp pid.y.FF1 [AXIS_1]FF1
setp pid.y.FF2 [AXIS_1]FF2
setp pid.y.deadband [AXIS_1]DEADBAND
setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
setp pid.y.error-previous-target true

net y-index-enable <=> pid.y.index-enable
net y-enable => pid.y.enable
net y-pos-cmd => pid.y.command
net y-vel-cmd => pid.y.command-deriv
net y-pos-fb => pid.y.feedback
net y-output => pid.y.output

# ---PWM Generator signals/setup---

#setp hm2_hm2_5i25.0.7i83.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
#setp hm2_5i25.0.7i83.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
#setp hm2_5i25.0.7i83.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT

net y-output => hm2_5i25.0.7i83.0.1.analogout1
net y-pos-cmd axis.1.motor-pos-cmd
net y-enable axis.1.amp-enable-out
net y-enable hm2_5i25.0.7i83.0.1.analogena1

# ---Encoder feedback signals/setup---

net y-pos-fb <= hm2_5i25.0.ssi.01.yencoder.position
net y-pos-fb => axis.1.motor-pos-fb
net y-pos-rawcounts <= hm2_5i25.0.ssi.01.yencoder.rawcounts

But it seems pd.y does not output analog voltage

output of pid.y:

halcmd show pin pid.y
Component Pins:
Owner Type Dir Value Name
28 float IN 0 pid.y.Dgain
28 float IN 0 pid.y.FF0
28 float IN 1 pid.y.FF1
28 float IN 0 pid.y.FF2
28 float IN 0 pid.y.Igain
28 float IN 50 pid.y.Pgain
28 float IN 0 pid.y.bias
28 float IN 415.2305 pid.y.command <== y-pos-cmd
28 float IN 0 pid.y.command-deriv <== y-vel-cmd
28 float IN 0 pid.y.deadband
28 s32 OUT 0 pid.y.do-pid-calcs.time
28 bit IN TRUE pid.y.enable <== y-enable
28 float OUT 0 pid.y.error
28 bit IN TRUE pid.y.error-previous-target
28 float IN 415.0513 pid.y.feedback <== y-pos-fb
28 float IN 0 pid.y.feedback-deriv
28 bit IN FALSE pid.y.index-enable <== y-index-enable
28 float IN 0 pid.y.maxcmdD
28 float IN 0 pid.y.maxcmdDD
28 float IN 0 pid.y.maxerror
28 float IN 0 pid.y.maxerrorD
28 float IN 0 pid.y.maxerrorI
28 float IN 4 pid.y.maxoutput
28 float OUT 0 pid.y.output ==> y-output
28 bit OUT FALSE pid.y.saturated
28 s32 OUT 0 pid.y.saturated-count
28 float OUT 0 pid.y.saturated-s

Tero

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

More
28 Aug 2016 11:30 #79586 by terkaa
Replied by terkaa on topic Absolute linear scales
After some thinkering I have got it moving but right after enabling axis starts to vibrate heavily it moves about 10mm back and forth. This is vertical axis with hydraulic cylinders as counterbalance. Basically load just "hangs there with about 2% load. After movement starts load goes to about 50% Settings are now following:

#*******************
# AXIS Y
#*******************

setp pid.y.Pgain [AXIS_1]P
setp pid.y.Igain [AXIS_1]I
setp pid.y.Dgain [AXIS_1]D
setp pid.y.bias [AXIS_1]BIAS
setp pid.y.FF0 [AXIS_1]FF0
setp pid.y.FF1 [AXIS_1]FF1
setp pid.y.FF2 [AXIS_1]FF2
setp pid.y.deadband [AXIS_1]DEADBAND
setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
setp pid.y.error-previous-target true

net y-index-enable <=> pid.y.index-enable
net y-enable => pid.y.enable
net y-pos-cmd => pid.y.command
#net y-vel-cmd => pid.y.command-deriv
net y-pos-fb => pid.y.feedback
net y-output => pid.y.output

# ---PWM Generator signals/setup---

setp hm2_5i25.0.7i83.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
setp hm2_5i25.0.7i83.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i83.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT

net y-output => hm2_5i25.0.7i83.0.1.analogout1
net y-pos-cmd axis.1.motor-pos-cmd
net y-enable axis.1.amp-enable-out
net y-enable hm2_5i25.0.7i83.0.1.analogena1

# ---Encoder feedback signals/setup---

net y-pos-fb <= hm2_5i25.0.ssi.01.yencoder.position
net y-pos-fb => axis.1.motor-pos-fb
net y-pos-rawcounts <= hm2_5i25.0.ssi.01.yencoder.rawcounts

And INI:

# Second axis
[AXIS_1]

TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 134
MAX_ACCELERATION = 268
P = 20.0
I = 0.0
D = 0.0
FF0 = 0.0
FF1 = 1.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.004
BACKLASH = 0.000
MAX_OUTPUT = 10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0
INPUT_SCALE = 1.000
OUTPUT_SCALE = -10.000
MIN_LIMIT = -254
MAX_LIMIT = 254
FERROR = 20
MIN_FERROR = 10
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0


Any obvious reason for this ie. some pin unconnected that should be connected. Or is this just a matter of tuning?

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

Time to create page: 0.079 seconds
Powered by Kunena Forum