Pressbrake CNC Control Setup Questions

More
01 Apr 2021 16:38 #204402 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

This browser does not support PDFs. Please download the PDF to view it: Download PDF


This browser does not support PDFs. Please download the PDF to view it: Download PDF

Attachments:

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

More
01 Apr 2021 17:49 #204408 by andypugh
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.

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

More
01 Apr 2021 17:57 #204410 by andypugh
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.

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

More
01 Apr 2021 18:13 #204412 by EW_CNC
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.

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

More
01 Apr 2021 19:59 #204422 by andypugh
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)
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.

More
01 Apr 2021 20:11 #204423 by andypugh
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.

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

More
01 Apr 2021 22:36 #204445 by andypugh
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.
sudo apt-get install glade-gtk2
should install it for you.

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

More
01 Apr 2021 23:42 #204450 by EW_CNC
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.

File Attachment:

File Name: tb2_2021-04-01.hal
File Size:8 KB

File Attachment:

File Name: post_gui_2...4-01.hal
File Size:2 KB

File Attachment:

File Name: handlers_2...04-01.py
File Size:1 KB

File Attachment:

File Name: tb2.txt
File Size:0 KB

File Attachment:

File Name: tb2_2021-04-01.py
File Size:1 KB

File Attachment:

File Name: gvcp-panel...04-01.ui
File Size:81 KB

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

More
02 Apr 2021 12:07 #204487 by andypugh
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.
halrun
loadusr gladevcp -u handlers.py panel.ui
Attachments:

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

More
02 Apr 2021 12:11 #204488 by andypugh

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.

Moderators: cncbasher
Time to create page: 0.102 seconds
Powered by Kunena Forum