Page 9 of 11

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Tue Apr 15, 2025 1:20 pm
by KreiderMachine
Update: I scaled the spindle speed value under Setup->Config->Cntrl and have gotten it close, but this isn't the solution. At low RPMs, the actual value is less than the commanded value (m3 s30 produces 3 RPM, m3 s50 produces 28 RPM) and at higher rpms it is the opposite (m3 s3000 produces 3030rpms, m3 s3560 produces 3599 rpms.) Still can't tap like this.

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Tue Apr 15, 2025 2:42 pm
by tblough
Some VFDs have parameters to adjust the slope and intercept values for the analog input. If your's does not, another option proposed in previous threads is to modify the spindle output section of the PLC program to add linearization and offset adjustments to the analog output.

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Thu Apr 17, 2025 9:51 am
by KreiderMachine
Thanks for the response, Tom. I have the spindle speeds reading true, finally.

So now, I'm on a bonus mission, trying to set up the vector mode/ VF mode changeover (x18 switch) using an unused Hickory output and a custom macro.

A Mitsubishi tech pointed me towards this. I'll document here if I can figure out what configuration is required to make this work.
Do any of you have experience with this?

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Thu Apr 17, 2025 4:31 pm
by KreiderMachine
Ok, so I have the x18 switch configured for the VFD, and have it wired to Hickory output 9. I can trip it manually using the PLC diagnostics menu, but would like to write a macro for the VCP and Pendant that will allow a single button to toggle between the VFD modes.

I thought it would be as simple as copying the Macro for the Mist/flood coolant toggle and changing the outputs, but I have run into a stop with M94/M95 and setting up a custom output definition. I can wrap my head around the movement macros (park, home, etc.), and have created a button for the VCP, but am stuck trying to make it do what I want.

Watching tutorial videos... but if any of you can give me a straight line to the answer I'll be very grateful.

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Thu Apr 17, 2025 10:59 pm
by cncsnw
If you just want a VCP key to toggle an output on and off, without also having programmable M functions to change that output, then the simplest and cleanest way to do it is entirely in the PLC program, with no CNC macros or M94/M95 bits.

For example:

Code: Select all

SpindleVFModeOut  IS OUTmm
;...
SpindleVFModeLED IS OUTnn
;...
SkinSpindleVFModeKey IS SV_SKIN_EVENT_xx
;...
SpinSpindleVFModePD IS PDyy
;...
IF SkinSpindleVFModeKey THEN (SpinSpindleVFModePD)
IF SpindleVFModeOut ^ SpinSpindleVFModePD THEN (SpindleVFModeOut), (SpindleVFModeLED)
In this case, you could even skip the "SpindleVFModeLED" definition, and just make your VCP key display on/off based on the wired output (e.g. OUT9); but that is less portable, since you would have to edit the VCP key as well as the PLC program if you decide to change outputs.

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Fri Apr 18, 2025 2:15 pm
by cnckeith
cncsnw wrote: Thu Apr 17, 2025 10:59 pm If you just want a VCP key to toggle an output on and off, without also having programmable M functions to change that output, then the simplest and cleanest way to do it is entirely in the PLC program, with no CNC macros or M94/M95 bits.

For example:

Code: Select all

SpindleVFModeOut  IS OUTmm
;...
SpindleVFModeLED IS OUTnn
;...
SkinSpindleVFModeKey IS SV_SKIN_EVENT_xx
;...
SpinSpindleVFModePD IS PDyy
;...
IF SkinSpindleVFModeKey THEN (SpinSpindleVFModePD)
IF SpindleVFModeOut ^ SpinSpindleVFModePD THEN (SpindleVFModeOut), (SpindleVFModeLED)
In this case, you could even skip the "SpindleVFModeLED" definition, and just make your VCP key display on/off based on the wired output (e.g. OUT9); but that is less portable, since you would have to edit the VCP key as well as the PLC program if you decide to change outputs.
if you go this route remember to select in the Wizard that you have customized the PLC program so it doesn't try and overwrite your customizations.

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Fri Apr 18, 2025 2:50 pm
by cnckeith
KreiderMachine wrote: Thu Apr 17, 2025 4:31 pm Ok, so I have the x18 switch configured for the VFD, and have it wired to Hickory output 9. I can trip it manually using the PLC diagnostics menu, but would like to write a macro for the VCP and Pendant that will allow a single button to toggle between the VFD modes.

I thought it would be as simple as copying the Macro for the Mist/flood coolant toggle and changing the outputs, but I have run into a stop with M94/M95 and setting up a custom output definition. I can wrap my head around the movement macros (park, home, etc.), and have created a button for the VCP, but am stuck trying to make it do what I want.

