Implementing Limit switch with stepper motor through External interrupt in Fatek PLC

Thread Starter

arham1026

Joined Dec 25, 2024
7
Hi everyone,

I'm just getting started with Fatek PLCs and currently working with the Fatek FBS-20MCT-AC (12 inputs, 8 outputs). I'm using the HSPSO (High-Speed Pulse Output) function for NC position control to drive a stepper motor.

I'm now trying to integrate a limit switch as an external interrupt. The goal is:

When the limit switch is pressed, the stepper motor should immediately reverse direction.

A few points:

  • The PLC is of the sinking type.
  • The limit switch outputs 24V by default, and drops to 0V (negative edge trigger) when pressed.
  • I'm using Y0 for pulse output and Y1 for direction.
According to the manual, once Y1 is assigned to HSPSO for direction control, it can't be manually overridden. I'm unsure how to dynamically change the motor direction based on the interrupt from the limit switch.

Is there a way to toggle direction (Y1) using an internal flag or register in the PLC, based on an external interrupt input?

Any suggestions, examples, or function block tips would be greatly appreciated!
 

MisterBill2

Joined Jan 23, 2018
27,159
We are missing a whole lot of information here. And at this point the TS needs to explain how the two outputs are related, because so far it makes no sense at all.
 

MisterBill2

Joined Jan 23, 2018
27,159
It seems that perhaps the TS, arham1026, does not realize that we need more information about both the PLC and the stepper driver involved.
I am not at all familiar with any aspect of the FATEK FBS-20MCT PLC product, nor the software that it uses. I am not willing to research it to learn about it. So if the TS is interested in receiving any useful advice they should provide more information.

Or agree to pay professional rates for consulting services.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
30,557
According to what I have read up on the unit, it is quite impresive as to what it claims it can do, i.e. not only
PLC function, bit also NC positioning.!
One would need a bit of a read-through of the manual in order to get familiar with the usage.
To the OP, are you are you sure this is not a bit of on over-kill for what you need ?
 

GetDeviceInfo

Joined Jun 7, 2009
2,270
Hi everyone,

I'm just getting started with Fatek PLCs and currently working with the Fatek FBS-20MCT-AC (12 inputs, 8 outputs). I'm using the HSPSO (High-Speed Pulse Output) function for NC position control to drive a stepper motor.

I'm now trying to integrate a limit switch as an external interrupt. The goal is:

When the limit switch is pressed, the stepper motor should immediately reverse direction.

A few points:

  • The PLC is of the sinking type.
  • The limit switch outputs 24V by default, and drops to 0V (negative edge trigger) when pressed.
  • I'm using Y0 for pulse output and Y1 for direction.
According to the manual, once Y1 is assigned to HSPSO for direction control, it can't be manually overridden. I'm unsure how to dynamically change the motor direction based on the interrupt from the limit switch.

Is there a way to toggle direction (Y1) using an internal flag or register in the PLC, based on an external interrupt input?

Any suggestions, examples, or function block tips would be greatly appreciated!
Limit switch would be an interrupt function, which programmatically affects direction. Depending on load dynamics, a change of direction could require profiling.
 

panic mode

Joined Oct 10, 2011
4,864
have not worked with that brand but from what i have seen so far, it is a typical micro PLC (brick).
i have worked with similar products from other brands (Omron, Mitsubishi, AllenBradley, Siemens, Panasonic etc.). in fact this looks suspiciously similar to FX series Mitsubishi.

the "sink/source" terminology as used by PLC vendors is often confusing since it could mean exactly opposite of what one may think it is. Japanese PLC manufacturers use "sinking" to describe external part of circuit (part that user has to wire). so sinking in this context it is also sometimes described as "NPN". the positive DC voltage at input is simply result of leakage current through pullup resistor. and when I/O point is "active", resulting voltage is close to zero. but this is because of used reference. when working with NPN circuits, positive supply is the reference and hence 0V. so "active" state of the I/I is -24V (that is negative).

Allen Bradley uses "sinking" to describe PNP I/O internally, so here digital input would have a pulldown resistor and sink the input current. TRUE state is obtained by applying positive voltage to the input. and this is what "PNP" input looks like.

PNP/NPN is also not really true since I/O may use mosfets, or a "PNP" output may still internally use an NPN transistor.

anyway...

back to your points.
1. this is a circuits forum but your topic will be better answered by a PLC forum.
2. your first two points are already mentioned.
3. your 3rd point - independent control of Y0 and Y1. you simply cannot cheat here. when you specify that this pair is PTO (pulse train output), then those two outputs work as a pair (pulse and direction). you cannot separate them and say Y0 will be used for pulses and Y1 is going to work as a separate output controlled by user program. that does not work on any PLC i have seen and i have seen plenty.

so how do you control Y1 in this case where Y0 is used to send pulses? you don't... that does not work. this is decided at the PLC configuration stage, before settings and program are transferred to PLC. and you cannot change it by PLC code during runtime.

but...

you can use PLC function to send position command to channel you use and that instruction will handle the direction.
so if you want to have Y1 in one state, you need to program (parametrize) your PTO and enable channel.

or...
do not use PTO. then Y0 and Y1 are regular outputs and you can use them any way you like - within limitations of you PLC scan. so if your scan time is 5mS, maximum frequency you can output is 100Hz. if you use PTO, then maximum frequency of the PTO is much higher (usually 10kHz - 100kHz)
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
30,557
have not worked with that brand but from what i have seen so far, it is a typical micro PLC (brick).
i have worked with similar products from other brands (Omron, Mitsubishi, AllenBradley, Siemens, Panasonic etc.). in fact this looks suspiciously similar to FX series Mitsubishi.
I have worked with most of them also and I have never seen any with NC closed loop, usually avaialble by special module add-on?
It claims it it can achieve a fully closed loop positioning control! ?
 

panic mode

Joined Oct 10, 2011
4,864
it depends on the product as there is plenty of variety. some may require module for this but that is not the rule. also performance varies.

Examples of brick PLCs with high speed I/O already integrated and function selectable (standard/high speed):

Allen Bradley
ML1100 (1763-L16BBB) 6 high speed inputs, 4 high speed outputs.
ML1400 (1766-L32AWA, 1766-L32BWA, 1766-L32BBB)

Mitsubishi
FX0, FX0N, FX1,FX1N, FX3 ... (lookup PLSY instruction)

Omron
CP1....
etc.
 
Last edited:
Top