Page 6 of 7
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Wed Jul 23, 2025 10:30 pm
by cncsnw
Whether "_I" is appended to the name of every input bit, and "_O" is appended to the name of every output bit, is purely a matter of style and personal preference. There are factory PLC programs out there with both conventions. The more recent Oak and Allin1DC program files generally have those suffixes on the input and output names; the Acorn and Hickory programs generally do not.
What matters to you when you are adding code to your PLC program, is that whenever you refer to a bit name, you use the name it was given when it was defined at the top of the program file. If your program defines OUT1104 to be "FeedHoldLED", then that is the name you need to call it by. If your program defines OUT1104 to be "FeedHoldLED_O", then that is the name you need to call it by.
This is mostly an issue when copying and pasting between programs that were written using different conventions.
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Thu Jul 24, 2025 1:39 pm
by CentroidFrog
By pressing the physical button it's causing the logic for the Feed hold and Cycle start to both be true.
To get the StopGo button working you'll want to use a one shot.
First we start by defining a new one shot.
Next, we tell it to toggle the one shot when the button is pressed.
Next, we'll need to replace StopGo in your current logic with StopGo_PD.
Code: Select all
IF (FeedHoldKey || (StopGo_PD && !FeedHoldLED_O) || KbFeedHold_M || MpgFeedHold_M || SkinFeedHold_M_SV) THEN (FeedHoldPD_PD)
IF (CycleStartKey || KbCycleStart_M || MpgCycleStart_M || SkinCycleStart_M_SV ||
(FeedHoldLED_O && StopGo_PD) || (StopGo_PD && !SV_PROGRAM_RUNNING))
THEN (DoCycleStart_SV)
I've also added (StopGo_PD && !SV_PROGRAM_RUNNING) to this logic to allow the button to operate as cycle start when a job isn't running.
For instance on the main menu of CNC12.
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Tue Jul 29, 2025 10:15 am
by KreiderMachine
After a quick call to Automation Direct, the spindle is now working! In case it may be relevant to others:
On our GS33-27P5 VFD:
Parameter 00.20 - 2: Analog Input - (Factory Default was 0: Digital Keypad)
Parameter 00.21 - 1: Ext Terminal - (Factory Default was 0: Digital Keypad)
Spindle Speed Ranges do not seem to adapt to gearbox switches, so something is still wrong in the PLC, I think.
I have parameters 65-67 set match the switches and gearbox, but when I command speeds in MDI, it doesn't seem to adapt to the gearbox position.
Someone please correct my understanding of how this works. To generate the ratios entered in ps. 65-67, I divided the max speed in each range by the max speed in high range. If the gearbox is in a lower gear, it is still supposed to match commanded speed (assuming it is possible for that gear range in full speed,) correct?
Here is my latest plc source file. Stop/Go now works swimmingly. (Many thanks to Lucas and whoever may have helped with getting this updated on your end)
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Tue Jul 29, 2025 11:11 am
by KreiderMachine
Another Issue identified:
When testing the limit switches and trying to get the machine to home to them, I discovered that Z-axis throws an error whenever you try to jog with a limit switch triggered.
Regardless of whether it is +/- direction, I am unable to jog away from a limit trigger without throwing a "#410 - Z-Axis (1) Position Error."
When I reverse the 'z' direction, it doesn't throw the error, but I can only jog further into the limit switch rather than off of it, because it thinks it has disabled jogging in the direction of the axis.
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Tue Jul 29, 2025 12:38 pm
by Allin1Chris
KreiderMachine wrote: ↑Tue Jul 29, 2025 10:15 am
Spindle Speed Ranges do not seem to adapt to gearbox switches, so something is still wrong in the PLC, I think.
I have parameters 65-67 set match the switches and gearbox, but when I command speeds in MDI, it doesn't seem to adapt to the gearbox position.
This is always setting your spindlerange to High because it comes after. Move this Line of Code to ABOVE your ;Select spindle range with AuxKeys
So it likes this,
Code: Select all
; 4 hi 3 med-high 2 med-low 1 low
; 0 1 1 0 SV_SPINDLE_MID_RANGE M
; 0 0 1 1 SV_SPINDLE_LOW_RANGE
; Use input switches, M functions, or other means to determine the gear
; range number (1-4). For basic mills, look for one low-range switch.
; Default to high range until proven otherwise (fail-safe choice)
IF True_M THEN SpindleRange_W = 4
; Select spindle range with Aux keys
IF SpinXLowRange THEN SpindleRange_W = 1
IF SpinLowRange THEN SpindleRange_W = 2
IF SpinMedRange THEN SpindleRange_W = 3
IF SpinHighRange THEN SpindleRange_W = 4
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Tue Jul 29, 2025 1:03 pm
by cncsnw
In your July 23rd report, your Z axis had Direction Reversal = Yes, but you still had the default limit input numbers: Z minus = INP1, Z plus = INP2.
When you need to set Direction Reversal, you need to swap the limit inputs: set Z minus = INP2, Z Plus = INP1. Then connect your wires accordingly.
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Tue Jul 29, 2025 1:46 pm
by KreiderMachine
cncsnw wrote: ↑Tue Jul 29, 2025 1:03 pm
When you need to set Direction Reversal, you need to swap the limit inputs: set Z minus = INP2, Z Plus = INP1. Then connect your wires accordingly.
Wonderful. This is solved!
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Tue Jul 29, 2025 1:58 pm
by KreiderMachine
The Gearbox switches are not quite solved, yet.
Not sure if it makes a difference, but my switches are NOT configured like this:
"
; 4 hi 3 med-high 2 med-low 1 low
; 0 1 1 0 SV_SPINDLE_MID_RANGE M
; 0 0 1 1 SV_SPINDLE_LOW_RANGE
; Use input switches, M functions, or other means to determine the gear
; range number (1-4).
"
Rather, I just have a single switch for each position (4 inputs) normally closed, using inputs 13-16.
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Tue Jul 29, 2025 6:34 pm
by cncsnw
Your PLC logic assumes that the range switches are normally-open.
Only the one for the currently-selected gear range should be closed.
That switch should remain closed as long as the headstock is in that gear. If it is a momentary pushbutton, you will -- at a minimum -- need to delete the "IF True_M THEN SpindleRange_W = 4" line.
If you really have normally-closed switches, and it is not convenient to change them, then you will need to invert them in software (using Ctrl-Alt-i on the Alt-i display). Alternately, you could change the PLC logic to read:
Code: Select all
IF !SpinXLowRange THEN SpindleRange_W = 1
IF !SpinLowRange THEN SpindleRange_W = 2
IF !SpinMedRange THEN SpindleRange_W = 3
IF !SpinHighRange THEN SpindleRange_W = 4
... but that is a little unintuitive.
Re: SWI Trak 1745P - Allin1DC Retrofit
Posted: Wed Jul 30, 2025 12:01 pm
by KreiderMachine
Thank, Chris! I just inverted the inputs, and we're up and running.
cncsnw wrote: ↑Tue Jul 29, 2025 6:34 pm
Your PLC logic assumes that the range switches are normally-open.
Only the one for the currently-selected gear range should be closed.
That switch should remain closed as long as the headstock is in that gear. If it is a momentary pushbutton, you will -- at a minimum -- need to delete the "IF True_M THEN SpindleRange_W = 4" line.
If you really have normally-closed switches, and it is not convenient to change them, then you will need to invert them in software (using Ctrl-Alt-i on the Alt-i display). Alternately, you could change the PLC logic to read:
Code: Select all
IF !SpinXLowRange THEN SpindleRange_W = 1
IF !SpinLowRange THEN SpindleRange_W = 2
IF !SpinMedRange THEN SpindleRange_W = 3
IF !SpinHighRange THEN SpindleRange_W = 4
... but that is a little unintuitive.