Watching tutorial videos... but if any of you can give me a straight line to the answer I'll be very grateful.
question.

do you want the output to cancel (return to default state) with Estop/cycle cancel?

or stay?

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Sat Apr 19, 2025 9:16 am
by KreiderMachine
Stay, I think.

I really like the idea of having the button change based on what mode it is in.

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Mon Apr 21, 2025 12:56 pm
by KreiderMachine
So, I have been unsuccessful thus far in editing the PLC program. (I did figure out how to successfully compile after changes, but have left a copy of the original " .src" file intact.

I can follow the connections around about 60% of the time, but I'm lost when a crumb trail disappears into the forest. I.e:

I don't see what defines "SV_PLC_Function_xx."
Also, the one-shot definitions are used for the vacuum control button I was trying to copy/adapt, but I can't see where those are defined anywhere. Do these refer to external files?

How do I make custom macros show up as selectable options for the VCP in the wizard?

Re: Millport VMC1660 Centroid Upgrade (Leadshine EL7)

Posted: Mon Apr 21, 2025 2:07 pm
by Allin1Chris
Hello Kreider,
KreiderMachine wrote: Mon Apr 21, 2025 12:56 pm
I don't see what defines "SV_PLC_Function_xx."
You can find what each SV_PLC_FUNCTION_XX does from the CNC12 PLC Manual starting on page 121. Typically these functions are very specific functions to command the motion control board and/or CNC12 to "Do Something". What each specific function does cannot be changed in the PLC, but can be redefined if you wish. The definitions can be found near the top of the .src file and should look similar to the following snippet code.

Code: Select all

;------------------------------------------------------------------------------
;  System variables:  Jog Panel Functions
;------------------------------------------------------------------------------
; Jog panel functions
;Invalid                      IS SV_PLC_FUNCTION_0
DoCycleCancel_SV                IS SV_PLC_FUNCTION_1
DoCycleStart_SV                 IS SV_PLC_FUNCTION_2
DoToolCheck_SV                  IS SV_PLC_FUNCTION_3
SelectSingleBlock_SV            IS SV_PLC_FUNCTION_4
SelectX1JogInc_SV               IS SV_PLC_FUNCTION_5
SelectX10JogInc_SV              IS SV_PLC_FUNCTION_6
SelectX100JogInc_SV             IS SV_PLC_FUNCTION_7
SelectUserJogInc_SV             IS SV_PLC_FUNCTION_8
SelectIncContJog_SV             IS SV_PLC_FUNCTION_9
SelectFastSlowJog_SV            IS SV_PLC_FUNCTION_10
KreiderMachine wrote: Mon Apr 21, 2025 12:56 pm Also, the one-shot definitions are used for the vacuum control button I was trying to copy/adapt, but I can't see where those are defined anywhere. Do these refer to external files?
One-Shots or "PD" are defined near the beginning of the .src file similar to the SV_PLC_FUNCTIONS_XX. Though unlike the SV_PLC_FUNCTIONS_XX, there is no external functionality for One-Shots, they are completely internal to the PLC. The definitions start after the Word and Floating Word sections of most of our .src files towards the top of the file.

Code: Select all

;------------------------------------------------------------------------------
;            One Shot Definitions
;------------------------------------------------------------------------------
IncrContPD_PD                   IS PD1
SlowFastPD_PD                   IS PD2
MpgPD_PD                        IS PD3
SingleBlockPD_PD                IS PD4
FeedHoldPD_PD                   IS PD5
SpinAutoManPD_PD                IS PD6
SpindlePlusPD_PD                IS PD7
SpinOverMinusPD_PD              IS PD8
SpinOver100PD_PD                IS PD9
ProbeProtTripped_PD             IS PD10
KreiderMachine wrote: Mon Apr 21, 2025 12:56 pm How do I make custom macros show up as selectable options for the VCP in the wizard?
In the Main C:\cncm or C:\cnct directory, create a file and name it mfuncXX.mac (Where XX is 0-89), the macro will then appear in the VCP Aux Keys M Function Drop Down List. If you have just added the file, the Wizard will need a restart for it to find the new file.

I should Note that these assignments in the Wizard are for "Aux Keys", the stock hickory VCPs have aux1-6 available on the VCP. More (up to 16) can be added by editing the skin .xml which is explained in our VCP 2.0 manual if needed.

Example:
1. Create a file called mfunc0.mac in the C:\cncm Directory
2. Restart the Wizard
3. Navigate to the VCP Aux Keys Page
4. mfunc0.mac will now appear in the dropdown menu
Capture.PNG