Spindle ccw hanging

More
11 Mar 2019 01:12 - 12 Mar 2019 00:10 #128279 by biqut2
SOLUTION:
A minimum speed was configured in my .pref file as follows

spindle_bar_min = 550

changing this to the following corrected all of the issues and everything works as expected:

spindle_bar_min = -3800.0

I may be just overlooking something really simple here. Spindle control going in the cw direction works fine, comes on when I click the button in gmoccapy and turns off when I click it again. The ccw direction however doesn't work at all. Furthermore, if I try to run the spindle in the ccw direction first it seems to hang and neither direction will work at that point until I restart linuxcnc. I have been watching the hal status and everything toggles and changes just like the cw direction except hm2_5i25.0.gpio.029.out. I can disconnect the net spindle-ccw hm2_5i25.0.gpio.029.out and do setp hm2_5i25.0.gpio.029.out 1 and the output works just fine, just doesn't work from gmoccapy when I click the button. Here is what I have in my hal:

# --- SPINDLE-CW ---
setp hm2_5i25.0.gpio.028.is_output 1
setp hm2_5i25.0.gpio.028.invert_output 1
net spindle-cw hm2_5i25.0.gpio.028.out

# --- SPINDLE-CCW ---
setp hm2_5i25.0.gpio.029.is_output 1
setp hm2_5i25.0.gpio.029.invert_output 1
net spindle-ccw hm2_5i25.0.gpio.029.out

# ---setup spindle control signals---

net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-vel-cmd-rpm <= motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-enable <= motion.spindle-on
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-brake <= motion.spindle-brake
net spindle-revs => motion.spindle-revs
net spindle-at-speed => motion.spindle-at-speed
net spindle-vel-fb-rps => motion.spindle-speed-in
net spindle-index-enable <=> motion.spindle-index-enable

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

sets spindle-at-speed true
Last edit: 12 Mar 2019 00:10 by biqut2.

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

More
11 Mar 2019 07:05 #128293 by pl7i92
Replied by pl7i92 on topic Spindle ccw hanging
Hi
what VFD is it

Then the out signals shoudt be set beond the NET loaded
so
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-vel-cmd-rpm <= motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-enable <= motion.spindle-on
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-brake <= motion.spindle-brake
net spindle-revs => motion.spindle-revs
net spindle-at-speed => motion.spindle-at-speed
net spindle-vel-fb-rps => motion.spindle-speed-in
net spindle-index-enable <=> motion.spindle-index-enable

# ---Setup spindle at speed signals---
#sets spindle-at-speed true

# --- SPINDLE-CW ---
setp hm2_5i25.0.gpio.028.is_output 1
setp hm2_5i25.0.gpio.028.invert_output 1
net spindle-cw hm2_5i25.0.gpio.028.out

# --- SPINDLE-CCW ---
setp hm2_5i25.0.gpio.029.is_output 1
setp hm2_5i25.0.gpio.029.invert_output 1
net spindle-ccw hm2_5i25.0.gpio.029.out

IS the VFD set to FORWARD REVERSE by parameter
is the VFD made to take forward Rev change without a Stop signal present

CAN the VFD take the Rev signal while speed is not zero
Most got also a sequ of signal folowing to get reverse

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

More
11 Mar 2019 10:36 #128303 by biqut2
Replied by biqut2 on topic Spindle ccw hanging
It is a hy vfd and yes it is setup properly. As stated I can manually turn the outputs on via Hal commands and everything works fine, its the button in gmoccapy that doesn't seem to be working properly.

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

More
11 Mar 2019 13:32 #128331 by andypugh
Replied by andypugh on topic Spindle ccw hanging
check with halmeter, does the spindle-ccw signal change state when you select reverse?

Some VFDs need spindle-on for FWD and spindle-on + reverse for REV.
Is it possible that this is what you enabled with manual HAL?

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

More
11 Mar 2019 14:11 #128346 by biqut2
Replied by biqut2 on topic Spindle ccw hanging
setp hm2_5i25.0.gpio.029.out 1

That is the Hal command I manually input. As long as the outputs go low the vfd and spindle behave appropriately. When I click or touch the CW button in gmoccapy it turns green and the spindle turns on. When I click or touch the CCW button in gmoccapy it turns green, halshow shows all of the relevant signals changing state except for hm2_5i25.0.gpio.029.out. The only way to get that output to pull low is the manual entry of the Hal command. Also halshow does confirm that there is a net between hm2_5i25.0.gpio.029.out and spindle-ccw. Maybe I'm not explaining properly, I can take some screenshots/pictures when I get back in the shop tonight.

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

