Powerchuck Hal component, operates hydrualic chucks, collet closers etc.

More
15 Jan 2023 21:08 #262064 by smc.collins
simple little hal component to control  hydraulic or even a pneumatic chuck mechanism.Fairly straight forward little program, works as follows.Chuck in and chuck out should be connected to a double throw switch , this will control the locked behavior of the jaws or mechanism.CycleChuck should be hooked to a momentary footpedal switch etc this will operate the jaws or collet closer etc.Spindle brake and spindle enable need to be connected to hal signals, preferably to a feedback sensor would be best but we don't want the chuck actuating once the spindle starts up. If spindle brake is false, the chuck WILL NOT OPERATE AT ALL

here is the component, the hal and the source file Installs and builds like a regular hal component. Beats messing around with ladder logic.
Attachments:
The following user(s) said Thank You: tommylight, abdulasis12

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

More
16 Jan 2023 06:14 #262102 by smc.collins
updated this with the final version off of my machine. Added a few new features, some error checking, have fun, as stated no warranty implied given etc. code is AS IS. ADDED error checking and a way to use 1 switch to control direction with 1 input. it's all in the hal file
Attachments:
The following user(s) said Thank You: ChironFZ16, abdulasis12

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

More
08 Jan 2024 08:56 - 08 Jan 2024 09:05 #290191 by abdulasis12
Hi MR. smc.collins
I'm read and think your share file .comp maybe can use with my Lathe cnc too.
I want same safty for when run spindle , chuck must Interlock ,not respond any signal and foot switch too.
Now I Download your Comp and complie to my Linuxcnc done.
I try open hall show and  show

signal spindle-brake
signal spindle-enable

and list your signal Powerchuck signal
ChuckIn
ChuckOut
.
.
.
SpindleBrake
SpindleEnable

I try MDI
M3 S200

spindle-enable  change to 1   but  SpindleEnable  from your component not change from 0 to 1 . 
I must go to link something to your signal first ?
Please example some code for connect signal  I'm newbie for linuxcnc .
Below I show some picture 

Thank you.
Asis,  

[size=85]# Generated by PNCconf at Thu Jan  4 13:13:52 2024
# Using LinuxCNC version:  Master (2.9)
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt [KINS]KINEMATICS
loadrt hm2_eth board_ip="10.10.10.10" config="num_encoders=1 num_pwmgens=1 num_stepgens=5 sserial_port_0=0xxxxxxx" 
setp    hm2_7i96s.0.pwmgen.pwm_frequency 20000
setp    hm2_7i96s.0.pwmgen.pdm_frequency 6000000
setp    hm2_7i96s.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.z,pid.s
loadrt powerchuck




addf hm2_7i96s.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf hm2_7i96s.0.write         servo-thread
addf powerchuck   servo-thread





net ChuckIn powerchuck.ChuckIn #inputs to set DEFUALT CHUCK BEHAVIOR , connect to double pole switch with chuck out so it forces a binary behavior !!!! 
net ChuckOut  powerchuck.ChuckOut #these 2 parameters block each other. use the cyclechuck input to actuate the jaws


net CycleChuck   powerchuck.CycleChuck                     #input to cycle chuck in either direction relative to current state connect to momentary footswitch or other input command to cycle jaws



net SpindleEnable  powerchuck.SpindleEnable                        # Must be false to allow change in mode or state connect these to HAL IO pins etc. 
net SpindleBrake   powerchuck.SpindleBrake                       # Must be true to allow change in mode or state

net ChuckSolenoid powerchuck.ChuckSolenoid    #output to solenoid to open chuck jaws, defualt behavior is for jaws to be closed use invert pin functions in hal if you need to flop this around 

net SingleSwitch        powerchuck.SingleSwitch                # open is in, closed is out or invert your solenoids and switches as you see fit
net SingleSwitchEnable  powerchuck.SingleSwitchEnable           # use setp command to make this true of false, default is false, if you want to use 1 switch to set chuck holdingin or out

#net ChuckSolenoidFlag                               ##############  these are just signals you can watch to see if your inputs and outputs are working. 
#net CycleChuckFlag
#net ChuckInFlag
#net ChuckOutFlag







setp hm2_7i96s.0.dpll.01.timer-us -50
setp hm2_7i96s.0.stepgen.timer-number 1

# external output signals

# --- SPINDLE-ENABLE ---
net spindle-enable  =>     hm2_7i96s.0.ssr.00.out-00
setp    hm2_7i96s.0.pwmgen.pwm_frequency 20000
setp    hm2_7i96s.0.pwmgen.pdm_frequency 6000000
setp    hm2_7i96s.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.z,pid.s
loadrt powerchuck




addf hm2_7i96s.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf hm2_7i96s.0.write         servo-thread
addf powerchuck   servo-thread





net ChuckIn powerchuck.ChuckIn #inputs to set DEFUALT CHUCK BEHAVIOR , connect to double pole switch with chuck out so it forces a binary behavior !!!! 
net ChuckOut  powerchuck.ChuckOut #these 2 parameters block each other. use the cyclechuck input to actuate the jaws


