How to Measure Length with FX5U PLC Encoder Input

Question:

I am looking for guidance on how to measure length with an encoder linked to the high-speed counter input of a Mitsubishi FX5U PLC. Could someone provide instructions on achieving this task? It would be helpful if responses could be in ladder logic format, as I am not proficient in FB programming.

Top Replies

If you are uncertain about utilizing the current x0 to X for high-speed operations or a high-speed counter card, please refer to the attached single-phase code. Simply enable the high-speed counters (e.g. C235 to C23xx) with a constant bit to ensure proper functionality. The input will automatically link to the appropriate high-speed counter. Although I do not have the updated GX Dev for FX5, the process should be similar to FX3U. The code provided is designed for a high-speed water meter and can be applied as long as the pulse rate does not exceed the specified counts per second of the high-speed inputs.

Hello Parky, Thank you for your input. It's worth noting that FX5 operates on a different counter system compared to FX3. Once the High-Speed Counter (HSC) is enabled, it continues counting, allowing for count transfer to Data Registers (DRs) and data manipulation. I recently discovered that I can specify my count value in a table format and trigger a flag when it reaches a certain value. By setting this value to pulses per meter, I can use the flag to increment a DR every meter. I plan on testing this out later this week. Transitioning from FX3 to FX5 offers significant software capabilities, which may seem overwhelming initially but is definitely worthwhile. It's important to have GXWorks 3 for programming.

In GX Works3, it is possible to operate in FX3 compatible mode as per the manual. However, there might be limitations with the HSC function when using the simulator without a PLC. By switching the counter to compatible mode and adjusting the relevant counter LC35, it is feasible to reset it. Alternatively, setting X0 as an interrupt and incrementing a Data memory during the interrupt call can also be a solution for manipulating and comparing data. It's worth noting that during compilation, there may be a warning about a 10ms input limit, potentially restricting the speed. Despite this, my attempts to set it to a lower value were unsuccessful in the initial testing phase.

After delving deeper into the FX 5, I now grasp its configuration. To reset the counter, simply employ the command [DHCMOV K0 SD4500 K1]. To activate the internal counter, use LD SM412 [HIOEN K0 K1 K0]. Don't forget to adjust the input filter on X0, especially if it serves as the high-speed input. It seems likely that the encoder runs continuously in your scenario, meaning a sensor detects the part or material. Consider using logic to enable the High-Speed Counter (HSC) only during this period or reset it upon product detection. In my situation, the flow meter generates pulses only when there is flow. Therefore, I reset the counter using a one-shot when initiating the control valve. This way, I accurately tally pulses from 0 to xxx before conversion to liters.

Is it necessary to connect the encoder with 2 channels and 2 phases (1 multiple) to the first 4 inputs X0 to X3?

To measure length using an encoder linked to the high-speed counter input of a Mitsubishi FX5U PLC, you'll need to make use of the PLC's high-speed counter functions. Depending on your particular application, you might use the differential phase or similar functions. In ladder logic format, you'll read the counter value by using a specific device address. The exact address will depend on your counter channel, so refer to the PLC's manual. Once the counter value is read, convert that into length based on your encoder's PPR (pulse per revolution) and the diameter of the roller, gear, etc., involved. It's important to consult your PLC manual for the specifics as ladder logic programming can vary depending on the specific PLC model you're using. Not being able to share code here, I suggest you visiting sites like 'PLCS.net' which are gold mines for such detailed and technical discussions.

I would suggest that the first step is to organize the encoder so that every tick it makes represents a certain distance (mm, cm, inches, etc.), then set up the high-speed counter on your FX5U to count those ticks through appropriate wiring and ladder logic programming in GX Works. For instance, K4M101 could set up your counter to start. When the encoder ticks, you increment your counter (e.g., D200) by one. You could then convert D200 to your desired units within your code. Remember to reset your counter every so often to avoid overflow. There might be a bit of trial and error at start, but once you have the right scale it should work smoothly.

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: FAQs:

Answer: 1. How can I measure length using an encoder connected to the high-speed counter input of a Mitsubishi FX5U PLC? - To measure length with an encoder connected to the high-speed counter input of a Mitsubishi FX5U PLC, you can use ladder logic programming. You need to read the encoder pulses and convert them into length measurements based on the encoder resolution and the distance traveled per pulse.

FAQ: 2. Can you provide step-by-step instructions on how to implement length measurement with an encoder in ladder logic format for the FX5U PLC?

Answer: - To implement length measurement with an encoder in ladder logic for the FX5U PLC, you will need to configure the high-speed counter input, read the encoder pulses, and calculate the length based on the encoder resolution and distance per pulse. You can then store or display the length measurement as required.

FAQ: 3. Is it necessary to have a good understanding of FB programming to measure length with an encoder on the FX5U PLC?

Answer: - No, it is not necessary to have a good understanding of FB (Function Block) programming to measure length with an encoder on the FX5U PLC. You can achieve this task using ladder logic programming, which is commonly used in PLC applications and is more straightforward for users who are not proficient in FB programming.

FAQ: 4. What factors should I consider when setting up length measurement using an encoder input on the FX5U PLC?

Answer: - When setting up length measurement using an encoder input on the FX5U PLC,

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’