Kanalog help with limit switch please?


Results 1 to 10 of 10

Thread: Kanalog help with limit switch please?

  1. #1
    Registered
    Join Date
    Jan 2017
    Location
    United Kingdom
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Kanalog help with limit switch please?

    Hello,

    I've just started playing with a Kanalog board and I'd be grateful if you could help me with making a single mechanical N/C limit switch work with Kanalog. I've connected it as per the picture. I just want to Kill the Motor Drive when the switch is open, or pause the code, whatever, I just want to see some reaction, but unfortunately nothing is happening.

    I have removed the RJ45 cable that connects to Kflop and used it to wire up one single stepper initially, call it the X axis.
    When I opened the configuration window in Kmotion I can't find IO36 in the Output Channels, so I configured it instead in the init C file, ch0->OutputChan0=36; The stepper is working perfectly fine in KmotionCNC.

    I then went back to the Configuration window and set up the Limit Switch options: "Watch Limit" "bit No. 136", and copy/pasted the relevant lines of code from the clipboard to the init C file.

    In the Digital I/O window, all the Kanalog OPTO IN are ticked ON. If I flick the limit switch on and off, nothing happens, I have it set to Kill the Motor Drive.

    Apart from wiring the limit switch as per the photo, am I missing something silly , like some other wire to ground perhaps?

    Here is the init:
    #include "KMotionDef.h"


    void main()
    {
    ch0->OutputMode=STEP_DIR_MODE;
    ch0->Vel=10000.000000;
    ch0->Accel=20000.000000;
    ch0->Jerk=1000000.000000;
    ch0->InputChan0=0;
    ch0->OutputChan0=36;

    ch0->LimitSwitchOptions=0x10f;
    ch0->LimitSwitchNegBit=136;
    ch0->LimitSwitchPosBit=136;
    ch0->SoftLimitPos=100000;
    ch0->SoftLimitNeg=-100000;

    EnableAxisDest(0,0);


    DefineCoordSystem(0,1,2,-1);


    FPGA(STEP_PULSE_LENGTH_ADD)=50; // 3 usec = max 166khz


    return;
    }



    Many thanks.
    Edward

    Similar Threads:
    Attached Thumbnails Attached Thumbnails Kanalog help with limit switch please?-limit-jpg  


  2. #2
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Hi Edward,

    OutputChan0=36; is invalid. I suppose by some luck it works. You should specify the Step/Direction Generator and Mode. Not the IO number. See:

    Channels Channels Channels - Dynomotion

    and

    Step and Direction Setup

    The wiring for the Opto Input looks all correct.

    Is the Enable LED on Kanalog on? If not there is no communication with Kanalog. Kanalog requires too much power for USB power. Make sure you have a +5V supply for KFLOP/Kanalog good for at least 2 Amps.

    Regards

    Regards
    TK http://dynomotion.com


  3. #3
    Registered
    Join Date
    Jan 2017
    Location
    United Kingdom
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Thank you Tom, all is well now.

    In the Configuration window I have now set the Step/Dir generator to 4, 5 and 6 (I'm using the JP5 socket) for the respective channels 0,1 and 2. This concept was a little convoluted to understand, but once I saw your linked diagram, I think I got it, as it's all working as it should.

    Regarding the limits, I compiled a little list of the code lines for each limit switch possibility and then simply used the line of code appropriate for my needs, in this case the relevant line was ch0->LimitSwitchOptions=0x122; which I pasted to the init file, together with the soft limit code lines, and all the other stuff, etc. Then after compiling/downloading, I committed the INIT file in thread1 to User Memory so that it stays there next time I recycle.

    Thank you for the pointers.

    Regards,

    Edward



  4. #4
    Registered
    Join Date
    Jan 2017
    Location
    United Kingdom
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Now that the Kanalog limits question has been resolved, I have moved on to the DAC output which will control the 0-10V of the VFD/spindle speed.

    I haven't connected the VFD yet, or any relays for spindle on/off, but I wanted to do some basic tests beforehand. For example, I would like to measure the voltage across DAC output0 and ground using a little test G-code




    I put my meter between DAC0 and GND and it doesn't read any voltage whilst the g-code is playing. Shouldn't it?

    I checked the Analog IO window and it shows this:



    I also set the Tool setup window as per your sample:




    So I have two questions:

    -How can I check the DAC output voltage, just to reassure me that everything is working fine before I start wiring the VFD?

    -How can I map the 24000 revs in the G-code S command (these are the spindle max revs) to correspond with the max 10V analog output? I read this in your spindle set up instructions:

    " The assumption in this case is that an S value of 1000RPM would correspond to -2047 DAC counts or +10V. And the allowed range is from -2047 to 0 counts (0V to +10V)."

    Obviously I am missing something and I would be grateful for some pointers.

    Edward

    Attached Thumbnails Attached Thumbnails Kanalog help with limit switch please?-screen3-jpg   Kanalog help with limit switch please?-screen1-jpg   Kanalog help with limit switch please?-screen2-jpg  
    Last edited by E_Edwards; 09-04-2017 at 02:07 PM.


  5. #5
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Hi Edward,

    You should be able to check the DAC0 Output with a Voltmeter as you describe. When the Analog IO Screen indicates DAC0 is at 9.995V that is approximately what you should read with the Voltmeter. Note a common mistake is to connect your meter to the top of the screw terminals. If the screw is not tightened it may not have any connection. You can also command DAC voltages from the Console Screen with something like DAC0=-2000.

    The scale is a multiplier to convert RPM to DAC counts.

    RPM x Scale = DAC

    in your case 24000RPM = 10V = -2047 DAC Counts so:

    24000 x Scale = -2047

    Therefore Scale = -0.0853

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  6. #6
    Registered
    Join Date
    Jan 2017
    Location
    United Kingdom
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Bingo! Such a silly thing! Yes, as you correctly say, I had simply put the meter ends on the top of the screws and I was getting no reading. As soon as I tightened the relevant screws, a reading was obtained!

    The scale calculation is also good. So for example, at 12000revs, I measure 5.04V.

    Many thanks.

    Edward

    Last edited by E_Edwards; 09-04-2017 at 05:17 PM.


  7. #7
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Cool. Thanks for posting back.

    Regards

    Regards
    TK http://dynomotion.com


  8. #8
    Registered
    Join Date
    Jan 2017
    Location
    United Kingdom
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Here is a quick basic diagram of what I have tested today before I start to add more things, like servo enable, alarm, more limit sensors, analogue spindle control, fuses, etc.

    At this early stage, my objective was to test that the e-stop would halt the g-code whilst simultaneously gently stopping the spindle via the solid state relay. Ditto for the proximity sensor. Kmotion detects the changed status of the IO switch and halts the g-code and additionally in KmotionCNC (tool setup--M0 - M30)) I set up the Feedhold button to watch IO bit number 152 (relay driver0) and set it to 0 when feedhold occurs. So, I'm happy so far. I know what you are probably going to say, that an e-stop should cut off power to basically everything, but lets's ignore this at this stage.

    My question this time is: in the picture I have two 24V dc power supplies. The reason is that I wanted to separate the two circuits, as I read that if I used one psu to supply both circuits, I would lose the benefit of the opto isolation for the limits. If that is the case, does it matter? I would like to make do with just one 24dc psu, just for simplicity really, as small psu's are inexpensive.

    Thank you.

    Edward



    Attached Thumbnails Attached Thumbnails Kanalog help with limit switch please?-initial_circuit-jpg  


  9. #9
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Hi Edward,

    Yes I would use separate supplies for the Isolated and non isolated circuits. Otherwise you couple maybe 100ft of limit switch wiring running all over the machine picking up who knows what directly int KFLOP+Kanalog Gnd.

    Otherwise if your SSR will work with 5V you might use that.

    Or use an Opto Ouput instead of the Relay driver to drive the SSR

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  10. #10
    Registered
    Join Date
    Jan 2017
    Location
    United Kingdom
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Re: Kanalog help with limit switch please?

    Hi Tom,

    Thank you. I like the idea of using one of the opto outputs for the relay, thus using only one 24v supply, so more homework for me to do

    Regards,

    Edward



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Kanalog help with limit switch please?

Kanalog help with limit switch please?