5 axis with step/dir and encoder

Moderators: TomKerekes, dynomotion

holgerstrahl
Posts: 6
Joined: Mon Jul 04, 2022 8:40 pm

5 axis with step/dir and encoder

Post by holgerstrahl » Mon Jul 04, 2022 9:37 pm

Hi,
How can I configure Kflop with Kanalog to control 5 axis with step/Dir in closed loop mode?
Best regards
Holger

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

Re: 5 axis with step/dir and encoder

Post by TomKerekes » Tue Jul 05, 2022 8:12 pm

Hi Holger,

Please be more specific on what types of Drives and Encoders you have.
Regards,

Tom Kerekes
Dynomotion, Inc.

holgerstrahl
Posts: 6
Joined: Mon Jul 04, 2022 8:40 pm

Re: 5 axis with step/dir and encoder

Post by holgerstrahl » Wed Jul 06, 2022 7:56 pm

Hi,
I use Leadshine EM705 and encoder with quadrature signal.
I tried the closed loop mode on kflop only with one axis and it worked.
When I tried to use the encoder inputs from kanalog connected to kflop, the closed loop mode fails.
Looks like the encoder signal is not passed through…
I wouldn’t mind useing the kflop encoder inputs but there are only 4 available when kanalog is connected.
So what to do with the 5th axis?
Best regards
Holger

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

Re: 5 axis with step/dir and encoder

Post by TomKerekes » Wed Jul 06, 2022 11:14 pm

Hi Holger,

Do you have differential or single ended encoders?

Do you need Kanalog?

The encoders can be multiplexed over to JP4 and JP6 so that would provide 8 single ended encoder inputs on those (4 each on the first 8 inputs). See example below.

Then 4 Step/Dir outputs from JP5.

Step/Dir Outputs 0-3 can be mux'ed to JP4 and JP6. ie Step/Dir #1 on JP4 pins 15 and 16 might be used for a 5th Step/Dir generator.

Code: Select all

#include "KMotionDef.h"

main()
{
	// Mux encoder inputs from KFLOP JP7 & JP5 to JP4 aand JP6
	FPGAW(ENC_NOISE_FILTER_ADD) = ENC_0_3_JP4 + ENC_4_7_JP6 + ENC_NOISE_FILTER_DEFAULT_VAL; 
}
Regards,

Tom Kerekes
Dynomotion, Inc.

holgerstrahl
Posts: 6
Joined: Mon Jul 04, 2022 8:40 pm

Re: 5 axis with step/dir and encoder

Post by holgerstrahl » Thu Jul 07, 2022 8:28 am

Hi Tom,

Thanks for the input.

I think my encoders are differential (TTL-RS422 standard).
But I thought it could be used single ended?

I need Kanalog some outputs and inputs (spindle control, sensor input, pump relais, ...)

Can I use 5V encoder inputs on JP4 and JP6?

If I am not able to use JP1 from Kanalog, would it be possible to use JP1 for other inputs and how?

Regards
Holger

holgerstrahl
Posts: 6
Joined: Mon Jul 04, 2022 8:40 pm

Re: 5 axis with step/dir and encoder

Post by holgerstrahl » Thu Jul 07, 2022 3:20 pm

Hi Tom,

I've tried your code example:

main()
{
FPGA(STEP_PULSE_LENGTH_ADD)=32 + 0x40;

FPGAW(ENC_NOISE_FILTER_ADD) = ENC_0_3_JP4 + ENC_4_7_JP6 + ENC_NOISE_FILTER_DEFAULT_VAL;
}

But the encoder channel 0 in Kmotion shows no input.
Any idea what is wrong?

Regards
Holger

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

Re: 5 axis with step/dir and encoder

Post by TomKerekes » Thu Jul 07, 2022 4:18 pm

Where did you wire the encoder?

Are bits 16 and 17 toggling on the Digital IO Screen?

Do you have an axis configured to use encoder 0?
Regards,

Tom Kerekes
Dynomotion, Inc.

holgerstrahl
Posts: 6
Joined: Mon Jul 04, 2022 8:40 pm

Re: 5 axis with step/dir and encoder

Post by holgerstrahl » Thu Jul 07, 2022 9:35 pm

Encoder is wired to JP4 Pin 5 and 6.
I think these are bit 16 and 17. Both a toggling on the Digital IO screen.
The oszi also shows a clear signal.

Axis input is set to encoder and the input channel is set to 0.

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

Re: 5 axis with step/dir and encoder

Post by TomKerekes » Fri Jul 08, 2022 5:22 pm

That should work.

Did you download and execute the code example to actually do the multiplex?

Did you set the encoder mode and channel 0 into KFLOP's parameters?

What Version are you using?

Have you Flashed anything into KFLOP?

What is an "oszi"? Oscilloscope?
Regards,

Tom Kerekes
Dynomotion, Inc.

holgerstrahl
Posts: 6
Joined: Mon Jul 04, 2022 8:40 pm

Re: 5 axis with step/dir and encoder

Post by holgerstrahl » Sat Jul 09, 2022 12:47 pm

Hi Tom,

Yes, I meant an oscilloscope.
I've found the problem. It works now.

I would have another question:
If I am using the Kflop inputs for encoder, is it possible to use the Kanalog encoder inputs for other general inputs?
Otherwise I would lose 10 input bits...

Thanks and best regards
Holger

Post Reply