Spindle High/Med/Low settings - need Help <answered>

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
Reiko Röse
Posts: 8
Joined: Wed Oct 30, 2024 1:00 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 54453808391C-0702248376
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany M.V.

Spindle High/Med/Low settings - need Help <answered>

Post by Reiko Röse »

Hello,

I need help with the Spindle High/Med/Low settings for the manual gearbox on my mill. I entered the max and min speed for the High range and also the gear ratios for the Med and Low ranges. However, the buttons in the VCP are not working.

Additionally, when I run a program with an RPM lower than 600, there is no warning message indicating that the machine is in the wrong gear range.

What did I miss in the setup? An actual report ZIP file is attached.
20250801_182555.jpg
20250801_182329.jpg
Regards Reiko


suntravel
Community Expert
Posts: 3708
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: Spindle High/Med/Low settings - need Help

Post by suntravel »

Why are you using an old legacy VCP skin?

I suggest use one of these actual ones to have all features of the current 5.30 CNC12 version:
VCP.jpg
Uwe


suntravel
Community Expert
Posts: 3708
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: Spindle High/Med/Low settings - need Help

Post by suntravel »

The Spin Low button will run mfunc41.mac (M41)

Code: Select all

;-------
;M41 macro
; Selects Low Range Spindle
;-------

IF #50010                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 100  ;Skip macro if graphing or searching


M95 /42/43                       ;Turn off Med & High Request
M94 /41                          ;Request Low range

N100
By default it is requesting this from the PLC:

Code: Select all

M41                           IS SV_M94_M95_41 ;(Spindle Low Range)
If nothing more is set up in the macro or the PLC it will do nothing except to turn your spindle drive with S/0.12 in your setup.

On my lathe with a manual gearbox I have made custom macros like this on :

Code: Select all

;-------
; M42 macro
; Selects Med Low Range Spindle
;-------

IF #50010                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

M5
N90
M200"Shift to MEDIUM GEAR\n\nPress CYCLE START to continue"
M95/41
M95/43
M94/42
M3 S100
G4 P1
#1=#25009
If #1>90and#1<110 THEN GOTO 100 ELSE GOTO 200
N100
M200"M3 S=%f\nRPM=%f\n\nIf OK Press CYCLE START to continue"#4119#1
GOTO 300
N200
M200 "M3 S=%f\nRPM=%f\n\nWrong Gear You STUPID\n\nPress CYCLE START and try again"#4119#1
M5
GOTO 90
N300
M5
M95 /14/16
M94 /15
N1000
If M42 is issued, it prompts me to switch to Medium Gear, test if I have shifted ok, if not it calls me stupid to try again :mrgreen:

Uwe


Muzzer
Posts: 815
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: Spindle High/Med/Low settings - need Help

Post by Muzzer »

I have a slightly different setup. My Shizuoka AN-SB has a 2 speed geared head with pneumatic actuators to engage the appropriate ratio, along with microswitches to detect if the gear has been correctly and fully engaged. The selection is a little crude, based on the set speed (S1000 etc) active in the g-code when the M4 (spindle forward) or M5 (spindle reverse) code is called.

As the gears don't always mesh first time, I check the signal from the appropriate microswitch and if it's not fully engaged, I tickle the spindle motor by sending a short on/off signal and retrying until the gears engage properly. That's enough to move the gears slightly without grinding them. This system usually works on the first retry if initial engagement fails.

It's not quite what you are after but might give you some ideas. M3 and M4 are almost identical although obvs they need to issue the appropriate spindle direction once gear selection is successfully completed.

Here it is in action, including a successful retry:


mfunc4.mac
(2.78 KiB) Downloaded 4 times
mfunc3.mac
(2.78 KiB) Downloaded 1 time


Reiko Röse
Posts: 8
Joined: Wed Oct 30, 2024 1:00 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 54453808391C-0702248376
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany M.V.

Re: Spindle High/Med/Low settings - need Help

Post by Reiko Röse »

Hello,
thank you for the Answers. I was able to solve my problem - now i need no buttons. I have modified the Post Processor for my maschine. The Post Processor call´s macro 43, 42 or 41 in the G-Code depending on the Spindle speed for the Tool. The macro tells me with a M200 message which gear i have to put in and i can resume the Job with cycle start.

I added this function to the PP

Code: Select all

function insertGearMacro(rpm) {
  if (rpm <= 200) {
    writeComment("LOW-Gang Auswahl per Makro");
    writeBlock("M41");
  } else if (rpm <= 600) {
    writeComment("MID-Gang Auswahl per Makro");
    writeBlock("M42");
  } else {
    writeComment("HIGH-Gang Auswahl per Makro");
    writeBlock("M43");
  }
}
and also inserted this Line

Code: Select all

if (spindleSpeed > 99999) {
      warning(localize("Spindle speed exceeds maximum value."));
    }
   insertGearMacro(spindleSpeed); // Makro wählt M41/M42/M43 je nach Drehzahl

    writeBlock(
      sOutput.format(spindleSpeed), mFormat.format(tool.clockwise ? 3 : 4)
    );
  }
the Macro looks like this

Code: Select all

;-------
;M41 macro
; Selects Low Range Spindle
;-------

IF #50010                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 100  ;Skip macro if graphing or searching

M5
N90
M200"Shift Gearbox to 205rpm\n\nPress CYCLE START to continue"
M95 /42/43                       ;Turn off Med & High Request
M94 /41                          ;Request Low range

N100
The only thing to do is to find out how to skip the macro wenn the right gear in already selected.

Regaeds Reiko
Last edited by Reiko Röse on Mon Aug 04, 2025 4:48 pm, edited 2 times in total.


suntravel
Community Expert
Posts: 3708
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: Spindle High/Med/Low settings - need Help

Post by suntravel »

You can use sensors or switches on the gear levers to let Acorn know which gear is selected.

Uwe


Reiko Röse
Posts: 8
Joined: Wed Oct 30, 2024 1:00 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 54453808391C-0702248376
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany M.V.

Re: Spindle High/Med/Low settings - need Help

Post by Reiko Röse »

Hello,

I resolved the repeated gear selection issue by modifying the post processor as well. If the next spindle speed remains within the same range as the previous one, the macro will not be triggered.

for this functionality I added this variable to the PP

Code: Select all

var lastGearMacro = ""; // global: zuletzt ausgegebener Gang
an have modified the function insertGearMacro(rpm)

Code: Select all

function insertGearMacro(rpm) {
  var gearMacro = "";

  if (rpm <= 200) {
    gearMacro = "M41";
  } else if (rpm <= 600) {
    gearMacro = "M42";
  } else {
    gearMacro = "M43";
  }

  if (gearMacro !== lastGearMacro) {
    writeComment("Gangwahl: " + gearMacro);
    writeBlock(gearMacro);
    lastGearMacro = gearMacro;
  } else {
    writeComment("Gangwechsel nicht nötig (aktueller Gang: " + gearMacro + ")");
  }
}
Regards Reiko


Post Reply