Beginner: Connecting a standard MPG to KFlop/KStep

Moderators: TomKerekes, dynomotion

Post Reply
GS76
Posts: 20
Joined: Sun Mar 04, 2018 2:50 pm

Beginner: Connecting a standard MPG to KFlop/KStep

Post by GS76 » Sat Feb 29, 2020 3:02 pm

Hi all,

I want to connect a standard MPG to the KFlop, please see the wiring description/diagram in the attachment. I am using it on my 3-axis milling machine with a spindle, KStep driving the stepper motors.

I am not an electronic technician/engineer, so I would require a KISS description, please!!

Thank you.
Attachments
Standard_MPG.PNG

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

Re: Beginner: Connecting a standard MPG to KFlop/KStep

Post by TomKerekes » Sat Feb 29, 2020 4:29 pm

See here.
Regards,

Tom Kerekes
Dynomotion, Inc.

GS76
Posts: 20
Joined: Sun Mar 04, 2018 2:50 pm

Re: Beginner: Connecting a standard MPG to KFlop/KStep

Post by GS76 » Sun Mar 01, 2020 6:59 am

Thank you, Tom,

However, I still do not know where to start.

Let me explain my confusion:

1. "JP7 - GPIO" is used to connect to KStep. Therefore, should I use JP4 or JP6 pin-outs?
KFlop_Pinouts.PNG
2. Where do I assign the pinouts and which c code sample could I use? See below.
MPG c examples.PNG
The KFlop and KStep are excellent, and I am delighted to have purchased it. However, it is not always easy to set-up as a beginner.

Any further assistance would be much appreciated.

Regards,

Gary

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

Re: Beginner: Connecting a standard MPG to KFlop/KStep

Post by TomKerekes » Sun Mar 01, 2020 4:57 pm

Hi Gary,
1. "JP7 - GPIO" is used to connect to KStep. Therefore, should I use JP4 or JP6 pin-outs?
Yes. Let's assume you use JP6

2. Where do I assign the pinouts and which c code sample could I use? See below.
The first step is to decide whether you want to use a KFLOP hardware encoder input (and if one is available) or whether you will count the MPG pulses in software. Hardware is better and faster but requires connection to dedicated pins on KFLOP. With software any inputs can be used.

Let's assume hardware. The following code (from the MuxEncoders.c example) will move 4 encoder inputs to JP6:

Code: Select all

	// Mux encoder inputs from KFLOP JP5 to JP6
	FPGAW(ENC_NOISE_FILTER_ADD) = ENC_4_7_JP6 + ENC_NOISE_FILTER_DEFAULT_VAL; 
Inputs IO26 and IO27 will now cause encoder channel 4 to count. So connect the MPG A B signals to these inputs. Configure some KFLOP axis (I'll assume you choose Axis 4) as Encoder Input Mode and Input Channel 0 = 4. After this the Axis Screen should show the Axis 4 Position changing when the MPG is rotated.

Here is something similar from one of the Wiring diagrams in the wiki (KFLOP+SnapAmp DC Brush Motors with MPG). Note some of the wire colors and signals are different from yours but you should be able to get the idea:

MPG-JP6.png

MPGServiceSmoothHardwareEncFilteredRev3.c is probably the best example. Modify the defines for your situation. Then include the modified program into your Initialization C Program and add a call to the ServiceMPG() from your forever loop.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

GS76
Posts: 20
Joined: Sun Mar 04, 2018 2:50 pm

Re: Beginner: Connecting a standard MPG to KFlop/KStep

Post by GS76 » Sun Mar 01, 2020 5:32 pm

Thank you Tom,

I will try this out and let you know if I have trouble.

Sorry one other thing quickly, where can I purchase a male plug for JP6 or JP4?

Thank you very much.

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

Re: Beginner: Connecting a standard MPG to KFlop/KStep

Post by TomKerekes » Sun Mar 01, 2020 5:37 pm

Hi Gary,

See the wiki. But I think you want a female connector.
Regards,

Tom Kerekes
Dynomotion, Inc.

GS76
Posts: 20
Joined: Sun Mar 04, 2018 2:50 pm

Re: Beginner: Connecting a standard MPG to KFlop/KStep

Post by GS76 » Sun Mar 01, 2020 5:48 pm

Thank you Tom,

Much appreciated.

Jungeljon
Posts: 1
Joined: Mon May 25, 2020 5:17 am

Re: Beginner: Connecting a standard MPG to KFlop/KStep

Post by Jungeljon » Wed May 27, 2020 5:36 pm

Is it possible to use momentary switches for x1 x100 & XYZ select? Or does the program need an logic high or low trough out the whole procedure?

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

Re: Beginner: Connecting a standard MPG to KFlop/KStep

Post by TomKerekes » Wed May 27, 2020 7:08 pm

Hi Jungeljon,

The MPG C programs normally expects the inputs to be set while moving to set the Factor of movement. You could change it to "remember" the last button pushed by simply not changing the Factor unless an input is active.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply