KFLOP in CL Step Mode - Output Instability - Page 2


Page 2 of 2 FirstFirst 12
Results 21 to 29 of 29

Thread: KFLOP in CL Step Mode - Output Instability

  1. #21
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP in CL Step Mode - Output Instability

    It doesn't seem like the internet has too many shielded ribbon cables or "close double ended" IDC26 cables readily available.
    Like I just posted I think you would need to crimp that on yourself. Even if you don't have a crimp tool a vise or even pliers can do it if you are careful.


    Should I connect my DIY shielding to Gnd? This whole assembly sits in a plastic box, so I'm not exactly sure where/what I would ground it to.
    Shields are usually best connected to the GND reference of the receiver. In that case it would be KFLOP GND. With the other end open.

    Regards
    TK http://dynomotion.com


  2. #22
    Member
    Join Date
    Nov 2014
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP in CL Step Mode - Output Instability

    Sorry for the rapid fire replies, but I also found this on Amazon (Faraday Fabric Tape 2.4inch x 82feet Double Sided Conductive Cloth Adhesive Tape). Seems like it's wide enough to just about wrap all the way around my ribbon cables.
    I guess same question as before, would I need to ground it and to where?

    https://www.amazon.com/dp/B08J42YTDF



  3. #23
    Member
    Join Date
    Nov 2014
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP in CL Step Mode - Output Instability

    Quote Originally Posted by TomKerekes View Post
    Like I just posted I think you would need to crimp that on yourself. Even if you don't have a crimp tool a vise or even pliers can do it if you are careful.
    Ope, sorry must have missed that part. I'll look into Crimp on connectors for a 26 pin ribbon cable. There may be something I can press on "inline", rather than having to replace two connectors at the end.

    Quote Originally Posted by TomKerekes View Post
    Shields are usually best connected to the GND reference of the receiver. In that case it would be KFLOP GND. With the other end open.
    Ok perfect thank you. This should be easy enough to do on either side of the shield.

    Thanks again! I'll keep trying, hopefully this will do the trick.



  4. #24
    Member
    Join Date
    Jan 2018
    Location
    United Kingdom
    Posts
    1516
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP in CL Step Mode - Output Instability

    Quote Originally Posted by akmolski View Post
    It doesn't seem like the internet has too many shielded ribbon cables or "close double ended" IDC26 cables readily available. I might just try to DIY this,
    An option is use these instead of ribbon: (If it fits in the space).
    https://www.cnc4pc.com/adapter-db25.html
    A simple IDC26 to DB25 small adapter. Then run a shielded DB25 cable which should be easier to come by.




  5. #25
    Member
    Join Date
    Nov 2014
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP in CL Step Mode - Output Instability

    Ok, I think I figured out a software filter to help me look for persistent signals and ignore narrow spikes with a modification of the ExternalButtons.c example. It seems to work, but I wanted to take a second and see if you think there are reasons not to go this route. There is the delay in the response of my limit switches, but I don't plan on traveling faster than 120IPM. I haven't done the math yet, but the response seems to be almost instantaneous and I've got some play in my switches for the extra travel.

    The code I used is below:

    Code:
    #include "KMotionDef.h"
    
    
    #define INXLIMITBIT 6  //Bit connected to Limit Switch
    #define OUTXLIMITBIT 48  //Bit monitored by Kflop for Limit Activation
    
    
    // function prototypes for compiler
    int Debounce(int n, int *cnt, int *last, int *lastsolid);
    
    
    // state variables for switch debouncing
    int xlast=0,xlastsolid=-1,xcount=0;
    
    
    main()
    {
    	int result;
    
    
    	for (;;) // loop forever
    	{
    		WaitNextTimeSlice();
    
    
    			// Handle Limit X
    		result = Debounce(ReadBit(INXLIMITBIT),&xcount,&xlast,&xlastsolid);
    		if  (result == 1)
    		{
    			SetBit(OUTXLIMITBIT);
    		}
    		else if (result == 0)
    		{
    			ClearBit(OUTXLIMITBIT);
    		}
    	}
    }
    
    
    // Debounce a bit
    //
    // return 1 one time when first debounced high
    // return 0 one time when first debounced low
    // return -1 otherwise
    #define DBTIME 300
    
    
    int Debounce(int n, int *cnt, int *last, int *lastsolid)
    {
    	int v = -1;
    
    
    	if (n == *last)  // same as last time?
    	{
    		if (*cnt == DBTIME-1)
    		{
    			if (n != *lastsolid)
    			{
    				v = *lastsolid = n;  // return debounced value
    			}
    		}
    		if (*cnt < DBTIME)	(*cnt)++;
    	}
    	else
    	{
    		*cnt = 0;  // reset count
    	}
    	*last = n;
    	return v;
    }
    During testing I ran into some odd behavior from the control loop. After completing a Move command from the Console it would oscillate quickly around Zero. Like shown below. Which value could I adjust to fix this? I tried playing around with 'Freq' in the 2nd Order Low Pass Filter, but it didn't seem to make a difference after Downloading to the Kflop.

    KFLOP in CL Step Mode - Output Instability-screen-shot-07-14-21-07-56-a

    Attached Thumbnails Attached Thumbnails KFLOP in CL Step Mode - Output Instability-screen-shot-07-14-21-07-56-a  


  6. #26
    Member
    Join Date
    Nov 2014
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP in CL Step Mode - Output Instability

    Quote Originally Posted by dazp1976 View Post
    An option is use these instead of ribbon: (If it fits in the space).
    https://www.cnc4pc.com/adapter-db25.html
    A simple IDC26 to DB25 small adapter. Then run a shielded DB25 cable which should be easier to come by.

    Thx for the suggestion Daz, I might end up doing something like this with a custom connector where I can arrange the appropriate Pin out. It seems like my little software filter is doing the trick for now.



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

    Default Re: KFLOP in CL Step Mode - Output Instability

    During testing I ran into some odd behavior from the control loop. After completing a Move command from the Console it would oscillate quickly around Zero. Like shown below. Which value could I adjust to fix this? I tried playing around with 'Freq' in the 2nd Order Low Pass Filter, but it didn't seem to make a difference after Downloading to the Kflop.
    1 count dither. See here.

    Regards
    TK http://dynomotion.com


  8. #28
    Member
    Join Date
    Nov 2014
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by TomKerekes View Post
    1 count dither. See here.
    Yup,thank you Tom. The Deadband fixed it. Also sorry for asking questions you already answered. Either my browser or the forum was being weird. I didn't see some of your replies from the 14th until I logged on just now. Maybe I just missed them... Anyway thanks for all the help!

    My Init program is working perfectly although I'll need to try and minimize the delay in the Denounce filter. Right now the axes overshoot the switch quite a bit at 120IPM. Not catastrophic, but I could see it causing damage under certain circumstances. I'll try to insulate my wires and throw on that filter cap this week, then maybe I can lose the software filter.

    To be honest it feels great to have a machine that's moving again! Even if not everything is working yet. I modified the SimpleHoming program adding a part to turn off then renable soft limits and that part is working well.

    Is there a way to minimize how much KMotionCNC overshoots the soft limits? I know in Mach3 there's a zone next to each Soft Limit where the motor starts to slow down and tapers the speed down to zero at the actual limit.

    I also wired up an EStop directly to my Gecko in NC mode. It has a NO wire which I'll try to send to the Kflop through the opto, so I can enable a software EStop command as well. I'm curious if that signal will go through before the axis shuts down due to Following Error. We'll see!

    Oh and lastly I picked up this neat handheld oscilloscope to test for noise in my digital signals, 60Mhz bandwidth. Not sure how to use this yet, but there's videos on that I'm sure. I kindof feel like a doctor at the dawn of medical science when they first realized there's all these germs and bacteria causing deseases. I know there's a problem but the source was invisible to me without proper equipment!

    Anyway thanks again, I'm a stones throw away from having a fully functioning CNC machine once more and I can't wait to get back to work. Couldn't have done it without your help.



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

    Default Re: KFLOP in CL Step Mode - Output Instability

    Very good thanks for your patience.

    Is there a way to minimize how much KMotionCNC overshoots the soft limits? I know in Mach3 there's a zone next to each Soft Limit where the motor starts to slow down and tapers the speed down to zero at the actual limit.
    There is an example AdjustSoftLimits.c that contains a function to stop based on acceleration and velocity to properly stop at the SoftLimits and AdjustSoftLimitsTest.c can be used to test it. After it is working it can be added to the forever loop in your Init Program.

    Regards
    TK http://dynomotion.com


Page 2 of 2 FirstFirst 12

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

KFLOP in CL Step Mode - Output Instability

KFLOP in CL Step Mode - Output Instability