More
11 Mar 2019 14:16 #128348 by biqut2
Replied by biqut2 on topic Spindle ccw hanging
Also after I click or touch the CCW button in gmoccapy the CW button stops working too.

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

More
11 Mar 2019 17:45 #128360 by newbynobi
Replied by newbynobi on topic Spindle ccw hanging
Sorry for telling you, but you hal file is a mess ;-)

a net signal consist of three parts

net <signalname> <hal_pin> <= <hal_pin>

In your case, I do not see the signal names, so the first entry will be taken as signal name!

Please try the following:
- go to settings page
- open hal_show
- Click the whatch tab
- add the following pin to whatch page
* spindle.0.on
* spindle.0.forward
* spindle.0.reverse
* spindle.0.speed-in
* spindle.0.speed-out

Leave the page visible and open and try the forward button, spindle.0.on
* spindle.0.forward
* spindle.0.speed-in
* spindle.0.speed-out
should change their values

now press stop,
all go to off and values zero

now press reverse:
* spindle.0.on
* spindle.0.reverse
* spindle.0.speed-in
* spindle.0.speed-out

The values do change?

report about the results!

Norbert

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

More
11 Mar 2019 18:01 - 11 Mar 2019 18:09 #128362 by newbynobi
Replied by newbynobi on topic Spindle ccw hanging
I can not find any speed output to your VFD in you hal, there should be something like:
net spindle-vel-cmd   hm2_7i80.0.pwmgen.03.value     <=    motion.spindle.0.speed-out

I am using the master pin names, yours may vary a little bit.

Norbert

This is a very simple spindle control with PWM and parport:
#############################################
# Spindelsteuerung mit Pulsweitenmodulation #
#        es gibt 3 Typen, 0, 1 , 2          #
# Hierbei ist 1 der Typ mit Richtungssignal #
#           PWM Spindle Control             #
#            there are 3 types              #
#     beeing 1 with direction signal        #
#############################################

loadrt pwmgen output_type=1
addf pwmgen.make-pulses base-thread
addf pwmgen.update servo-thread

# Basis Frequenz / base frequenz
setp pwmgen.0.pwm-freq 100

# max Drehzahl / max revolutions
setp pwmgen.0.scale 5000

net spindle-cmd     motion.spindle-speed-out   <=   pwmgen.0.value
net spindle-enable  motion.spindle-on          =>   pwmgen.0.enable
net spindle-pwm     pwmgen.0.pwm               =>   parport.0.pin-02-out
net spindle-cw      motion.spindle-forward     =>   parport.0.pin-01-out
net spindle-ccw     motion.spindle-reverse     =>   parport.0.pin-04-out
Last edit: 11 Mar 2019 18:09 by newbynobi.

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

More
11 Mar 2019 18:29 #128367 by Mike_Eitel
Replied by Mike_Eitel on topic Spindle ccw hanging
Additional info I found on my Huanyang.
When you want to reverse, you must have the run signal go low for a short time. Otherwise direction is not reacting on the input.
Mike

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

More
11 Mar 2019 22:15 #128386 by biqut2
Replied by biqut2 on topic Spindle ccw hanging

Sorry for telling you, but you hal file is a mess ;-)

I can't take all the credit:
# Generated by PNCconf at Sun Dec 31 20:00:49 2006
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

a net signal consist of three parts

net <signalname> <hal_pin> <= <hal_pin>

In your case, I do not see the signal names, so the first entry will be taken as signal name!

Please try the following:
- go to settings page
- open hal_show
- Click the whatch tab
- add the following pin to whatch page
* spindle.0.on
* spindle.0.forward
* spindle.0.reverse
* spindle.0.speed-in
* spindle.0.speed-out

Leave the page visible and open and try the forward button, spindle.0.on
* spindle.0.forward
* spindle.0.speed-in
* spindle.0.speed-out
should change their values

now press stop,
all go to off and values zero

now press reverse:
* spindle.0.on
* spindle.0.reverse
* spindle.0.speed-in
* spindle.0.speed-out

The values do change?

report about the results!

Norbert


I don't have those exact signal in my hal tree, however I do have the following:

First screen shot is after starting up linuxcnc


Second is with CW button depressed, the output changes state and the spindle and vfd respond accordingly


Third is with the CCW button depressed, nothing seems to work


Fourth shows the net in hal


I could take a screen shot but it wouldn't show anything, after trying the ccw button the cw button stops working and just flashes green and then turns itself off and wont work. Hopefully this will clear some things up, thank you in advance for the assistance. Also one last thought, the vfd doesn't control the spindle speed, The spindle has a gearbox on it and it is controlled independently of the vfd.
Attachments:

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

Moderators: newbynobiHansU
Time to create page: 0.136 seconds
Powered by Kunena Forum