Orient Spindle question

More
03 Nov 2021 11:16 - 03 Nov 2021 11:16 #225090 by Pro_El
hello to all

I am trying to configure spindle orientation with the orient component. I am using LCNC 2.8 and make everything by manual for orient component. I need to now how can start orientation. When i put M19 in MDI nothing happened. My spindle have quadrature encoder 2500ppr and is running fine on spindle M3 SXX command. I enable orientation in hal and put orientation offset in ini file. now in manual it say that M19 should asserted spindle.N.orient in my case spindle.0.orient  . This pin doesn't go high state when i hit M19. 

Can someone pointed me what am i doing wrong and how can i start M19 process. 

This is hal config i put in hal

loadrt orient names=orient
loadrt pid names=orient-pid
net orient-angle spindle.0.orient-angle orient.angle
net orient-mode spindle.0.orient-mode orient.mode
net orient-enable spindle.0.orient orient.enable orient-pid.enable
net spindle-in-pos orient.is-oriented spindle.0.is-oriented
net spindle-pos encoder.position orient.position orient-pid.feedback
net orient-command orient.command orient-pid.command

Any help and guide is much welcome 
Last edit: 03 Nov 2021 11:16 by Pro_El.

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

More
03 Nov 2021 14:39 #225109 by Pro_El
Replied by Pro_El on topic Orient Spindle question
i see one unusual thing that orient position did not update with spindle position. Should i make this connection between them and if i should how can i make this line in hal.

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

More
03 Nov 2021 23:57 #225167 by 0x2102
Replied by 0x2102 on topic Orient Spindle question
Here is a Spindle orient example config from Talla83.

I have been using this as my base config a few times now.

The spindle in running in speed mode during normal M3 / M4 etc and PID control with M19.

Some of the comments are in German but it might give you an idea of what needs to be connected.

talla83.homepage.t-online.de/linuxcnc/20181124_Spindel_5i25.zip
The following user(s) said Thank You: Pro_El

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

More
04 Nov 2021 21:39 #225275 by Pro_El
Replied by Pro_El on topic Orient Spindle question
Thanks Markus for the help, i am learning now to work with orientation and keep you posted what have been done.

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

More
05 Nov 2021 00:50 #225319 by Michael
Replied by Michael on topic Orient Spindle question
I am also working on my spindle orientation and found out a simple m19 doesn't work. It worked fine with a full M19 R0 Q10 P0

I was unable to sets or setup any of those values in hal so that I could make a simple M19 work. Hope this helps.
The following user(s) said Thank You: Pro_El

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

More
06 Nov 2021 09:46 - 06 Nov 2021 09:49 #225482 by Pro_El
Replied by Pro_El on topic Orient Spindle question
I tryed this hal example but it is not for me because is Step and Dir. I have PWM. Now i found on other with pwm generators. But it gives me alarm when i start LCNC that hm2_5i25.0.pwmgen.05.output pin not found. Now i think because this hal is old and i am working on 2.8 LCNC there have been changes with PWM and Analog output. My first problem is to change : setp hm2_5i25.0.pwmgen.05.output-type 1       to mach with 2.8
Can somebody help me how to edit this hal file so i can use with my 5i25 card and LCNC 2.8 with Buster.

# SPINDLE

setp hm2_5i25.0.encoder.05.counter-mode 0
setp hm2_5i25.0.encoder.05.filter 1
setp hm2_5i25.0.encoder.05.index-invert 0
setp hm2_5i25.0.encoder.05.index-mask 0
setp hm2_5i25.0.encoder.05.index-mask-invert 0
setp hm2_5i25.0.encoder.05.scale [SPINDLE_0]ENCODER_SCALE
setp hm2_5i25.0.pwmgen.05.output-type 1
setp hm2_5i25.0.pwmgen.05.scale [SPINDLE_0]OUTPUT_SCALE

loadrt limit2 names=spindle-ramp
loadrt near names=spindle-at-speed,spindle-at-pos
loadrt timedelay names=spindle-active-delay
loadrt orient names=spindle-orient
loadrt pid names=spindle-pid
loadrt mux2 names=spindle-pwm-switch
loadrt or2 count=0
loadrt not count=0
loadrt and2 count=0
loadrt offset count=0


addf spindle-ramp servo-thread
addf spindle-at-speed servo-thread
addf spindle-at-pos servo-thread
addf spindle-active-delay servo-thread
addf spindle-orient servo-thread
addf spindle-pid.do-pid-calcs servo-thread
addf spindle-pwm-switch servo-thread
addf or2.0 servo-thread
addf not.0 servo-thread
addf and2.0 servo-thread
addf offset.0.update-output servo-thread


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

