SpindleOnCWJogDir.c not working :'(

Moderators: TomKerekes, dynomotion

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

Re: SpindleOnCWJogDir.c not working :'(

Post by TomKerekes » Fri May 07, 2021 9:23 pm

Hi Francos,

Not sure what you mean by digit. The two muxes are each controlled by a single bit. See KMotionDef.h for the definitions.

Each bit muxes 4 encoder inputs to the first 8 IO bits on JP4 or JP6
Regards,

Tom Kerekes
Dynomotion, Inc.

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: SpindleOnCWJogDir.c not working :'(

Post by cemoa9 » Sat May 08, 2021 3:33 pm

Hello Tom,

Have been through KmotionDef.h, better but still not fully clear for me, lets try with example :

FPGAW(ENC_NOISE_FILTER_ADD) = ENC_0_3_JP4 + ENC_NOISE_FILTER_DEFAULT_VAL;

In this case :

which encoder channel is muxed? (from 0 to 3 ?)
what is the filter ? (ENC_NOISE_FILTER_DEFAULT_VAL? and here I could put whatever number until 255?)
where to connect the encore A B signal (JP4 IO 16&17 ch0, 18&19 ch1, 20&21 ch2, 22&23 ch3 ?)

Then since I need only one channel to be muxed, could it be :
FPGAW(ENC_NOISE_FILTER_ADD) = ENC_0_0_JP4 + 42; ?
With IOs and JP4 to be used 16 & 17?

Cordially

Francois

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

Re: SpindleOnCWJogDir.c not working :'(

Post by TomKerekes » Sat May 08, 2021 4:07 pm

Hi Francos,
FPGAW(ENC_NOISE_FILTER_ADD) = ENC_0_3_JP4 + ENC_NOISE_FILTER_DEFAULT_VAL;

In this case :

which encoder channel is muxed? (from 0 to 3 ?)
correct

what is the filter ? (ENC_NOISE_FILTER_DEFAULT_VAL? and here I could put whatever number until 255?)
correct. It is defined as 7 in KMotionDef.h as below which allows counting at ~ 2MHZ.

#define ENC_NOISE_FILTER_DEFAULT_VAL 7 // noise rejection filter default value (100MHz/3/7/2 = 2MHz)

where to connect the encore A B signal (JP4 IO 16&17 ch0, 18&19 ch1, 20&21 ch2, 22&23 ch3 ?)
correct

Then since I need only one channel to be muxed, could it be :
FPGAW(ENC_NOISE_FILTER_ADD) = ENC_0_0_JP4 + 42; ?
With IOs and JP4 to be used 16 & 17?
No. The FPGA is programmed to mux the encoders in 2 groups of 4. There are only 2 bits to control the muxing. Bits 8 and 9 as deined in KMotionDef.h as:

#define ENC_0_3_JP4 0x200
#define ENC_4_7_JP6 0x100

It shouldn't matter if the other 3 are also muxed or not if they are not being used.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: SpindleOnCWJogDir.c not working :'(

Post by cemoa9 » Thu May 13, 2021 2:17 pm

Hello Tom,

Done and works fine, thank you for your precious support !

Cordially

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

Re: SpindleOnCWJogDir.c not working :'(

Post by TomKerekes » Fri Sep 10, 2021 4:17 pm

Great. :) Thanks for taking the time to post back.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply