Spindle orientation

More
03 Feb 2013 00:57 #29497 by tld70
Replied by tld70 on topic Spindle orientation
Hello ArcEye

here is my Spindel HAL

Hope you can help me.



# ################
# Spindel S
# ################


################################################################################
################################################################################
# Spindelparameter
################################################################################
#
#Laden
################################################################################
loadrt orient names=orient
addf orient servo-thread
addf pid.3.do-pid-calcs servo-thread
addf pid.4.do-pid-calcs servo-thread

addf sum2.0 servo-thread # summe laden
addf abs.spindle servo-thread
addf Drehzahl-erreicht servo-thread
########################################################################################
# Parameter setzen
########################################################################################

setp hm2_5i20.1.pwmgen.00.output-type 1 # muss 1 sein bei +- 10V
setp hm2_5i20.1.pwmgen.00.enable 1
setp hm2_5i20.1.pwmgen.00.scale [SPINDLE]MAX_DREHZAHL ### Maximale Drehzahl ###

setp Drehzahl-erreicht.difference 5
setp Drehzahl-erreicht.scale [SPINDLE]MAX_DREHZAHLABWEICHUNG ### Drehzahlabweichung ###
#setp hm2_5i20.1.encoder.00.position-scale [SPINDLE]GEBER_INKREMENTE ### Auflösung ###
setp hm2_5i20.1.encoder.00.counter-mode 0
setp hm2_5i20.1.encoder.00.filter 1
setp hm2_5i20.1.encoder.00.index-invert 0
setp hm2_5i20.1.encoder.00.index-mask 0
setp hm2_5i20.1.encoder.00.index-mask-invert 0
setp hm2_5i20.1.encoder.00.scale [SPINDLE]INPUT_SCALE

# PID Parameter vom INI File holen

setp pid.3.Pgain [SPINDLE]P ### PID ###
setp pid.3.Igain [SPINDLE]I
setp pid.3.Dgain [SPINDLE]D
setp pid.3.bias [SPINDLE]BIAS
setp pid.3.FF0 [SPINDLE]FF0
setp pid.3.FF1 [SPINDLE]FF1
setp pid.3.FF2 [SPINDLE]FF2
setp pid.3.deadband [SPINDLE]DEADBAND
setp pid.3.maxoutput [SPINDLE]MAX_OUTPUT



################################################################################
# Positionierung M19 P"funktion" R"winkel"
################################################################################
### Orient

net orient-angle motion.spindle-orient-angle orient.angle
net orient-mode motion.spindle-orient-mode orient.mode
net orient-enable motion.spindle-orient orient.enable pid.4.enable
# net spindle-pos ...encoder..position orient.position pid.4.position ### Achtung das ist bei zeile 411
net orient-command orient.command pid.4.command

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

net spindle-deg orient.position # Zeile 411




#
################################################################################################
# Drehzahlsignale
#################################################################################################

net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps # umdrehungen pro sekunde
net spindle-rpm toolchange.0.soll-drehzahl-nc motion.spindle-speed-out #Sollwert von NC
net spindle-deg <= hm2_5i20.1.encoder.00.position motion.spindle-revs # Das sind Spindel umdrehungen ( nicht pro minute )
net SP-istwert-rps hm2_5i20.1.encoder.00.velocity # aktuelle Drehzahl Achtung velocity ist rp sekunde
## Umwandlung von umdrehungen pro sekunde in umdrehungen pro minute
setp scale.0.gain 60
net SP-istwert-rps => scale.0.in
net SP-istwert scale.0.out
net SP-istwert motion.spindle-speed-in
net SP-sollwert <= toolchange.0.soll-drehzahl-comp



net spindle-ein-motion <= motion.spindle-on

net spindle-ein-motion or2.7.in0
net orient-enable or2.7.in1
net spindle-ein or2.7.out




#net spindle-ein <= motion.spindle-on # das weg wenn orient freigabe schaltet
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
#net spindle-brake <= motion.spindle-brake
net spindle_index_enable hm2_5i20.1.encoder.00.index-enable motion.spindle-index-enable


###########################
# Signal Drehzahl erreicht
#############################################################################################################################################################################################################
net SP-sollwert => Drehzahl-erreicht.in1
net SP-istwert => Drehzahl-erreicht.in2

## Das auch in post Gui
net Drehzahl-erreicht-fortfahren motion.spindle-at-speed <= Drehzahl-erreicht.out







# ---PID/SPINDLE control signals
##############################################################
# Diese Signale überprüfen dann einbinden
############################################################
net spindle-vel-cmd-rps => pid.3.command # rps oeder rpm
net SP-istwert => pid.3.feedback
net spindle-ein => pid.3.enable #(PID aktivieren)
net spindle-pid-pre <= pid.3.output
#################################################################


###########################################################################
# einbinden
#############################################################################


###sum the spindle velocity comand
net spindle-pid-pre => sum2.0.in0
net SP-sollwert => sum2.0.in1

###the output signal pid+command
net spindle-pid-out <= sum2.0.out
net spindle-pid-out => abs.spindle.in

###the result for PWM gen

net spindle-pid-out => hm2_5i20.1.pwmgen.00.value # Sollwertausgabe zu Contraves



