HAL M19 Orient dont work

More
3 years 7 months ago #266576 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
According to your statement it should work but it doesn't work, I have to do something else, I have in the ini: [RS274NGC]
PARAMETER_FILE = linuxcnc.var
ORIENT_OFFSET = 0 entered. and my spindle is equipped with additional things such as off_delay. but i always get "pin motion.spindle-orient-angle does not exist" when i hide this sentence in the hal gives me the next line. that this does not exist

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

More
3 years 7 months ago #266583 by PCW
Replied by PCW on topic HAL M19 Orient dont work
It does work (verified here)

You likely have the wrong name for spindle orient angle

(probably should be spindle.0.orient-angle with current LinuxCNC)

I would suggest you not guess at pin names and instead list them by:

1. Remove all hal lines that cause an error
2. Launch LinuxCNC
3. Run halcmd -kf
4. Issue a command like "show pin spindle"

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

More
3 years 7 months ago - 3 years 7 months ago #266650 by 0x2102
Replied by 0x2102 on topic HAL M19 Orient dont work
I don't remember all the details (has been a while) but I looked at my config and it is as PCW said:

Talla's org. config is for LinuxCNC 2.7. Since then PIN names have changed and you need to update your HAL. 

Replace "motion.spindle...." with "spindle.0." Check for correct PIN names. 

# 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

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

Exclude the lines with an error in your HAL with a "#" in front until you can load LinuxCNC and then verify your PINs exist and fix the connections. 
Last edit: 3 years 7 months ago by 0x2102.

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

More
3 years 7 months ago #266655 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
Thanks for all the help, so I was able to find the spindle pin but I still have an error, when I do "show pin motion" I don't see a motion.angle pin that is missing. and that's my fault. The other motion pins that I need are also missing, somewhere the worm is stuck.

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

More
3 years 7 months ago - 3 years 7 months ago #266666 by 0x2102
Replied by 0x2102 on topic HAL M19 Orient dont work
Most if not all PINs for this are now under "spindle.0.XYZ". Look there for what you need.
Last edit: 3 years 7 months ago by 0x2102.

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

More
3 years 7 months ago #266677 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
hello, thanks for all the help, this is the current hal excerpt. i can now turn the spindle on with m3 and m4 and off again with m5. However, my spindle is now running too fast because the config for the translation ratio is now missing.

However, when I do m19 nothing happens. when i make m19 with spindle off, the spindle turns on and turns and turns. nothing happens here anymore.

I noticed now that I'm at home that there is another # at the bottom of the sync could it be because of that?
#*******************
# SPINDLE
#*******************

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

setp [HMOT](CARD0).encoder.04.counter-mode 0
setp [HMOT](CARD0).encoder.04.filter 1
setp [HMOT](CARD0).encoder.04.index-invert 0
setp [HMOT](CARD0).encoder.04.index-mask 0
setp [HMOT](CARD0).encoder.04.index-mask-invert 0
setp [HMOT](CARD0).encoder.04.scale [SPINDLE_0]ENCODER_SCALE

# Step Gen signals/setup

setp [HMOT](CARD0).stepgen.04.dirsetup [SPINDLE_0]DIRSETUP
setp [HMOT](CARD0).stepgen.04.dirhold [SPINDLE_0]DIRHOLD
setp [HMOT](CARD0).stepgen.04.steplen [SPINDLE_0]STEPLEN
setp [HMOT](CARD0).stepgen.04.stepspace [SPINDLE_0]STEPSPACE
setp [HMOT](CARD0).stepgen.04.position-scale [SPINDLE_0]OUTPUT_SCALE
setp [HMOT](CARD0).stepgen.04.step_type 0
setp [HMOT](CARD0).stepgen.04.control-type 1
setp [HMOT](CARD0).stepgen.04.maxaccel [SPINDLE_0]STEPGEN_MAXACCEL
setp [HMOT](CARD0).stepgen.04.maxvel [SPINDLE_0]STEPGEN_MAXVEL

# ---setup spindle control signals---

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
#addf orient.0 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

# ---Setup spindle at speed signals---

# orient mit motion verknuepfen
net orient-angle spindle-orient.angle => spindle.0.orient-angle
net orient-mode spindle-orient.mode => spindle.0.orient-mode
net orient-enable spindle.0.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 <= spindle.0.revs <= [HMOT](CARD0).encoder.04.position


# Encodergeschwindigkeit U/sek in den near und motion schieben
net spindle-fb-rps spindle.0.speed-in <= [HMOT](CARD0).encoder.04.velocity => spindle-at-speed.in2

# Positionsvorgabe vom orient in den pid schieben
setp offset.0.offset 1
net spindle.orient-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 spindle.0.speed-out => spindle-ramp.in

# Drehzahlvorgabe U/sek aus motion in das near schieben
net spindle-speed-rps spindle.0.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 => spindle.0.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 spindle.0.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 => [HMOT](CARD0).stepgen.04.enable

# motion gibt Signal an Encoder das beim naechsten Z Signal auf 0 gestellt werden soll
net spindle-sync spindle.0.index-enable => [HMOT](CARD0).encoder.04.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 => [HMOT](CARD0).stepgen.04.velocity-cmd

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

Time to create page: 0.350 seconds
Powered by Kunena Forum