Allocating encoder inputs

Moderators: TomKerekes, dynomotion

Post Reply
RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Allocating encoder inputs

Post by RogerFroud » Fri Apr 30, 2021 10:01 am

I've finally bitten the bullet and ordered a KFLOP and KANALOG setup for my Milling Machine that has Linear Encoders. However, I don't want to have a messy interface between the 9 Way 'D' connectors on the Encoders, so I'm designing a small PCB that goes along the edge where JP1/JP2 are which will have 9 Way 'D' connectors on it and route the wires to suitable pins such that the whole thing can be screwed down to make it robust.

I see from the KANALOG documentation that typically the A&B channels go to JP1 and the Z channels to JP2. However, that's really inconvenient because it would be much bettter to connect all of the three channels for each encoder to pins that are nearby. I'm not sure why it's typically done that way, that doesn't make sense to me.

So it is possible to say connect the three encoders sequentially, overflowing to JP2 for just the last Z channel as follows...

A1 to JP1.1
/A1 to JP1.2
B1 to JP1.3
/B1 to JP1.4
Z1 to Jp1.5
/Z1 to Jp1.6

A2 to JP1.7
/A2 to JP1.8
B2 to JP1.9
/B2 to JP1.10
Z2 to Jp1.11
/Z2 to Jp1.12

A3 to JP1.13
/A3 to JP1.14
B3 to JP1.15
/B3 to JP1.16
Z3 to Jp2.1
/Z3 to Jp2.2

Alternatively, is it acceptable to split the allocations freely between JP1 & JP2? In other words, are there restrictions on how these are allocated in the software?

Any help would be much appreciated.

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

Re: Allocating encoder inputs

Post by TomKerekes » Fri Apr 30, 2021 3:04 pm

Hi Roger,

No that wouldn't work. The AB outputs of an encoder must be connected to the AB inputs of the same encoder channel. Not the A input of one channel and the B of another. Z outputs can be connected to any unused A or B input.

Any KFLOP axis can be configured to use any encoder counter. See also.
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Allocating encoder inputs

Post by RogerFroud » Fri Apr 30, 2021 6:59 pm

TomKerekes wrote:
Fri Apr 30, 2021 3:04 pm
Hi Roger,

No that wouldn't work. The AB outputs of an encoder must be connected to the AB inputs of the same encoder channel. Not the A input of one channel and the B of another. Z outputs can be connected to any unused A or B input.

Any KFLOP axis can be configured to use any encoder counter. See also.
Ok, thanks for that. I see that you need to keep the A&B channels together for counting, so could I do the following, which keeps the A&B together, but uses an A channel for the encoder 1 Z, and a B channel for the encoder 2 Z?

A1 to JP1.1
/A1 to JP1.2
B1 to JP1.3
/B1 to JP1.4
Z1 to Jp1.5
/Z1 to Jp1.6

Z2 to Jp1.7
/Z2 to Jp1.8
A2 to JP1.9
/A2 to JP1.10
B2 to JP1.11
/B2 to JP1.12

A3 to JP1.13
/A3 to JP1.14
B3 to JP1.15
/B3 to JP1.16
Z3 to Jp2.1
/Z3 to Jp2.2

Here's another arrangement that could work even more neatly for my PCB. This only uses the A channels for the Z channel...

A1 to JP1.1
/A1 to JP1.2
B1 to JP1.3
/B1 to JP1.4
Z1 to Jp1.5
/Z1 to Jp1.6

JP1.7 & JP1.8 unused

A2 to JP1.9
/A2 to JP1.10
B2 to JP1.11
/B2 to JP1.12
Z2 to Jp1.13
/Z2 to Jp1.14

JP1.15 & JP1.16 unused

A3 to JP2.1
/A3 to JP2.2
B3 to JP2.3
/B3 to JP2.4
Z3 to Jp2.5
/Z3 to Jp2.6

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

Re: Allocating encoder inputs

Post by TomKerekes » Fri Apr 30, 2021 7:33 pm

Those should work.
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Allocating encoder inputs

Post by RogerFroud » Sat May 01, 2021 8:57 am

Many thanks, that fills in a lot of the blanks. So can I summarise the restrictions on allocating Encoder inputs as follows...

1) You must use channels A&B from the same numbered channel.
2) You can allocate them in any order. ie you don't need to start with channel 0 and allocate them sequentially.
3) You can leave gaps in the allocation, ie the X axis can use channel 2 and the Y axis can use channel 5
4) You can freely allocate any spare A or B channel as a Z reference channel in any order.
5) You can use both say channel A6 for the Z input associated with channel 0, and channel B6 for the Z input associated with channel 1. In other words, channels used for Z inputs are truly separate, the fact they happen to be labelled A&B of the same channel doesn't mean they are connected together when used as reference channels.

I know this sounds like I'm labouring the point, but I've been caught out before, particularly when using Microcontrollers where pin restrictions can be a huge problem unless you fully understand them.

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

Re: Allocating encoder inputs

Post by TomKerekes » Sat May 01, 2021 12:28 pm

NP. Yes that is all correct.
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Allocating encoder inputs

Post by RogerFroud » Sat May 01, 2021 1:22 pm

Excellent! Many thanks for your patience.

Post Reply