coaxial axes / offset comp how to

More
09 Dec 2015 19:25 - 10 Jan 2016 05:40 #66699 by bkt
I have 2 rotary axis coaxial ..... in my custom kins I have add these row in inverse kins
joints[3] = world->a;
         joints[4] = world->b+a;

in these way when move a Axis I move b axis too .... the axes have the same parameter, and same type of mechanical constructions. When move b axe ... a axes no move. It's all I need. And In these way I obtain the right mouvement in world mode. But in manual mode this magical trik obviusly not work.
I think is better choice to do this It is make some changes in my hal file .... I use analogue + encoder .....

this is my actual hal file (A-B section):
#*******************
#  AXIS A
#*******************

setp   pid.a.Pgain     [JOINT_3]P
setp   pid.a.Igain     [JOINT_3]I
setp   pid.a.Dgain     [JOINT_3]D
setp   pid.a.bias      [JOINT_3]BIAS
setp   pid.a.FF0       [JOINT_3]FF0
setp   pid.a.FF1       [JOINT_3]FF1
setp   pid.a.FF2       [JOINT_3]FF2
setp   pid.a.deadband  [JOINT_3]DEADBAND
setp   pid.a.maxoutput [JOINT_3]MAX_OUTPUT
setp   pid.a.error-previous-target true
#setp   pid.a.maxerror .0005

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

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

setp   hm2_5i25.0.7i77.0.1.analogout3-scalemax  [JOINT_3]OUTPUT_SCALE
setp   hm2_5i25.0.7i77.0.1.analogout3-minlim    [JOINT_3]OUTPUT_MIN_LIMIT
setp   hm2_5i25.0.7i77.0.1.analogout3-maxlim    [JOINT_3]OUTPUT_MAX_LIMIT

net a-output                             => hm2_5i25.0.7i77.0.1.analogout3
net a-pos-cmd    joint.3.motor-pos-cmd 
net a-enable     joint.3.amp-enable-out

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

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

net a-pos-fb               <=  hm2_5i25.0.encoder.03.position
net a-vel-fb               <=  hm2_5i25.0.encoder.03.velocity
net a-pos-fb               =>  joint.3.motor-pos-fb
net a-index-enable    joint.3.index-enable  <=>  hm2_5i25.0.encoder.03.index-enable
net a-pos-rawcounts        <=  hm2_5i25.0.encoder.03.rawcounts

# ---setup home / limit switch signals---

net a-home-sw     =>  joint.3.home-sw-in
net both-a     =>  joint.3.neg-lim-sw-in
net both-a     =>  joint.3.pos-lim-sw-in

#*******************
#  AXIS B
#*******************

setp   pid.b.Pgain     [JOINT_4]P
setp   pid.b.Igain     [JOINT_4]I
setp   pid.b.Dgain     [JOINT_4]D
setp   pid.b.bias      [JOINT_4]BIAS
setp   pid.b.FF0       [JOINT_4]FF0
setp   pid.b.FF1       [JOINT_4]FF1
setp   pid.b.FF2       [JOINT_4]FF2
setp   pid.b.deadband  [JOINT_4]DEADBAND
setp   pid.b.maxoutput [JOINT_4]MAX_OUTPUT
setp   pid.b.error-previous-target true
#setp   pid.b.maxerror .0005

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

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

setp   hm2_5i25.0.7i77.0.1.analogout4-scalemax  [JOINT_4]OUTPUT_SCALE
setp   hm2_5i25.0.7i77.0.1.analogout4-minlim    [JOINT_4]OUTPUT_MIN_LIMIT
setp   hm2_5i25.0.7i77.0.1.analogout4-maxlim    [JOINT_4]OUTPUT_MAX_LIMIT

net b-output                             => hm2_5i25.0.7i77.0.1.analogout4
net b-pos-cmd    joint.4.motor-pos-cmd
net b-enable     joint.4.amp-enable-out

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

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

net b-pos-fb               <=  hm2_5i25.0.encoder.04.position
net b-vel-fb               <=  hm2_5i25.0.encoder.04.velocity
net b-pos-fb               =>  joint.4.motor-pos-fb
net b-index-enable    joint.4.index-enable  <=>  hm2_5i25.0.encoder.04.index-enable
net b-pos-rawcounts        <=  hm2_5i25.0.encoder.04.rawcounts

# ---setup home / limit switch signals---

net b-home-sw     =>  joint.4.home-sw-in
net both-b     =>  joint.4.neg-lim-sw-in
net both-b     =>  joint.4.pos-lim-sw-in

I try to add (with sum function) encoder.04 to encoder.03 velocity and position ... but I have follow error ....


Is possible to do this? What is the right mode to do?
Last edit: 10 Jan 2016 05:40 by bkt.

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

More
10 Dec 2015 13:56 #66731 by andypugh
Replied by andypugh on topic coaxial axes

         joints[3] = world->a;
         joints[4] = world->b+a;


That almost certainly needs to be world->a + world->b
The following user(s) said Thank You: bkt

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

More
10 Dec 2015 16:21 #66737 by bkt
Replied by bkt on topic coaxial axes
sorry. Not remember the correct syntax. I modify it some time ago. I think you are in right ... excuse the inaccuracy .... but my intent is make the same things in my hal file ... so I think I will have the same behavior in the world and axes mode too ... (obviusly when hal file is right modified in custom kins joint[4] return to = world->b).

to do so in my hal file I add the value of the encoder (i just try this without succes) or the N- pos - cmd ?? or still I have to add the values ​​of the pid ??

Tanks in advance
Giorgio

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

More
10 Dec 2015 18:32 #66746 by bkt
Replied by bkt on topic coaxial axes
perfect if sum :
.........................
net a-pos-cmd  =>  joint.3.motor-pos-cmd  sum2.0.in0
.............................
net b-sum-a joint.3.motor-pos-cmd => sum2.0.in1
net b-pos-cmd sum2.0.out

obtain a correct mouvement of these 2 axis but when exeed the amount of ferror value (set hight ...100 for testing) I obtain following error of axis4 ..... obviusly I must sum the encoder signal .....
Is necessary sum all encoder signal (velocity pos rawcount etc etc...) or only encoder position?
I must sum the pid.N.output signal too??

regards
giorgio

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

More
10 Dec 2015 18:51 #66749 by andypugh
Replied by andypugh on topic coaxial axes
I have no idea why you are trying to do it in HAL if you had it working in kinematics.

You will get a following error if |axis.N.motor-position-fb - axis.N.motor,position.cmd| > F_ERROR

So, you have to arrange the HAL so that that doesn't happen.
The following user(s) said Thank You: bkt

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

More
10 Dec 2015 19:41 - 10 Dec 2015 19:44 #66759 by bkt
Replied by bkt on topic coaxial axes
because it work only in world mode .... when homing the axis for example the axis move one to one ... in my case on B axes these causes mecanical damage ..... however if I change hal so always follow the axis B axis if it moves ..... for example during the reset will not go banging .

it was not clear if the two axes A and B have mouvemente mechanically limited ... so it is not sufficient that it functions in world mode only.... it must always work .

I am right if I make the sum of hm2_5i25.0.encoder.03.position + hm2_5i25.0.encoder.04.position instead only hm2_5i25.0.encoder.04.position for B axes ? Or must sum other pid and encoder signal too??
Last edit: 10 Dec 2015 19:44 by bkt.

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

More
11 Dec 2015 16:02 #66828 by andypugh
Replied by andypugh on topic coaxial axes

I am right if I make the sum of hm2_5i25.0.encoder.03.position + hm2_5i25.0.encoder.04.position instead only hm2_5i25.0.encoder.04.position for B axes ? Or must sum other pid and encoder signal too??


It is impossible for me to say, without actually knowing what you are trying to do, but the command signal and the feedback signal from and to motion have to be equal, and the PID component attempts to make the pid.command and pid.feedback equal.

The rest is arithmetic.

Bear in mind that there are an infinite number of possibilities for a + b = X.
The following user(s) said Thank You: bkt

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

More
11 Dec 2015 18:05 #66839 by bkt
Replied by bkt on topic coaxial axes
.... I have two rotary axes. One shaft is inside to other .... when rotating the outer shaft (A axe) must turn also to the inner strength (B axe) . As if the outside is stopped I can stroll into the inner. All for only 360 °.

sum of encoder position not solve following axes B error.
net b-index-enable  <=> pid.b.index-enable
net b-enable        =>  pid.b.enable
net b-pos-cmd       =>  pid.b.command
net b-vel-cmd       =>  pid.b.command-deriv
net b-pos-fb        =>  pid.b.feedback
net b-output        =>  pid.b.output

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

setp   hm2_5i25.0.7i77.0.1.analogout4-scalemax  [JOINT_4]OUTPUT_SCALE
setp   hm2_5i25.0.7i77.0.1.analogout4-minlim    [JOINT_4]OUTPUT_MIN_LIMIT
setp   hm2_5i25.0.7i77.0.1.analogout4-maxlim    [JOINT_4]OUTPUT_MAX_LIMIT

net b-output                             => hm2_5i25.0.7i77.0.1.analogout4
net b-sum  joint.4.motor-pos-cmd => sum2.0.in1
net b-pos-cmd    sum2.0.out    #joint.4.motor-pos-cmd
net b-enable     joint.4.amp-enable-out

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

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

net b-pos-fb-ab     sum2.1.in1          <=  hm2_5i25.0.encoder.04.position
#net b-vel-fb-ab     sum2.2.in1          <=  hm2_5i25.0.encoder.04.velocity
net b-pos-fb          <=  sum2.1.out   #<=  hm2_5i25.0.encoder.04.position  #<=  sum2.1.out
net b-vel-fb          <=  hm2_5i25.0.encoder.04.velocity #<=  sum2.2.out
net b-pos-fb               =>  joint.4.motor-pos-fb
net b-index-enable    joint.4.index-enable  <=>  hm2_5i25.0.encoder.04.index-enable
net b-pos-rawcounts        <=  hm2_5i25.0.encoder.04.rawcounts

As you see the signal b-pos-fb is sum to a-pos-fb ... i try with gain0 to -1 ... but obtain only the negative amoun of error.

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

More
11 Dec 2015 18:11 #66841 by andypugh
Replied by andypugh on topic coaxial axes
Do you want them both to turn independently?

As far as LinuxCNC is concerned it is all just numbers. You decide what each number means and what you want to do with it.

the A and B commands in G-code put numbers into HAL. The PID component tries to make two numbers equal. Encoders provide numbers that depend on position in any way that you decide they should.

Have you considered the "offset" HAL component? Does that do what you want?
The following user(s) said Thank You: bkt

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

More
11 Dec 2015 18:33 - 11 Dec 2015 19:21 #66842 by bkt
Replied by bkt on topic coaxial axes

Do you want them both to turn independently?


Yes.

I not consider offset components .... real sorry.

Correct me if I'm wrong, in my case:

offset.N.offset float in --> a-pos-cmd

offset.N.in float in --> b-pos-cmd

offset.N.out float out --> b-pos-cmd/joint.4.motor-pos-cmd

offset.N.fb-in float in -->a-pos-fb

offset.N.fb-out float out --> b-pos-fb

I misunderstood?

It update immediately or some in certain cases? I never try it.

regards
giorgio
Last edit: 11 Dec 2015 19:21 by bkt.

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

Time to create page: 0.185 seconds
Powered by Kunena Forum