Page 1 of 1

spindle reverse button issues

Posted: Wed Nov 25, 2020 9:38 pm
by galyion
I just updated my lathe to the newest cnc12. didnt go very smoothly but i was able to get everything to work. only issue im having is on the vcp the spindle reverse button acts like a momentary switch. my mill and the lathe before updating if you hit the reverse direction button it would run that way. now i have to hold it in. any ideas? i can post a video if im not being clear.




report_7804734BC55F-0529192033_2020-11-25_20-41-11.zip
(591.62 KiB) Downloaded 149 times

Re: spindle reverse button issues

Posted: Wed Nov 25, 2020 10:12 pm
by cncsnw
The issue probably relates to the keyboard equivalents (on the Alt-J panel). With the logic in your PLC program, once you ever use Ctrl-C (forward) or Ctrl-W (reverse), then one or the other of those requests remains on until you shut down and restart. That defeats the VCP selections.

Code: Select all

;KbSpinCW_M: ctrl-c
IF Kb_c && (Kb_L_Ctrl || Kb_R_Ctrl) && AllowKbInput_M THEN SET KbSpinCW_M,
    RST KbSpinCCW_M

;KbSpinCCW_M: ctrl-w
IF Kb_w && (Kb_L_Ctrl || Kb_R_Ctrl) && AllowKbInput_M THEN SET KbSpinCCW_M,
    RST KbSpinCW_M
Someone with more time to spend can investigate whether this issue is present in the standard template provided with v4.59, or whether it is an old bug, or if it is unique to your particular PLC program.

Re: spindle reverse button issues

Posted: Thu Nov 26, 2020 11:41 am
by cnckeith
what method of updating did you use? restore report and then update wizard? or did you use the wizard and 'manually' reset the cnc configuration?

Re: spindle reverse button issues

Posted: Thu Nov 26, 2020 11:47 am
by cnckeith
i've restored your report to my lathe, and the VCP spindle buttons work as they should.

marc, the Alt-j keyboard jog spindle control works as intended in conjunction with the VCP in my testing with the report provided.

Re: spindle reverse button issues

Posted: Thu Nov 26, 2020 11:51 am
by cnckeith
galyion wrote: Wed Nov 25, 2020 9:38 pm I just updated my lathe to the newest cnc12. didnt go very smoothly but i was able to get everything to work. only issue im having is on the vcp the spindle reverse button acts like a momentary switch. my mill and the lathe before updating if you hit the reverse direction button it would run that way. now i have to hold it in. any ideas? i can post a video if im not being clear.





report_7804734BC55F-0529192033_2020-11-25_20-41-11.zip
noticed in the report that the estop is inverted, please install a proper estop switch.

Re: spindle reverse button issues

Posted: Fri Nov 27, 2020 11:53 pm
by cncsnw
cnckeith wrote:i've restored your report to my lathe, and the VCP spindle buttons work as they should.

marc, the Alt-j keyboard jog spindle control works as intended in conjunction with the VCP in my testing with the report provided.
I tried it on a v4.50 bench setup, and found that the VCP spindle direction buttons worked fine in manual spindle mode, until I pressed Ctrl-C or Ctrl-W (the keyboard jog panel spindle direction buttons). Thereafter, the VCP buttons didn't work in manual spindle mode. M3 and M4 in auto mode worked just fine.

That is as I would expect, because the code quoted previously:

Code: Select all

;KbSpinCW_M: ctrl-c
IF Kb_c && (Kb_L_Ctrl || Kb_R_Ctrl) && AllowKbInput_M THEN SET KbSpinCW_M,
    RST KbSpinCCW_M

;KbSpinCCW_M: ctrl-w
IF Kb_w && (Kb_L_Ctrl || Kb_R_Ctrl) && AllowKbInput_M THEN SET KbSpinCCW_M,
    RST KbSpinCW_M
has no provision for ever resetting both KbSpinCW_M and KbSpinCCW_M; and as long as one or the other of those is set, then the subsequent code:

Code: Select all

;--Set spindle direction
;------------------Set Clockwise direction
IF ((KbSpinCW_M || SpinCWKey || SkinSpinCW_M) && !SpinAutoModeLED) || (M3 && SpinAutoModeLED)
  THEN RST SpindleDirection_M
IF !SpindleDirection_M THEN (SpindleCWLED), (SelectSpindleCW)

;---------------Set Counterclockwise direction
IF ((KbSpinCCW_M || SpinCCWKey || SkinSpinCCW_M) && !SpinAutoModeLED) || (M4 && SpinAutoModeLED)
  THEN SET SpindleDirection_M
IF SpindleDirection_M THEN (SpindleCCWLED), (SelectSpindleCCW)
will continue to respond to the KbSpinCW_M or kBSpinCCW_M, as if the key were still being pressed.

This bug is not unique to galyion's PLC program. It is present, at least, in the template source file included with v4.50. It should be fixed, by changing the keyboard jog panel code to handle Ctrl-C and Ctrl-W like it handles all other combinations:

Code: Select all

;KbSpinCW_M: ctrl-c
IF Kb_c && (Kb_L_Ctrl || Kb_R_Ctrl) && AllowKbInput_M THEN (KbSpinCW_M)

;KbSpinCCW_M: ctrl-w
IF Kb_w && (Kb_L_Ctrl || Kb_R_Ctrl) && AllowKbInput_M THEN (KbSpinCCW_M)
This bug has evidently been present in nearly all CNC11/CNC12 PLC programs since at least early 2011.

Re: spindle reverse button issues

Posted: Sat Nov 28, 2020 9:00 am
by martyscncgarage
galyion wrote: Wed Nov 25, 2020 9:38 pm I just updated my lathe to the newest cnc12. didnt go very smoothly but i was able to get everything to work. only issue im having is on the vcp the spindle reverse button acts like a momentary switch. my mill and the lathe before updating if you hit the reverse direction button it would run that way. now i have to hold it in. any ideas? i can post a video if im not being clear.


report_7804734BC55F-0529192033_2020-11-25_20-41-11.zip
galyion,
Do not use the keyboard short cuts Alt-J
Using VCP Spindle control section, can you control the spindle as expected?
A video clip of what you are doing would be helpful.
As Marc (cncsnw) pointed out, you may have found a small bug if/when you are using the keyboard short cuts (Alt j)

Marty

Re: spindle reverse button issues

Posted: Sat Nov 28, 2020 2:25 pm
by cncsnw
The bug will show up if you press Ctrl-C or Ctrl-W, even if you do not activate the keyboard jog panel with Alt-J.

A PC old-timer might instinctively press Ctrl-C thinking to interrupt whatever task is going on, without realizing it is a keyboard spindle control combination.