#####################################################################
# Spindel einschalten und mit +g die Freigabe zuschalten und bei wzw Spindel halt
#####################################################################
net plus_g and2.12.in0
net spindle-ein and2.12.in1
net K21_Relais <= and2.12.out

##### bei WZW soll die Spindel stoppen
net K21_Relais and2.13.in0
net K21-Freigabe toolchange.0.SP-dreh and2.13.in1
net K21-Relais-oder and2.13.out

net K21-Relais-oder or2.6.in0
net K21-drehen toolchange.0.drehen or2.6.in1
net K21_Relais_Ausgang or2.6.out

net K21_Relais_Ausgang => hm2_5i20.0.gpio.040.out => hm2_5i20.1.pwmgen.00.enable # Spindel Freigabe K21 Spindel freigeben

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

More
03 Feb 2013 01:21 - 03 Feb 2013 01:27 #29498 by ArcEye
Replied by ArcEye on topic Spindle orientation

addf pid.3.do-pid-calcs servo-thread
addf pid.4.do-pid-calcs servo-thread


Where is the loadrt line for these pid's ?

Also

net spindle-pos ...encoder..position orient.position pid.4.position


Whilst this is what is in the man page, it is not a proper net command, you need to have a proper encoder.0.position or similar as the first pin name

Perhaps hm2_5i20.1.encoder.00.position ?
Last edit: 03 Feb 2013 01:27 by ArcEye.

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

More
03 Feb 2013 01:44 #29499 by tld70
Replied by tld70 on topic Spindle orientation
The loadrt you dont see because this in the beginning of this HAL File

loadrt pid num_chan=5

# net spindle-pos ...encoder..position orient.position pid.4.position
this is remarked ( I copise this from the Doku ORIENT

net spindle-deg orient.position
net spindle-deg <= hm2_5i20.1.encoder.00.position motion.spindle-revs # Das sind Spindel umdrehungen ( nicht pro minute )

here I conect this to orient.
But when I conect to pid.4.position , there is a errer because linuxcnc dont found pid.4.position, and I dont see the signal in HAL diagnostic

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

More
03 Feb 2013 16:33 - 03 Feb 2013 18:18 #29514 by ArcEye
Replied by ArcEye on topic Spindle orientation
Hi

The man page for orient obviously has some issues.

I don't know why it has net spindle-pos ...encoder..position orient.position orient-pid.position in its example connections

There is no pin called position in the pid component ( I don't use them for anything so was not familiar with them and had to look it all up)

It looks to me as though the connection would probably be to pid.N.feedback-deriv (or possibly just .feedback) which is what is noted as taking connection from an encoder.

I will ask Andy to have a look, but he is away at present, so it might not be immediate.

regards
Last edit: 03 Feb 2013 18:18 by ArcEye.

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

More
03 Feb 2013 19:33 #29523 by andypugh
Replied by andypugh on topic Spindle orientation
[quote="ArcEye" post=29514The man page for orient obviously has some issues.
It looks to me as though the connection would probably be to pid.N.feedback-deriv (or possibly just .feedback) which is what is noted as taking connection from an encoder.[/quote]

It should be orient-pid.feedback. (or pid.N.feedback if not using the naming option)

There is an orient demo in the sim configs, but I have a feeling that that might not work either as I can't see that it uses any HAL file which links the orient stuff. However I can't test that as I don't have a running LinuxCNC machine here in the hotel room.

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

More
03 Feb 2013 20:15 #29524 by ArcEye
Replied by ArcEye on topic Spindle orientation
Thanks for looking Andy

There is an orient demo in the sim configs, but I have a feeling that that might not work either as I can't see that it uses any HAL file which links the orient stuff


The sim Orient runs but I am not sure what it does. It certainly does not load the orient component and just uses motion.spindle-orient pins in the postgui file

tld70

Looks like you need to try linking to pid.4.feedback where the example gives pid.4.position and see if that does what you expect

regards

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

More
09 Mar 2013 21:20 #31135 by tld70
Replied by tld70 on topic Spindle orientation
Hello ArcEye,

sorry I did not have time to to the Orientation now....
But I did a Update to a newer version ( 2.6 )
can I use your io in the newer version also?

Best regards

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

More
10 Mar 2013 01:05 #31143 by ArcEye
Replied by ArcEye on topic Spindle orientation
Hi

The new copy of io I posted WAS for 2.6

at - www.linuxcnc.org/index.php/english/forum...-tool?start=30#28965

regards

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

More
12 Aug 2013 23:45 #37592 by jlviloria
Replied by jlviloria on topic Spindle orientation
ArcEye

any spindle unit is able to orient, in my case it RELIANCE MAXPAK PLUS SPINDLE DRIVE, DC MOTOR 50 HP.

I see the example that is in "sim" but I see where it loads the module "loadrt orient" some help with this, I have installed 2.6 master.

how could my unit test if it is possible to orient spindle thanks.


Jorge Viloria

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

More
13 Aug 2013 15:36 #37609 by ArcEye
Replied by ArcEye on topic Spindle orientation
Hi Jorge

You need to contact tld70, he was trying to get this to work on his machine.

I have no practical experience with it, I just located the sims for tld70 to test and tried to resolve the documentation.

regards
The following user(s) said Thank You: jlviloria

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

Time to create page: 0.138 seconds
Powered by Kunena Forum