Your challenge is to identify the differences between this machine and one capable of running at 1 ms step times. It's hard to envision completing an 8-step soldering process in just 8 milliseconds. What is the PLC scan time? It is likely that one PLC scan is required in each step.
Are you able to access the software running on the machine? Do you utilize interrupts in your programming? The standard I/O refresh rate is set at 10ms, with the normal program scan taking at least 20ms. Additionally, are digital inputs/outputs and servo systems incorporated into the program?
The program is currently password protected and does not utilize interrupts. If you could provide guidance on implementing interrupts, it would be greatly appreciated. Additionally, we are utilizing DI and servo technology.
To provide accurate guidance, we need to understand the entire process. Are you utilizing inputs/outputs for control purposes? Which software, GXDeveloper or GXWorks2, are you using? For instance, there are various interrupts like input interrupts for X0-X5 and timed interrupts (exact number unknown). It is recommended to refer to the manual provided at https://dl.mitsubishielectric.com/dl/fa/document/manual/plc_fx/jy997d16601/jy997d16601r.pdf for more in-depth information on timed and input interrupts and other related topics.
We utilize GX Works2 software, FX3G PLC, and MR-JE10A servo motor in our operations. Let me elaborate on the various inputs and outputs used in our system.
We have X1 as the input for cycle start, with Y0 generating pulses for the servo, Y1 controlling the servo direction, Y2 for the comb on function, Y3 for the comb off function, Y4 for the pusher movement, Y5 for activating the laser, and Y6 for engaging the winder.
In addition, we employ timers T259, T260, T261, etc., with a resolution of 1ms.
Our operation includes 8 steps:
1. Activating the comb
2. Turning on the laser
3. Moving the pusher upwards
4. Reversing the servo
5. Bringing the pusher downwards
6. Engaging the winder
7. Disabling the comb
8. Advancing the servo
The process then repeats from step 1.
Five key output devices in the system include servo, comb, pusher, laser, and winder. Some of these devices offer compound outputs such as servo pulse and dir, or comb on and off functions. In order to ensure that all five devices are utilized at least once within a cycle, with each device transitioning between two states, there must be a minimum of ten steps. The current sequence of eight steps lacks instructions for the "Pusher down" or "Laser off" actions needed to return to the original state.
Furthermore, the statement "These are input and output" prompts the question of whether there are corresponding input signals for each output command to signify when an action (such as moving up, down, on, or off) has been completed by the output device.
Commencing the cycle poses no issues, as it does not necessitate any high-speed input. It is likely that the other outputs, Y0 and Y1, will be addressed if high-speed functions such as PWM or DVRI are utilized. Standard outputs like the comb, pusher, and winder will require a minimum of 10ms, in addition to the main program that controls them. There is also a refresh function, REF, available to update inputs or outputs. However, attaining an 8ms cycle for all 8 steps may be challenging, as the physical solenoids or similar components may not respond that quickly. It may be necessary to implement real high-speed processing. Timer interrupts are limited to 10ms and above, so even with a 1ms timer, it would need to be triggered within an input interrupt. I recommend setting up a 10ms interrupt, writing your program there, and utilizing a refresh function. It is possible that your program is running on a normal scan, and the reason it functions at 50ms is because the 8 transitions are updated within the scan time. It seems unlikely that the original setup could complete the 8 steps in 8ms. For further details, refer to page 5.6.1 of the following manual: https://dl.mitsubishielectric.com/dl/fa/document/manual/plc_fx/jy992d48301/jy992d48301j.pdf
The theoretical scan time for a 3G FX3G series PLC is determined by the basic instruction execution time, approximately 0.21 ยตs per instruction (for contact instructions). To calculate the theoretical scan time accurately, count all instructions in the program, including basic and applied ones. Multiply the number of each instruction type by its execution time and sum up the results to get an estimate of the total scan time. It's important to note that this calculation is based on ideal conditions and does not consider factors such as I/O processing or communication overhead. Actual performance may differ accordingly.
Hackavi mentioned that the program is password protected and does not utilize interrupts. However, they are seeking guidance on how to incorporate interrupts. They also mentioned using di do and sevo functions. Why is the high-speed (8x1ms) system's control program password protected? What is the reason for attempting to replicate the functions of the password-protected system? Is the high-speed system's control running on a PLC (fx3g?) or a different type of device? It is unlikely that a common PLC can handle outputs at a 1kHz cadence, with even a โ
kHz cadence potentially posing issues. Can you share your version of the code (PDF or screenshots)? Regarding the outputs, did you utilize step-dependent coils that are true for 1ms or did you use set/reset or latching coils that maintain state until changed? PLC programming revolves around timing, with when something happens being more crucial than what happens. A PLC operates in a time-discrete manner, handling one task at a time, therefore requiring the program cycle time and input/output response times to be significantly faster than the controlled process. In cases where the PLC is not significantly faster, a sophisticated program must be developed to control the process. If the creator of this program has protected their Intellectual Property, you will need to either replicate their efforts or obtain their Intellectual Property through purchase or licensing.
Learn how to implement time interrupts and refresh functions using this code snippet. While I only have experience with the FX3U, this code can be adapted for the FX3G with some adjustments.
In the code, the interrupts are enabled with the "EI" command, followed by the insertion of a FEND statement to mark the end of the main program. To set the timebase for interrupts, specify the interrupt number on the left-hand side. The FX3G typically supports time interrupts from 10ms to 100ms, but on the FX3U, it can be set to 1ms by specifying the timer interrupt as int 6.
Within the interrupt routine, write your code to refresh the outputs, ensuring to include an IRET instruction to return to the main program. In a test scenario, D0 is incremented upon time interrupt calls, with Y0 toggling for testing purposes. In the main program, a 100ms timer copies the value from D0 to D1 before resetting D0.
The code execution on the FX3U yielded satisfactory results, with D0 (stored in D1) averaging around 100, accounting for slight discrepancies due to timer accuracy. If attempting on the FX3G, adjust the interrupt routine accordingly. Remember, interrupts can only be implemented in ladder logic, not FBD/ladder.