setp spindle-ramp.maxv [SPINDLE_0]ACCELERATION
setp spindle-at-speed.difference [SPINDLE_0]MAX_ERROR
setp spindle-at-pos.difference 0.01
setp spindle-at-pos.in1 0
setp spindle-active-delay.on-delay 0
setp spindle-active-delay.off-delay [SPINDLE_0]OFF_DELAY

# orient mit motion verknuepfen
net orient-angle motion.spindle-orient-angle => spindle-orient.angle
net orient-mode motion.spindle-orient-mode => spindle-orient.mode
net orient-enable motion.spindle-orient => => and2.0.in1

# Position vom Encoder in den pid / orient und motion schieben
net spindle-pos => spindle-pid.feedback => spindle-orient.position
net spindle-pos <= motion.spindle-revs <= hm2_5i25.0.encoder.05.position

# Encodergeschwindigkeit U/sek in den near und motion schieben
net spindle-fb-rps motion.spindle-speed-in <= hm2_5i25.0.encoder.05.velocity => spindle-at-speed.in2

# Positionsvorgabe vom orient in den pid schieben
setp offset.0.offset 1
net spindle.otient-cmd spindle-orient.command => offset.0.in
net spindle-orient-cmd1 offset.0.out => spindle-pid.command

# Drehzahlvorgabe U/min aus motion in das limit2 schieben
net spindle-speed-rpm motion.spindle-speed-out => spindle-ramp.in

# Drehzahlvorgabe U/sek aus motion in das near schieben
net spindle-speed-rps motion.spindle-speed-out-rps => spindle-at-speed.in1

# Wenn Solldrehzahl gleich Istdrehzahl dann aus near das bit in motion schieben
net spindle-at-speed spindle-at-speed.out => motion.spindle-at-speed

# Wenn Sollpositon gleich Istpositon dann aus near das bit in motion schieben
net spindle-pos-err spindle-at-pos.in2 <= spindle-pid.error
net spindle-at-pos spindle-at-pos.out =>

net spindle-on0 motion.spindle-on => spindle-active-delay.in
net spindel-on1 spindle-active-delay.out => or2.0.in0 => not.0.in
net spindel-on2 and2.0.in0 <= not.0.out

# orient und pid aktivieren
net orient-active and2.0.out => or2.0.in1 => spindle-pwm-switch.sel
net orient-active => spindle-pid.enable => spindle-orient.enable

net spindle-enable or2.0.out => hm2_5i25.0.pwmgen.05.enable

# motion gibt Signal an Encoder das beim naechsten Z Signal auf 0 gestellt werden soll
net spindle-sync motion.spindle-index-enable => hm2_5i25.0.encoder.05.index-enable
sets spindle-sync 1

# pwm Signal entweder vom motion oder orient
net pwm-switch-in0 spindle-pwm-switch.in0 <= spindle-ramp.out
net pwm-switch-in1 spindle-pwm-switch.in1 <= spindle-pid.output
net pwm-switch-out spindle-pwm-switch.out => hm2_5i25.0.pwmgen.05.value


########## Bewegungsueberbrueckung um Schleppfehler zu vermeiden !!! ##########
net xpos-cmd axis.0.motor-pos-cmd => axis.0.motor-pos-fb
net ypos-cmd axis.1.motor-pos-cmd => axis.1.motor-pos-fb
net zpos-cmd axis.2.motor-pos-cmd => axis.2.motor-pos-fb
########## Bewegungsueberbrueckung ##########


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


This is part of the hal that need to change for my machine with LCNC 2.8 and 5i25 with 7i77 card
Last edit: 06 Nov 2021 09:49 by Pro_El.

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

More
08 Nov 2021 20:40 #225722 by 0x2102
Replied by 0x2102 on topic Orient Spindle question
Hello,

can you attach your working HAL prior to the spindle orient changes? Your basic HAL where you have M3 / M4 working.
The following user(s) said Thank You: Pro_El

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

More
09 Nov 2021 21:05 #225875 by Pro_El
Replied by Pro_El on topic Orient Spindle question
Thank you a lot Markus for trying to help me.
 Here is my working hal file created with pncconf and linuxcnc 2.8
Thanks a lot again!
Attachments:

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

More
11 Nov 2021 22:39 #226156 by 0x2102
Replied by 0x2102 on topic Orient Spindle question
I will try to take a look over the weekend.
The following user(s) said Thank You: Pro_El

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

More
13 Nov 2021 22:57 #226380 by Pro_El
Replied by Pro_El on topic Orient Spindle question
Thank you Markus for your help. I am lost with this ..

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

Time to create page: 0.095 seconds
Powered by Kunena Forum