Connection about the KStep and Photoelectric switch

Moderators: TomKerekes, dynomotion

Yuhu_Li
Posts: 6
Joined: Tue Jun 10, 2025 6:45 am

Connection about the KStep and Photoelectric switch

Post by Yuhu_Li » Tue Jun 10, 2025 7:27 am

Hi Tom,

I am a PhD student supervised by Professor Yang Xu, and I have a problem with the circuit connection.

I want to connect some photoelectric switch to the KStep as a limit switch for motor movement. But I don't know if the circuit is correct or not.

In the circuit, I try to use the 12V output pin from KFlop(JP4 PIN 2) to connect the Opto Anode from KStep(JP33 PIN 8), the other 12V output pin from KFlop(JP6 PIN 2) is used to power the photoelectric switch. The GND of photoelectric switch is connect the JP33 PIN 26, and the KFlop and KStep are connected by the JP7 and JP36, the 12V power is connected to the KFlop by the JR1.The sketch is shown as below.

Image
Image

Could you please help me?

Best regards,
Yuhu Li

User avatar
TomKerekes
Posts: 2786
Joined: Mon Dec 04, 2017 1:49 am

Re: Connection about the KStep and Photoelectric switch

Post by TomKerekes » Tue Jun 10, 2025 5:23 pm

Hi Yuhu,

Your images didn't post. Please re-post them.

You aren't describing any connection to any of KStep's Opto Input pins.

With a voltmeter check From JP33 Pins 8 to 9 (for Opto IN 0). Does it show approximately 0 or 12V as the Opto is interrupted?

But using your method the Inputs would not be opto isolated from KStep or KFLOP. It would be better to use a separate isolated 12 or 24V supply for the limit switches.
Regards,

Tom Kerekes
Dynomotion, Inc.

Yuhu_Li
Posts: 6
Joined: Tue Jun 10, 2025 6:45 am

Re: Connection about the KStep and Photoelectric switch

Post by Yuhu_Li » Wed Jun 11, 2025 3:14 am

Hi Tom,

The picture might be caused by the internet problem, so I change another one.

Image
Image

Could you see them?

The connection about the KStep's Opto Input pins is the pin 9 and the photoelectric switch's black line.

Yuhu_Li
Posts: 6
Joined: Tue Jun 10, 2025 6:45 am

Re: Connection about the KStep and Photoelectric switch

Post by Yuhu_Li » Wed Jun 11, 2025 6:20 am

Hi Tom,

The KFlop and the KStep are connected from the pin 2(JP4) to the pin8(JP33) to provide the +12v.
(In the circuit, I try to use the 12V output pin from KFlop(JP4 PIN 2) to connect the Opto Anode from KStep(JP33 PIN 8))

I try to check the voltage from JP33 Pins 8 to 9 (for Opto IN 0) by a voltmeter, and it didn't show anything, then the KFlop board isn't work.

I don't know what happened, and is the KFlop board burned(the 2 led isn't Shiny and the DSP part is hot)?

Is that something wrong? And how could I fix it?

Best regards,
Yuhu Li

User avatar
TomKerekes
Posts: 2786
Joined: Mon Dec 04, 2017 1:49 am

Re: Connection about the KStep and Photoelectric switch

Post by TomKerekes » Wed Jun 11, 2025 4:39 pm

Hi Yuhu,

I think that should work although as I said that will defeat the isolation between KFLOP and the opto inputs.

Unfortunately you must have shorted something and damaged KFLOP. That's another reason to have the 12V isolated from KFLOP circuitry. If you disconnect everything from KFLOP and only apply +5V and KFLOP's LEDs don't flash then KFLOP has been damaged. It's not cost effective to repair KFLOPs. You'll need to replace it. Contact sales@dynomotion.com and we can give you an educational discount.
Regards,

Tom Kerekes
Dynomotion, Inc.

Yuhu_Li
Posts: 6
Joined: Tue Jun 10, 2025 6:45 am

Re: Connection about the KStep and Photoelectric switch

Post by Yuhu_Li » Thu Jun 19, 2025 8:15 am

Hi Tom,

Thanks for your reply.

Now I want to connect the KStep and the Photoelectric switch by your suggestion. But I have another question for this picture.

Image

I didn't deeply understand this part of the description. Is the 10K ohm series resistance already embedded in KSTEP ? How could I use it ?

The manual said "Shorting any of the OPTO- pins to GND will activate the input.", is that mean I need to short a not used pin to connect the GND pin(like the pin 24 connect to pin 26(GND), and I normally use the pin 10 to pin 23 to accept the signal from the photoelectric switch)?

Besides, I want to ask another question, about the 2 KStep connection. If I use a KFlop connect 2 KStep, How could I use the pins with same name, like the IO 168 Input from two KStep.