net CycleChuck   powerchuck.CycleChuck                     #input to cycle chuck in either direction relative to current state connect to momentary footswitch or other input command to cycle jaws



net SpindleEnable  powerchuck.SpindleEnable                        # Must be false to allow change in mode or state connect these to HAL IO pins etc. 
net SpindleBrake   powerchuck.SpindleBrake                       # Must be true to allow change in mode or state

net ChuckSolenoid powerchuck.ChuckSolenoid    #output to solenoid to open chuck jaws, defualt behavior is for jaws to be closed use invert pin functions in hal if you need to flop this around 

net SingleSwitch        powerchuck.SingleSwitch                # open is in, closed is out or invert your solenoids and switches as you see fit
net SingleSwitchEnable  powerchuck.SingleSwitchEnable           # use setp command to make this true of false, default is false, if you want to use 1 switch to set chuck holdingin or out

#net ChuckSolenoidFlag                               ##############  these are just signals you can watch to see if your inputs and outputs are working. 
#net CycleChuckFlag
#net ChuckInFlag
#net ChuckOutFlag







setp hm2_7i96s.0.dpll.01.timer-us -50
setp hm2_7i96s.0.stepgen.timer-number 1

# external output signals

# --- SPINDLE-ENABLE ---
net spindle-enable  =>     hm2_7i96s.0.ssr.00.out-00

# motion controller IO:
net tool-change-confirmed motion.digital-out-00 => iocontrol.0.tool-changed
[/size]

 

 
Attachments:
Last edit: 08 Jan 2024 09:05 by abdulasis12.

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

More
10 Jan 2024 03:17 #290323 by smc.collins
The source code is heavily commented to explicitly explain how it works, I'm not sure i understand your question. Can you take a short video and walk me through your probem ???
The following user(s) said Thank You: abdulasis12

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

More
10 Jan 2024 17:50 - 10 Jan 2024 18:11 #290387 by abdulasis12

The source code is heavily commented to explicitly explain how it works, I'm not sure i understand your question. Can you take a short video and walk me through your probem ??? 

Hi,
Thank you for respond my question. ^^"

Okay  , now I renew about hall 

I use your powerchuck.hal  , I put  it's into folder .

I add   HALFILE = powerchuck.hal    in .ini file.

I  # 4 lines  below in powerchuck.hal   file.

#net ChuckSolenoidFlag  
#net CycleChuckFlag
#net ChuckInFlag
#net ChuckOutFlag

then details in my clip
CLIP Youtube

My question is:
What more for config to use your powerchuck.hal ?
How to link Signal input from switch to your variable signal ?
Can show some example code ? maybe I can Easier to understand ^^" .

Thank you
Asis,

 

 
Attachments:
Last edit: 10 Jan 2024 18:11 by abdulasis12.

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

More
15 Jan 2024 10:24 #290748 by abdulasis12

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

More
16 Jan 2024 03:14 - 16 Jan 2024 03:19 #290827 by smc.collins
it's been -4 F here for 3 days, I haven't been able to power up the lathe. Put powerchuck in the main hal file mazak.hal, and put those 4 lines in that mazak.hal file as well, load the component in the mazak.hal file as well. I didn't design this to get the signal outside of the main hal file. you'll also have to connect the spindle enable to the spindle.ena , spindlebrake to spindle brake signal etc. You will obviously connect your footswitch to the 7i77 input pins and it you have you want to reverse the grip of the chuck , you'll need to add wiring for the  ID OD grip settings  IIRC and I haven't looked at the source recently, the pin routes through the powerchuck hal component. 

these all go in you mylinuxmachine.hal file if you catch my drift. 
Last edit: 16 Jan 2024 03:19 by smc.collins.
The following user(s) said Thank You: abdulasis12

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

More
23 Jan 2024 16:14 #291434 by abdulasis12

it's been -4 F here for 3 days, I haven't been able to power up the lathe. Put powerchuck in the main hal file mazak.hal, and put those 4 lines in that mazak.hal file as well, load the component in the mazak.hal file as well. I didn't design this to get the signal outside of the main hal file. you'll also have to connect the spindle enable to the spindle.ena , spindlebrake to spindle brake signal etc. You will obviously connect your footswitch to the 7i77 input pins and it you have you want to reverse the grip of the chuck , you'll need to add wiring for the  ID OD grip settings  IIRC and I haven't looked at the source recently, the pin routes through the powerchuck hal component. 

these all go in you mylinuxmachine.hal file if you catch my drift. 

thank you MR.smc.collins
I try change
net SpindleEnable
to
net spindle-enable
now it's can link signal  and change other net too.
youe powerchuck.comp good for my CNCLathe  I edit some and cut some function now working with my cnc
Thank you. ^^"
 
The following user(s) said Thank You: smc.collins

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

More
23 Jan 2024 19:30 #291452 by smc.collins
I'm glad it was useful, there's a v2 design but it's actually integrated into spindle , and it does a lot more.
The following user(s) said Thank You: abdulasis12

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

Time to create page: 0.222 seconds
Powered by Kunena Forum