Page 1 of 2

5 axis with step/dir and encoder

Posted: Mon Jul 04, 2022 9:37 pm
by holgerstrahl
Hi,
How can I configure Kflop with Kanalog to control 5 axis with step/Dir in closed loop mode?
Best regards
Holger

Re: 5 axis with step/dir and encoder

Posted: Tue Jul 05, 2022 8:12 pm
by TomKerekes
Hi Holger,

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

Re: 5 axis with step/dir and encoder

Posted: Wed Jul 06, 2022 7:56 pm
by holgerstrahl
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

Re: 5 axis with step/dir and encoder

Posted: Wed Jul 06, 2022 11:14 pm
by TomKerekes
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; 
}

Re: 5 axis with step/dir and encoder

Posted: Thu Jul 07, 2022 8:28 am
by holgerstrahl
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

Re: 5 axis with step/dir and encoder

Posted: Thu Jul 07, 2022 3:20 pm
by holgerstrahl
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

Re: 5 axis with step/dir and encoder

Posted: Thu Jul 07, 2022 4:18 pm
by TomKerekes
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?

Re: 5 axis with step/dir and encoder

Posted: Thu Jul 07, 2022 9:35 pm
by holgerstrahl
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.

Re: 5 axis with step/dir and encoder

Posted: Fri Jul 08, 2022 5:22 pm
by TomKerekes
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?

Re: 5 axis with step/dir and encoder

Posted: Sat Jul 09, 2022 12:47 pm
by holgerstrahl
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