Beginner: Connecting a standard MPG to KFlop/KStep
Moderators: TomKerekes, dynomotion
Beginner: Connecting a standard MPG to KFlop/KStep
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.
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.
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Beginner: Connecting a standard MPG to KFlop/KStep
See here.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Beginner: Connecting a standard MPG to KFlop/KStep
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?
2. Where do I assign the pinouts and which c code sample could I use? See below.
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
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?
2. Where do I assign the pinouts and which c code sample could I use? See below.
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
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Beginner: Connecting a standard MPG to KFlop/KStep
Hi Gary,
Let's assume hardware. The following code (from the MuxEncoders.c example) will move 4 encoder inputs to JP6:
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:
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
Yes. Let's assume you use JP61. "JP7 - GPIO" is used to connect to KStep. Therefore, should I use JP4 or JP6 pin-outs?
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.2. Where do I assign the pinouts and which c code sample could I use? See below.
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;
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:
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.
Tom Kerekes
Dynomotion, Inc.
Re: Beginner: Connecting a standard MPG to KFlop/KStep
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.
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.
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Beginner: Connecting a standard MPG to KFlop/KStep
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Beginner: Connecting a standard MPG to KFlop/KStep
Thank you Tom,
Much appreciated.
Much appreciated.
Re: Beginner: Connecting a standard MPG to KFlop/KStep
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?
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Beginner: Connecting a standard MPG to KFlop/KStep
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
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.
Tom Kerekes
Dynomotion, Inc.