how to get control panel jog buttons for X Y Z working in gmoccapy

More
22 Sep 2020 23:39 #183356 by depronman
Hi
I've very new to Linux and Linuxcnc
I got LCNC set up and have been running an Orac lathe on it using Gmoccapy for many months and am really impressed with it

Just bought a Boxford 190VMC and have got mint 19.3 and LCNC 2.8 installed and running fine, but would love to get some control panel physical buttons hooked up
I have two parallel ports installed, if I can set up the second port as 'in' then I have enough inputs to connect the XYZ buttons, ToolChange button (I want to be able to press a physical button after a tool change to make LCNC carry on executing the Gcode) an the Cycle start, step, feed hold, stop buttons

a couple of problems,
with parport 0 set to out and parport 1 set to in, using halscope I can monitor the pins on port 1 and can see the state change from red dot to yellow dot when say pin 2 is connected to ground - so I think the parport is working OK and supports 'in' mode
however in HAL when I connect say parport 0 pin10 to halui cycle start physical button the physical button works to start the gcode - great
but when I replace the pin10 with pin 2 or 02 I get a HAL error on starting LCNC stating that pin2 (or 02) does not exist, but exactly the same works if I change pin2 to pin10
Can anyone enlighten me to what I'm doing wrong please

A sample HAL file of button setup for gmoccapy would be great

Other problem I have is I need to provide a board with 'step and dir' feeds for the spindle speed control to feed into a LENZE motor driver. This is currently rigged up to a pot for manual speed control, but I want spindle speed controlled via LCNC
The LENZE needs a 0 to 10V feed to control speed, but is at about 112V with 0V in and 122V with 10V in, my BOB is capable of PWM but appears to have the 0V tied to the ground, so I am really worried bout using this to feed the LENZE as I would be applying 112V to ground.
The machine came with a small board that is power with 12V and takes in step & dir and outputs 0 to 10v, also as a relay onboard, this was feeding the LENZE under MACH3 and worked OK
So I need a way to get step and dir pulses to this board under LCNC, the question is HOW
again a sample INI and HAL file would be excellent

Thanks in anticipation for your help and hand holding of a total nubby

Cheers,
Paul
The following user(s) said Thank You: chrisfairbrothern

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

More
22 Sep 2020 23:52 #183359 by BeagleBrainz
A little old, but this thread may help for your spindle question
forum.linuxcnc.org/49-basic-configuratio...le-help-needed#18116

And this one
forum.linuxcnc.org/49-basic-configuratio...indle-step-dir#35678

If you could post your hal file & ini file that would be great. Specifically when you are having the issue.

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

More
23 Sep 2020 02:53 #183380 by newbynobi
Please start with pin10 and open Hal show, please check if pin2 does really exist, check the exact name letter by letter!

What Button connections you need?
The Hal connections to the gmoccapy Hal pins need to be done in the postgui Hal file!

Does this help?

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

More
23 Sep 2020 17:31 #183500 by depronman
I'm looking for the jogX+, jogX-, jogY+, jogY-, jogZ+, jogZ-
and a suitable button to clear the 'tool has been changed' confirmation message for the manual tool change i.e. instead of pressing the 'enter' key on the keybaord or clicking 'OK' in the message on screen

I've done th3e HAL SHOW on parport 1 set to 'in' mode, and can see all of the i/p pins changing from red to yellow when the pin is conencted to earth e.g. pin 2 is red normally, but connect pin2 to earth and it goes yellow.
This is repeated for pins 2,3,4,5,6, etc (all of the pins which are now i/p pins) and all work perfectly
But in HAL if I connect sat pin2 of parport1 to the start button LCNC will not start stating something about pin2 not being present. Now if I change pin2 to pin10 then all is OK and LCNC starts and the start button starts the gcode

This has been frustrating me for a few weeks now, I've done some reading and tried lots of things, but always with the same results
I got to thinking it was my parallel port, but I found a youtube video of someone with the exact same parallel port and he was using it in 'in' mode without a problem