And now we have the Grating ruler to Closed Loop control the system. But how could I use them, I mean it own 6 wires to transfer the signals, which pins should be connected and how can I get the synthesized position signal to Closed Loop control the system?

Image

Best regards,
Yuhu Li
06/19/2025

User avatar
TomKerekes
Posts: 2786
Joined: Mon Dec 04, 2017 1:49 am

Re: Connection about the KStep and Photoelectric switch

Post by TomKerekes » Sun Jun 22, 2025 11:42 pm

Is the 10K ohm series resistance already embedded in KSTEP ? How could I use it ?
Yes. The resistor limits the current so that when 24V is applied the LED has enough current to turn on but doesn't have too much to burn out.

This image in the Help shows how to wire the supply and switches. Note the GNDs shown are different from KFLOP or KSteps GNDS

Switches.png

about the 2 KStep connection. If I use a KFlop connect 2 KStep, How could I use the pins with same name, like the IO 168 Input from two KStep.
The extra IO on the 2nd KStep is not useable.

And now we have the Grating ruler to Closed Loop control the system. But how could I use them, I mean it own 6 wires to transfer the signals, which pins should be connected and how can I get the synthesized position signal to Closed Loop control the system?
Your encoder has differential outputs. KFLOP doesn't have any differential inputs. But the encoder might be connected the KFLOP's single ended encoder inputs by just connecting the 3 + signals and leaving the 3 - signals unconnected. There should also be a KFLOP GND. Single ended signals are more noise susceptible than differential inputs. Our Kogna Controller has differential inputs. You might read this.

How many motors, encoders, and KSteps do you need to use?
Regards,

Tom Kerekes
Dynomotion, Inc.

Yuhu_Li
Posts: 6
Joined: Tue Jun 10, 2025 6:45 am

Re: Connection about the KStep and Photoelectric switch

Post by Yuhu_Li » Fri Jul 04, 2025 2:51 pm

Dear Tom,

Thanks for your advice.

But I have another question.

Why the board always report the "SETBITDIRECTION169=0 Error:Expecting value 0 to 167 "?

I connect the 12v to the pin 8, and the GND to the pin 10, the Dynomotion program screen shows the 169 IO is checked, but the console always report the wrong message like this, when I use the program I developed to get the KM_IO object. The program is "kM_IO_Upper = KM.GetIO(169, IO_TYPE.DIGITAL_IN, "switch_Upper");"

I try to check the code by vs, but I just found the original code about the UpdateIOType() function. It seems that send a message to the board to "SETBITDIRECTION169=0", but why it will report the 167 IO? Does the 167 IO represent the pin 8 ? But it should be 1 when I connect the 12V to it.

Best regards,
YUHU LI
07/04/2025

User avatar
TomKerekes
Posts: 2786
Joined: Mon Dec 04, 2017 1:49 am

Re: Connection about the KStep and Photoelectric switch

Post by TomKerekes » Fri Jul 04, 2025 7:06 pm

Hi Yuhu,

You are correct that is a bug. Bit 169 is not bi-directional. It is fixed as an input so setting the direction is not required. Bit 167 is also not bi-directional but KFLOP silently ignores any attempt to set the direction.

Attached is a patch for Version 5.4.0 to the .NET Library that will not try to set the bit's direction. Copy to the \KMotion\Release folder. Also attached is the changed source file if you need it.
Does the 167 IO represent the pin 8 ? But it should be 1 when I connect the 12V to it.
No, Pin 8 is not an input. It is the anode of all the opto couplers. Bit 167 is a bit on our Kanalog Board.

Please let us know if that resolves the problem.
Attachments
KM_IO.cs
(8.42 KiB) Downloaded 1 time
KMotion_dotNet.dll
(186 KiB) Downloaded 1 time
Regards,

Tom Kerekes
Dynomotion, Inc.

Yuhu_Li
Posts: 6
Joined: Tue Jun 10, 2025 6:45 am

Re: Connection about the KStep and Photoelectric switch

Post by Yuhu_Li » Mon Jul 07, 2025 8:22 am

Dear Tom,

Thanks for your reply. The problem is solved by the new DLL.

By the way, I got the new problem about the program. When I use the function "Abort()" of the KM_CoordMotion, it seems no effect.

The motion is still running. But when I use the EStop() function, it could stop the motion and disable the axis.

The program is as shown. And I try to read the IsAbort attribute, it is "True".

if (currentValue_Upper != false)
{
KM.CoordMotion.Abort();
this.up_Switch_Condition.BackColor = Color.Red;

}

Best regards,
Yuhu Li
07/07/2025

Post Reply