random behavior when using pyVCP buttons

More
06 Oct 2016 17:35 #81308 by SenorAguas
Hi Guys, I have a machine that is used basically in manual mode with a few pyVCP buttons to move to specific coordinates. Its an oddball setup--the operator uses custom pyVCP MDI buttons to move to a set of coordinates, then fine tunes the location with the jog keys.

When you click one of these pyVCP buttons, Axis will switch to the MDI tab to execute the MDI code, then back to the Manual Control tab. But occasionally (seemingly random), it will stay focused on the MDI tab instead of going back to the Manual Control tab.

The issue with this is that the jog keys do not work when the MDI tab is selected. So the operator can't fine tune the location without selecting the Manual Control tab or pressing F3.

Do any of you see a work around to make sure it always goes back to the manual control tab?

Could I remove the MDI tab? Would the MDI commands still work?

The only work around I see right now is to make a pyVCP panel with up/down/left/right jog buttons built into it. This would work, but Id rather the operators be able to use the jog keys. There's a lot of button pressing in this process right now until our fully automated (expensive) vision welding system gets here..

In case you are curious, this is a laser spot welder with a camera and cross hairs for the operator. It is spot welding tiny wires that aren't always in the exact same location (hence the need for fine tuning locations).
Attachments:

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

More
06 Oct 2016 23:06 #81318 by SenorAguas
I guess I should clarify the issue. The operator is having to weld 84 spots per part, with each of them needing to be in position down to around 0.02mm with relation to the wire, which has more positional tolerance than that. The right way to do project is with a vision system that finds each wire and positions to it, which we are working on, but for now, my pyVCP MDI buttons get her very close, and then she jogs it into position if needed.

Having to change that tab back to manual control occasionally (1 out of 5 button clicks maybe) is a big annoyance.

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

More
07 Oct 2016 14:43 #81347 by andypugh
What do the MDI_COMMANDS do? (Assuming that is what you are doing)

You might get better results using GladeVCP and embedded Python using the Python interface:
linuxcnc.org/docs/2.7/html/config/python-interface.html

ie, make a button with an on_clicked callback of (say) do_command_1 and then:
import linuxcnc
c = linuxcnc.command()
s = linuxcnc.stat()

def ok_for_mdi():
        s.poll()
        return not s.estop and s.enabled and s.homed and (s.interp_state == linuxcnc.INTERP_IDLE)

def do_command_1(self, obj, data=None)
    if ok_for_mdi():
            old_mode = s.task_mode()
            c.mode(linuxcnc.MODE_MDI)
            c.wait_complete() # wait until mode switch executed
            c.mdi("G0 X10 Y20 Z30")
            c.mode(old_mode)

Some development work will be needed to make this work.

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

More
07 Oct 2016 19:26 #81356 by SenorAguas
Thanks for the reply. I'll have to learn some GladVCP and Python sometime...

My MDI commands just send the machine to a position (example G90 G0 X10 Y20 Z30)--either absolute coordinates or a relative move. My jog workaround was to make a pyVCP panel that has "jog" buttons built in. I just programmed up, down, left, right buttons to relatively move 0.02mm per click. This seems to be working well.

Its now a table based button layout with 27 buttons to allow them to move to 84 different weld locations and fine tune each if needed before welding. A GladeVCP GUI would be much better, but this is a very temporary machine and I don't have the time to learn the programming. I've started the tutorial and would like to learn it some time though.

Now, if I could only get my touchscreen working so they don't have to use a mouse. Its a Superlogics display. Based on a lsusb command, it looks to be an eGalax touchscreen. Its plug and play on Ubuntu, but I can't get it to work on LinuxCNC. The company wasn't much help at all.

I even started fresh with Ubuntu and tried to install LinuxCNC, but failed there too with the rtai kernel.

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

More
07 Oct 2016 19:55 #81358 by andypugh

Now, if I could only get my touchscreen working so they don't have to use a mouse. Its a Superlogics display. Based on a lsusb command, it looks to be an eGalax touchscreen. Its plug and play on Ubuntu, but I can't get it to work on LinuxCNC. .


I have a couple of them working with LinuxCNC.

You might have to download a driver: www.eeti.com.tw/drivers_Linux.html

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

Time to create page: 0.075 seconds
Powered by Kunena Forum