Pressbrake CNC Control Setup Questions
- EW_CNC
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 107
- Thank you received: 24
01 Apr 2021 16:38 #204402
by EW_CNC
Pressbrake CNC Control Setup Questions was created by EW_CNC
Hi,
I’m working at replacing a cnc pressbrake controller with Linuxcnc 2.9 and Mesa 7i97.
I have the hydraulic directional servo valve working to jog the ram up and down. Now my next step is to setup the control to run the ram with the foot pedal and hand controls. I have played around with using mdi commands with g code sub programs, but that approach doesn’t seem to give me the type of control I’m looking for.
Should I be doing everything in .hal? I keep thinking if I could somehow use some of the QtPlasmaC configuration with the setup. For instance if I could save the return position, the deceleration position, and the down limit variables in a selectable file like the material file in QtPlasmaC. Does anyone have some ideas to turn me in the right direction?
The function of the foot pedal is: Press pedal down and activate input 6. Ram moves down at rapid velocity towards Y-6. At deceleration position, the ram slows down to bending velocity and continues towards down limit and stops motion. At any time the pedal is released it activates input 7 which initiates a move toward return position. Return position, deceleration position, and down limit need to be adjustable positions. I attached the ram axis movement and position drawing, and also the pedestal wiring diagram.
Thanks,
Earl W
I’m working at replacing a cnc pressbrake controller with Linuxcnc 2.9 and Mesa 7i97.
I have the hydraulic directional servo valve working to jog the ram up and down. Now my next step is to setup the control to run the ram with the foot pedal and hand controls. I have played around with using mdi commands with g code sub programs, but that approach doesn’t seem to give me the type of control I’m looking for.
Should I be doing everything in .hal? I keep thinking if I could somehow use some of the QtPlasmaC configuration with the setup. For instance if I could save the return position, the deceleration position, and the down limit variables in a selectable file like the material file in QtPlasmaC. Does anyone have some ideas to turn me in the right direction?
The function of the foot pedal is: Press pedal down and activate input 6. Ram moves down at rapid velocity towards Y-6. At deceleration position, the ram slows down to bending velocity and continues towards down limit and stops motion. At any time the pedal is released it activates input 7 which initiates a move toward return position. Return position, deceleration position, and down limit need to be adjustable positions. I attached the ram axis movement and position drawing, and also the pedestal wiring diagram.
Thanks,
Earl W
Attachments:
Please Log in or Create an account to join the conversation.
- andypugh
- Away
- Moderator
Less
More
- Posts: 23561
- Thank you received: 4859
01 Apr 2021 17:49 #204408
by andypugh
Replied by andypugh on topic Pressbrake CNC Control Setup Questions
Did you see forum.linuxcnc.org/38-general-linuxcnc-q...ideas?start=10#82686 ?
That is a (very) basic start at a bender-specific UI and system.
It uses the Touchy GUI, but rather than running G-code it takes parameters from a table.
The UI calls a handler file (bender.py) and then that creates and MDI call to an NGC routine (bender.ngc) than moves the brake in the required way.
It's not finished, it was a proof of concept idea. But it's a starting point.
That is a (very) basic start at a bender-specific UI and system.
It uses the Touchy GUI, but rather than running G-code it takes parameters from a table.
The UI calls a handler file (bender.py) and then that creates and MDI call to an NGC routine (bender.ngc) than moves the brake in the required way.
It's not finished, it was a proof of concept idea. But it's a starting point.
Please Log in or Create an account to join the conversation.
- andypugh
- Away
- Moderator
Less
More
- Posts: 23561
- Thank you received: 4859
01 Apr 2021 17:57 #204410
by andypugh
Replied by andypugh on topic Pressbrake CNC Control Setup Questions
To answer another question: Yes I think you should be doing much of the control in realtime and in HAL.
You certainly want to be monitoring the foot-switch in HAL, to guarantee a prompt response. Possibly you want a dedicated HAL component for ram control. (That is certainly how I would do it. It should be quite simple, and as it is simple, it is easier to trust)
I would start with a custom component that takes home, bend and finish positions as inputs along with the foot switch and safety curtain (or whatever). The output could either be a static position fed to a limit3 component, or the velocity/accel control could be handled internally.
If using a limit3 the outputs would be target, current accel and current velocity.
I can help with the HAL component.
You certainly want to be monitoring the foot-switch in HAL, to guarantee a prompt response. Possibly you want a dedicated HAL component for ram control. (That is certainly how I would do it. It should be quite simple, and as it is simple, it is easier to trust)
I would start with a custom component that takes home, bend and finish positions as inputs along with the foot switch and safety curtain (or whatever). The output could either be a static position fed to a limit3 component, or the velocity/accel control could be handled internally.
If using a limit3 the outputs would be target, current accel and current velocity.
I can help with the HAL component.
Please Log in or Create an account to join the conversation.
- EW_CNC
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 107
- Thank you received: 24
01 Apr 2021 18:13 #204412
by EW_CNC
Replied by EW_CNC on topic Pressbrake CNC Control Setup Questions
Andy,
Yes, I have seen your bender setup.
I like your idea of a custom HAL component. I should be able to handle the HAL end of it, but I sure would appreciate your help with programming the component.
Yes, I have seen your bender setup.
I like your idea of a custom HAL component. I should be able to handle the HAL end of it, but I sure would appreciate your help with programming the component.
Please Log in or Create an account to join the conversation.
- andypugh
- Away
- Moderator
Less
More
- Posts: 23561
- Thank you received: 4859
01 Apr 2021 19:59 #204422
by andypugh
Replied by andypugh on topic Pressbrake CNC Control Setup Questions
If you have the bender config downloaded to a LinuxCNC machine, then you can run that simple UI standalone (though it doesn't do very much without the rest of LinuxCNC to handle MDI commands as things stand)
The HAL for a hal-only config would look like:
loadusr UI
loadrt pid
loadrt limit3
loadrt magic_hal_component
addf {them all}
net pins-from-ui => pins-into-new-component
net pins out-of-new-comp => limit3.0
net limit3.0 => pid.0
net pid.0 => control-of-your-hardware
cd ~/Downloads/Bender
halrun
loadusr gladevcp -u bender.py bender.ui
The HAL for a hal-only config would look like:
loadusr UI
loadrt pid
loadrt limit3
loadrt magic_hal_component
addf {them all}
net pins-from-ui => pins-into-new-component
net pins out-of-new-comp => limit3.0
net limit3.0 => pid.0
net pid.0 => control-of-your-hardware
Please Log in or Create an account to join the conversation.
- andypugh
- Away
- Moderator
Less
More
- Posts: 23561
- Thank you received: 4859
01 Apr 2021 20:11 #204423
by andypugh
Replied by andypugh on topic Pressbrake CNC Control Setup Questions
Thinking about this some more:
If you use a custom HAL component then there is no need for G-code, so your UI can run standalone, rather than inside an existing GUI.
There might still be enough reason to use a GUI, probably something customisable like Gscreen, stripped of the irrelevant parts. This would be to get things like on/off control mainly.
If you use a custom HAL component then there is no need for G-code, so your UI can run standalone, rather than inside an existing GUI.
There might still be enough reason to use a GUI, probably something customisable like Gscreen, stripped of the irrelevant parts. This would be to get things like on/off control mainly.
Please Log in or Create an account to join the conversation.
- andypugh
- Away
- Moderator
Less
More
- Posts: 23561
- Thank you received: 4859
01 Apr 2021 22:36 #204445
by andypugh
Replied by andypugh on topic Pressbrake CNC Control Setup Questions
If you want to edit the glade gui (and, actually, I wouldn't, it would be better to start fresh with something a little less flaky) then you need the Glade editor. LinuxCNC requires a specific version, that we offer via the LinuxCNC servers.
should install it for you.
sudo apt-get install glade-gtk2
Please Log in or Create an account to join the conversation.
- EW_CNC
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 107
- Thank you received: 24
01 Apr 2021 23:42 #204450
by EW_CNC
Replied by EW_CNC on topic Pressbrake CNC Control Setup Questions
I am using a tubing bender with a standalone glade gui. Maybe I could use it as a starting point with a custom HAL component. I would like to be able to save the return position, deceleration position, and down limit selector like plasmaC has for its material settings. What are the pros and cons of Glade vs QtVCP?
Attached my tubing bender files.
Attached my tubing bender files.
Please Log in or Create an account to join the conversation.
- andypugh
- Away
- Moderator
Less
More
- Posts: 23561
- Thank you received: 4859
02 Apr 2021 12:07 #204487
by andypugh
Replied by andypugh on topic Pressbrake CNC Control Setup Questions
Does that UI work? It looks like it is only partially set up, but perhaps I am missing things. (I can't easily trial-run your config without the Mesa cards, so this is based on looking at the UI And handlers)
I had actually forgotten that HAL_Spinbox (etc) create HAL pins. That would be a very easy way to get basic functionality.
I feel that this sort of thing should be table-driven, with a set of backstop positions and bend positions. To do that there needs to be a way for the handler code to either change the value in the spinbox (which is probably a good way to give a visual check for the operator) or to have separate hal pins created by the handler for its own use.
I feel that saving and loading bend tables as files should be possible too.
But, as an initial experiment, A UI with spinbuttons to provide positions and speeds should work.
For reference, it is pretty easy to add "private" HAL pins to a python handler file. This is documented here
linuxcnc.org/docs/2.8/html/hal/halmodule.html
Attached is a version of your handler.py that does this. I have linked your next/previous buttons in the second tab to them.
I had actually forgotten that HAL_Spinbox (etc) create HAL pins. That would be a very easy way to get basic functionality.
I feel that this sort of thing should be table-driven, with a set of backstop positions and bend positions. To do that there needs to be a way for the handler code to either change the value in the spinbox (which is probably a good way to give a visual check for the operator) or to have separate hal pins created by the handler for its own use.
I feel that saving and loading bend tables as files should be possible too.
But, as an initial experiment, A UI with spinbuttons to provide positions and speeds should work.
For reference, it is pretty easy to add "private" HAL pins to a python handler file. This is documented here
linuxcnc.org/docs/2.8/html/hal/halmodule.html
Attached is a version of your handler.py that does this. I have linked your next/previous buttons in the second tab to them.
halrun
loadusr gladevcp -u handlers.py panel.ui
Please Log in or Create an account to join the conversation.
- andypugh
- Away
- Moderator
Less
More
- Posts: 23561
- Thank you received: 4859
02 Apr 2021 12:11 #204488
by andypugh
And a different way here:
linuxcnc.org/docs/2.8/html/gui/gladevcp....evcp:adding-hal-pins
I am not sure under what circumstances one would prefer one over the other.
Replied by andypugh on topic Pressbrake CNC Control Setup Questions
For reference, it is pretty easy to add "private" HAL pins to a python handler file. This is documented here
linuxcnc.org/docs/2.8/html/hal/halmodule.html
And a different way here:
linuxcnc.org/docs/2.8/html/gui/gladevcp....evcp:adding-hal-pins
I am not sure under what circumstances one would prefer one over the other.
Please Log in or Create an account to join the conversation.
Time to create page: 0.102 seconds