hope this makes sense.
I will post my HAL and INI files later tonight and see if you guys can spot something that I have missed

ATB Paul

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

More
23 Sep 2020 17:35 #183501 by depronman
Hi
I did find these a wek or more ago and worked through them, but always got error that stopped LCNC starting.
I will post up my HAL and INI files later tonight, maybe you could advice the lines of code I need to add (or remove) for the spindle control

any help much appreciated
ATB Paul

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

More
23 Sep 2020 21:44 #183514 by depronman
here are my current HAL and INI files
hope these will help you experts to get my problems solved

cheers,
Paul

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

More
23 Sep 2020 22:12 #183517 by BeagleBrainz
Have you got any of the error details ?
When the error window pops up can you create a report file ?

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

More
23 Sep 2020 22:15 #183518 by depronman
Sorry no I havent, I did not realise that you can capture the errors.
I will have a go tomorrow evening, its too late and too cold in the garage now :)
Will report back tomorrow
Thanks
Paul

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

More
24 Sep 2020 06:29 #183551 by newbynobi
First: If you use gmoccapy, it is not recommended to use the hal Toolchane pin, but the gmoccapy ones:

remove
loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

from .hal file and place:
net tool-change gmoccapy.toolchange-change <= iocontrol.0.tool-change
net tool-changed gmoccapy.toolchange-changed <= iocontrol.0.tool-changed
net tool-prep-number gmoccapy.toolchange-number <= iocontrol.0.tool-prep-number
net tool-prep-loop iocontrol.0.tool-prepare <= iocontrol.0.tool-prepared

In your postgui.hal file. (This has nothing to do with your problem.

OK now:
The problem you are finding is not related to gmoccapy, but I will try to help you through ;-)

How you did start halshow?
Please start halshow from the running gmoccapy screen (Settings page and the the button hal show)
Post a screenshot from parport.1.pin2

Where did you tried to connect the hal pin?
It must be done in your postgui.hal file!!!!!!

So please add something like:
net    jog-x-minus    gmoccapy.jog.axis.jog-x-minus    <=    <your-hal-pin-1-connected-to-pysical-button>
net    jog-x-plus       gmoccapy.jog.axis.jog-x-plus       <=    <your-hal-pin-2-connected-to-pysical-button>

report back!

Norbert
The following user(s) said Thank You: Aciera, depronman

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

More
24 Sep 2020 20:34 #183620 by depronman
Hi Norbert,
Firstly thankyou so much for your assistance, I have made a lot of good progress tonight.
1 - I set up the tool change as you stated above, this worked perfectly, from a little reading I see that it provides information in the pop up promt tochange the tool stating information from the tool table e.g. 10mm Dia x 20mm long 3 flute EM that is much better than just insert tool 2

2 - I set up the jog buttons as you advised, I have been close to this before from some info I found on youtube, but the syntax was slightly different (maybe earlier version of gmoccapy had a different syntax) However this still didn't work, LCNC stated an error abour pin-2, I then tried pin-02 and that worked perfectly. So I now have working X- X+ Y- Y+ Z- Z+ buttons, this is excellent

3 - I already had working Cycle Start, Stop, Step, Feed Hold buttons and these are still working - this is excellent

Still to do -
I still have a three buttons / inputs available
I would like to use one of these to replicate the Enter Key to clear the tool change message and instruct the gcode to carry on execution
Is there a way to do this ?

I would also like to be able to increase and decrease the jog speed, again is there a way to do this either using buttons or better still a potentiomiter
I have a 12 position switch if this could be used great

Final urgent topic is spindle speed control - I need to get LCNC to generate step and Direction pulses for the spindle so I can feed these into an isolator board which in turn generates 0 to 10v and this is feed into the spindle controller
All of this worked under Mach3, but I've been unable to get this to work under LCNC

Can you offer any assistance with this please

Many many thanks for your assistance so far, I have made more progress over the last day than I have over the last 2 weeks

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

Moderators: newbynobiHansU
Time to create page: 0.123 seconds
Powered by Kunena Forum