585,959 active members*
4,761 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > KANALOG TO MACH3: FRO POT, MPG, Z encoder INPUT AND CODING
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2010
    Posts
    42

    KANALOG TO MACH3: FRO POT, MPG, Z encoder INPUT AND CODING

    Hello all,
    So i've retrofitted a old acer mill and built a pendent to control, using mach3 and Kflop/Kanalog.
    I'm not familiar with C programming so I've gotten myself in a pickle with Kflop so I'm looking for some help.

    I want to use an external poteniometer to control mach3's feed override, but I'm not sure of the inputs and code. I was thinking 5 volts, to Kanalog's JP6 and the same with the MPG. I've noted the examples in the C program directory but I cant really understand what the code means, though I've done some similar stuff with an arduino.
    What are the bit numbers to Kanalogs ADC JP6? is this to Kflop's Jp6? How do I code this into my Init file?

    A similar issue with a linear encoder to track the quill depth, this is just a 2 axis machine so it's okay if it's slow. Would the A/B of the encoder go to Kanalog's JP7 inputs?

    Any help is Appreciated!

    Thanks,
    T

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: KANALOG TO MACH3: FRO POT, MPG, Z encoder INPUT AND CODING

    Hi T,

    Could we convince you to try KMotionCNC instead? Mach3 is obsolete and we have example code for this. See SSOwithPot.c and FROwithPot.c examples.

    Otherwise with Mach3 you might write a Notification C Program to read a Kanalog ADC and place the reading in a persist variable. In Mach3 write Basic code to send a notification to the plugin to upload the value to a Mach3 DRO. Then use the value to set the SSO.
    TK
    http://dynomotion.com

  3. #3
    Join Date
    May 2012
    Posts
    537

    Re: KANALOG TO MACH3: FRO POT, MPG, Z encoder INPUT AND CODING

    +1 on using Kmotioncnc. It will do everything you want and works really well. More things to go wrong trying to integrate with mach 3.

  4. #4
    Join Date
    Mar 2010
    Posts
    42

    Re: KANALOG TO MACH3: FRO POT, MPG, Z encoder INPUT AND CODING

    Quote Originally Posted by TomKerekes View Post
    Hi T,

    Could we convince you to try KMotionCNC instead? Mach3 is obsolete and we have example code for this. See SSOwithPot.c and FROwithPot.c examples.

    Otherwise with Mach3 you might write a Notification C Program to read a Kanalog ADC and place the reading in a persist variable. In Mach3 write Basic code to send a notification to the plugin to upload the value to a Mach3 DRO. Then use the value to set the SSO.
    Okay, Thanks guys. I'll give Kmotion closer look.
    Still wondering where I can input these devices? And what bits to access them on Kanalog. JP6.

    Thanks

  5. #5
    Join Date
    Jun 2004
    Posts
    355

    Re: KANALOG TO MACH3: FRO POT, MPG, Z encoder INPUT AND CODING

    The ADCs don't have bit numbers. Bit numbers are only assigned to inputs/outputs that are digital (aka are only ever On/Off).

    To access the ADC's, within a C program, you use either ADC(x) where x is the channel number which returns the raw value in counts (-1023 to 1023 IIRC), or there is the option of using KANALOG_CONVERT_ADC_TO_VOLTS(ADC(x)), which will return the voltage. Which you use depends on what you're trying to achieve.

    To view the values in realtime, if you open KMotion, then click the Analog Status button (you'll need to make sure you have Kanalog selected in the Option menu), it will show the current values of all the ADC/DACs.


    Regarding the linear encoder, it should go to a suitable encoder input. It doesn't really matter what one, provided it's a matched A/B pair, as you'll need a bit C code to tell the KFlop how to handle the encoder, and you can use any channel for any axis.

  6. #6
    Join Date
    Mar 2010
    Posts
    42

    Re: KANALOG TO MACH3: FRO POT, MPG, Z encoder INPUT AND CODING

    Thanks Tom,
    I'll experiment with the example codes and ADC inputs.

Similar Threads

  1. Temperature sensor input to Kanalog?
    By mmurray70 in forum Dynomotion/Kflop/Kanalog
    Replies: 6
    Last Post: 09-16-2017, 04:12 AM
  2. Kanalog.Setting Line and Circle rotary encoder on one axis.
    By Smouk in forum Dynomotion/Kflop/Kanalog
    Replies: 13
    Last Post: 05-23-2015, 02:31 AM
  3. Kanalog Differential Encoder Setup - First Time
    By donb9261 in forum Dynomotion/Kflop/Kanalog
    Replies: 6
    Last Post: 08-21-2014, 06:10 PM
  4. Single ended encoder and Kanalog
    By Sancta in forum Dynomotion/Kflop/Kanalog
    Replies: 3
    Last Post: 04-14-2014, 10:24 AM
  5. Linear Glass Scale encoder with Kflop/Kanalog
    By PeterMouse in forum Dynomotion/Kflop/Kanalog
    Replies: 3
    Last Post: 03-24-2013, 05:14 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •