2-speed spindle configuration - help

More
11 Apr 2021 08:23 #205611 by endian
Andy for first I want to thank you for contributing on solution of my problem... a lot of ways to solve that.

I too young and stupid to try to trust anybody, directly me absolutely not. there we have Murphy´s laws and that says, "Anything that can go wrong will go wrong". -- and for this purpose I want to double check safety and functionality of all my devices.

Most pretty way is still gearchange.comp which grab information from .hal, when you want to turn on spindle. I will create custom .hal pin of CSS status as you described here :

If you want the mode as a HAL pin, then you can probably use Gstat to create it, see the first example here:
linuxcnc.org/docs/2.8/html/gui/GStat.html
And the "css-mode"callback.

directly by the first examle what is right that what I will need. I will create somethink like this :
#!/usr/bin/env python

import hal
from hal_glib import GStat
import gobject
GSTAT = GStat()

# callback to change HAL pin state
def mode_changed(obj, data):
        h['g97'] = not data
        h['g96'] = data

# Make a component and pins
h = hal.component("css_status")
h.newpin("g97", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("g96", hal.HAL_BIT, hal.HAL_OUT)
h.ready()

# connect a GSTAT message to a callback function
GSTAT.connect("css_changed",mode_changed)

# force GSTAT to initialize states
GSTAT.forced_update()

# loop till exit
try:
        gobject.MainLoop().run()
except KeyboardInterrupt:
        raise SystemExit

I will add them to .hal like custom python script as file like:
loadusr python -Wn css_status PATH-TO-FILE/my_custom_css_status.py
In this way it will be created after all other pins were created?

and "pins" from custom component "css_status" I will "net" with custom "pins" of gearchange component for reading actual status. I will have everything what need to change in one place with nice and clear overview.

next steps will be to create alarm messages for alert me or whoever will run machine: you have wrong gear, program will stop.

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

More
13 Jul 2024 05:30 #305049 by vre
What is the difference between gearchange and gearchoise hal components?
My mill has 2 gear positions(low-high) enabled by solenoid valve and 2 sensors for 2 positions which hal component must use?

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

More
13 Jul 2024 08:43 #305057 by endian
hello,

I do not know, but I did my custom component and overwrite the gearchange.comp as my choise because of my lathe setup... I need a little bit more stuff to control

I think a default gearchange.comp from andy will be helpfull for you, because it solve all the stuff but no CSS .. I need them for my setup therefore I did customization...

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

More
13 Jul 2024 10:44 #305064 by andypugh
gearchange.comp just picks a gear and sticks with it until the spindle is turned off again.

gearchoice.comp is more meant for lathes with CSS and will attempt to do a gear shift with the spindle still moving, but only during a G0 move. (and then the LinuxCNC system will wait for spindle-at-speed)

It's rather like a skilled driver with a crash gearbox, you can match the shaft speeds and make a seamless shift with everything still in motion.

Here it is in action:


The upshift problem is something that we see with the 1916 fire engine that I drive when going up hills, the engine (motor) speed falls more slowly than the vehicle (spindle) speed and the shaft speeds fail to converge until both have stopped.
In the case of my lathe, I need to fit a braking resistor and increase the spindle deceleration rate, but to do that means pulling the lathe way from the wall to remove the back cover.
The following user(s) said Thank You: tommylight

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

More
15 Jul 2024 06:39 #305202 by vre
I don't want change gear when spindle is run so gearchange.
How can block spindle from rotating when hydraulic tool holder cluch is open?
Does this done automatically by iocontrol v2 ?

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

More
15 Jul 2024 06:50 - 15 Jul 2024 06:51 #305204 by Aciera

How can block spindle from rotating when hydraulic tool holder cluch is open?


Try:
spindle.M.inhibit IN BIT

When TRUE, the spindle speed is set and held to 0.
linuxcnc.org/docs/2.9/html/man/man9/motion.9.html#MOTION%20PINS
Last edit: 15 Jul 2024 06:51 by Aciera.

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

Time to create page: 0.373 seconds
Powered by Kunena Forum