Retrofit CNC to this saw with kflop? - Page 2


Page 2 of 3 FirstFirst 123 LastLast
Results 13 to 24 of 33

Thread: Retrofit CNC to this saw with kflop?

  1. #13
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2998
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    Hi Greg,

    Amazing machine.

    I need 5VDC for Kflop, from wiki an old PC power supply should do the trick.
    A PC Power supply may work but usually isn't the best choice because it is designed for much higher power (ie 300W vs 10W) and usually isn't isolated from earth GND. Consider a small, regulated, isolated 10W 5V power supply that usually costs around $10.

    I need 5VDC to power the differential encoders. Should I power the encoders from JP8 pins 13-16(as shown here)? The specs for the encoders say each has <20mA load, so 40mA max for both. The linked doc says max of 100mA, so should be OK.
    That should be ok

    Any recommendations for cabling from Kanalog to the encoders? Outdoor rated cat6? The distance from where kflop/Kanalog will be and the encoders are ~ 35', and second ~ 50'. Are there problems having the differential encoders mounted that far away from kflop/kanalog?
    That distance should be usable with differential signals. Make sure to use twisted pairs for each differential signal pair. The wire should be shielded with the shield connected to Kanalog DC GND on the Kanalog end only. Kanalog has moderate termination resistance across the + to - signals on board of 400 ohms. You might want to add additional termination of 180ohms.

    HTH
    Regards



  2. #14
    Registered
    Join Date
    Apr 2007
    Location
    Canada
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    Hi,
    OK I have finally got around to trying this on one axis... I think I have a fundamental misunderstanding somewhere with respect to V, A, J and counts, or perhaps the axis moves too slow to get enough information in 3.5 seconds to tune it. Any suggestions appreciated.

    I used this thread here Anilam/ supermax Frankenstein, along with the Wiki as a guide for the steps to take to get an axis up and going.

    I can use the console and issue DAC0 commands and they work as they should (DAC0=-2048 gives me full speed on the motor, DAC0=0 gives 0rpm, and DAC0=2047 gives full speed in opposite direction).

    On the Axis screen Position counts up and down the expected amount, if the axis moves 10mm I get 10mm of counts.

    VFD motor configuration:
    - VFD reference is Analog input in "Joystick mode", which means it accepts -10v to +10v. The analog input is connected to Kanalog DAC0.
    - The VFD gives the user control over acceleration and deceleration times, I have set the acc time to 0.1 second (I've tried 0.5 sec and 1 sec), the acceleration ramp is set to linear. I've used the console screen to test issuing a command -2048 waiting a bit then back to 2047, the response seems reasonable, there are no long delays.

    Based on the what the VFD is telling me the motor is responding well and I'm not see anything that indicates 1 sec to accelerate isn't happening. When I issue a DAC0=-2047 command I see the counts on the axis screen appear to start instantly.
    - Max RPM is 3600.

    The Mechanical configuration:
    - 7mm lead screw
    - 900:1 gear reduction
    - 19:36 chain drive ratio
    - Final ratio = 475:1
    - 3600 rpm @ motor = 7.58 rpm @ screw

    7mm pitch screw, linear distance = 7mm/rev x 7.58rev/min = 53.05mm/min

    Encoder:
    My encoders spec says 11.53 pulses per mm, this seems to equate to ~46.12 counts/mm (11.53 x4) as shown on the Axis Position screen. ie If I zero the axis, then move the axis 10mm and I see approx 461 counts.

    Initial V,A, J settings:
    Velocity setting:
    53.05mm/min / 60secs/min * 46.12 counts/mm = 40.78 counts/sec

    Acceleration setting:
    I've used 1 second for full acceleration as a starting point, so that should mean 40.78 counts/sec2.

    Jerk setting:
    10x acceleration as a start = 400 counts/sec2


    When I start with this with a P of 1 I see very small values being sent to the DAC. I figured it would go right to 2047, changing A and J didn't seem to make a difference until I put the P way up.

    Not really knowing better I've messed around to try to get it to do a move of 10 counts. Since that is about what the system can do 3.5 seconds.

    And it doesn't look pretty, but it at least ends up where it started.
    Attached are screen shots of the plots plus the data.
    I could configure the VFD to run the motor at a max of 7600 RPM (double the current speed) as I've tested it that high, but I would never be cutting at those speeds. But if it would help I can do it.
    Any help appreciated.

    Attached Thumbnails Attached Thumbnails Retrofit CNC to this saw with kflop?-c_p_o_vs_time-png   Retrofit CNC to this saw with kflop?-pe_o_vs_time-png   Retrofit CNC to this saw with kflop?-firstattempt-jpg   Retrofit CNC to this saw with kflop?-xaxis_encoder_006-jpg  

    Retrofit CNC to this saw with kflop?-xaxis_encoder_007-jpg   Retrofit CNC to this saw with kflop?-xaxis_encoder_003-jpg  
    Attached Files Attached Files


  3. #15
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    22938
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    Quote Originally Posted by Greg9504 View Post


    Cabling/Distance
    - Any recommendations for cabling from Kanalog to the encoders? Outdoor rated cat6? The distance from where kflop/Kanalog will be and the encoders are ~ 35', and second ~ 50'. Are there problems having the differential encoders mounted that far away from kflop/kanalog?
    My choice is Belden 9891 for encoder cable, it is hard to buy in short lengths and expensive, but is has 4 twisted pairs, each pair individually shielded with a overall braid shield. One pair is larger gauge for the power.
    I earth ground my supplies for equi-potential bonding and noise reduction.
    I wouldn't use a PC. P.S. if I were you.
    Al.

    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  4. #16
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2998
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    Hi Greg,

    I think you are right the machine is so slow that it may be difficult to tune with the 3.5 second max capture rate of the Step Response Screen. For longer times you can capture data to a disk file with a User Program and plot it with something like Excel. See the example CaptureXYMotionPosDest.c.

    From the plots you can see ~1 sec delay between when the output (green) changes until rate of the position (red) starts to show the commanded speed. Possibly due to all the backlash in the system?

    If you did a move of like 40 counts you might see the response to a motion in one direction. But overall it looks to me like it might meet your needs as is.

    With only a P gain of 170 this means that if the Output needs to be at 1700 DAC counts to move at the commanded speed then a steady state position error of 10 counts will be required to get the necessary output. If this is a problem then a tiny amount of I Gain could be used to drive the steady state error to zero over a period of say 10 seconds.

    HTH
    Regards



  5. #17
    Registered
    Join Date
    Apr 2007
    Location
    Canada
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    Hi,

    Thanks for the feedback. Yes I'm seeing around 0.7s of delay, I'm not sure if there is much I can do about it. The chain is probably a little lose but not sure if that contributes to the delay.

    I played around a bit more and yes giving it larger counts it does move and come back. Here is a video showing a 30mm move with a ruler, there is a bit of hunting when it returns to 0 (30cm on the ruler), perhaps overshooting by 1/2mm then hunting (my video is not the most accurate method of measuring). I did set deadband range to 4 but left the gain at 1, I'll trying lowering the dead band gain... I assume that is what I should be using to help with the hunting?



    For longer times you can capture data to a disk file with a User Program and plot it with something like Excel. See the example CaptureXYMotionPosDest.c.
    I think I would like to try this, just to get a better idea how things are behaving. After I configured the user program (I haven't looked at running the any C code yet), it will run when I use the move command in the step response screen?

    With only a P gain of 170 this means that if the Output needs to be at 1700 DAC counts to move at the commanded speed then a steady state position error of 10 counts will be required to get the necessary output. If this is a problem then a tiny amount of I Gain could be used to drive the steady state error to zero over a period of say 10 seconds.
    I'm not sure I follow this. Need to think about it some...

    One interesting thing I just tried, I set the VFD up to allow a max speed of 7200 RPM, then only changed the V setting (doubling it to 80). Movement became very unstable. It just continually overshot and hunted back and forth by large amounts. I just went back to max RPM of 3600 and V of 40 instead of trying to make it work. On edit... ok just read what you wrote in the referenced thread above about P gain:

    With a P gain of 1 a change of 1 encoder count will change the DAC output by 1 DAC count (small voltage). With a P Gain of 10 a change of 1 encoder count will change the DAC output by 10 DAC Counts (bigger voltage). So the chances that the system will be able to come to a balance and "sit still" is less.
    So since I increased the max speed of the VFD, with the higher max speed each DAC count results in greater speed change. If I increase the max speed I should decrease the gain. And the reason I needed so much P gain to begin with is because I have relatively low encoder counts compared to typical systems. Now I understand why when I first started to test I was seeing very small DAC output (was using very low gain).


    Eventually my goal is to be able to cut shapes out, like letters. From what you see so far does it look like this is going to work? It will just be 2 axis, the other axis uses the same encoder.

    Thanks.

    Last edited by Greg9504; 08-02-2016 at 12:31 AM.


  6. #18
    Registered
    Join Date
    Apr 2007
    Location
    Canada
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    Quote Originally Posted by Al_The_Man View Post
    My choice is Belden 9891 for encoder cable, it is hard to buy in short lengths and expensive, but is has 4 twisted pairs, each pair individually shielded with a overall braid shield. One pair is larger gauge for the power.
    I earth ground my supplies for equi-potential bonding and noise reduction.
    I wouldn't use a PC. P.S. if I were you.
    Al.
    Thanks Al, I ended up finding some CAT 7 cable on ebay, turns out it is made (or at least warehoused) here in Ottawa. It has a fully braided shield, each pair foil wrapped, drain wire, and is rated for outdoor use. Hyperline | Shielded Twisted Pair Cable (SSTP), Category 7 (600 MHz), 4 pairs, Solid, Outdoor, 23 AWG, FR-PVC - Hyperline it does use solid core wire, so probably not good for something that is in motion.

    I'm using Lumberg 0322 and 0332 series connectors, shielded and IP68 rated, https://ca-en.alliedelec.com/lumberg-0322-07/70151640/

    The power supply is a DIN rail 5VDC 3A, https://ca-en.alliedelec.com/mean-we...20-5/70293828/

    Hopefully the wires and power supply should be good for keeping interference a non issue.



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

    Default Re: Retrofit CNC to this saw with kflop?

    Hi Greg,

    I played around a bit more and yes giving it larger counts it does move and come back. Here is a video showing a 30mm move with a ruler, there is a bit of hunting when it returns to 0 (30cm on the ruler), perhaps overshooting by 1/2mm then hunting (my video is not the most accurate method of measuring). I did set deadband range to 4 but left the gain at 1, I'll trying lowering the dead band gain... I assume that is what I should be using to help with the hunting?
    Its hard to say how much of the hunting is caused by the backlash or by the servo being somewhat unstable. I suspect the 900:1 gear reduction amplifies any backlash in the gears. Adding deadband should help. Using a deadband gain of 1 will not act any different than with no deadband range so try a small gain of 0.1 or 0.

    I'm not sure I follow this. Need to think about it some...

    One interesting thing I just tried, I set the VFD up to allow a max speed of 7200 RPM, then only changed the V setting (doubling it to 80). Movement became very unstable. It just continually overshot and hunted back and forth by large amounts. I just went back to max RPM of 3600 and V of 40 instead of trying to make it work. On edit... ok just read what you wrote in the referenced thread above about P gain:
    Changing the VFD range doubled the loop gain. So you might have reduced the P gain by 1/2 to get similar dynamic response.

    So since I increased the max speed of the VFD, with the higher max speed each DAC count results in greater speed change. If I increase the max speed I should decrease the gain. And the reason I needed so much P gain to begin with is because I have relatively low encoder counts compared to typical systems. Now I understand why when I first started to test I was seeing very small DAC output (was using very low gain).
    Yes I believe that is exactly correct. Again some small amount of I gain usually works well in slow systems like this to drive the error near zero.

    Eventually my goal is to be able to cut shapes out, like letters. From what you see so far does it look like this is going to work? It will just be 2 axis, the other axis uses the same encoder.
    I would think so. How big would the letters be? What precision would you expect?

    Regards



  8. #20
    Registered
    Join Date
    Apr 2007
    Location
    Canada
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    I would think so. How big would the letters be? What precision would you expect?
    I'm hoping for +/- a mm say in a cutting a letter that is 150mm high... I would like to be able to cut much larger shapes too.

    When I saw the move of 300mm go out and return to 0 I figured that was good, but I guess there is more to it than that. Is the difference between the command and position what I see referred to as "following error" and is it that, that determines accuracy?

    I created a C program to log the data over a 300 count move. I've attached the program, and the output data. Can you verify what I've done for the move is similar to what is done on the Step Response screen. I have a delay after the first move, perhaps I shouldn't have that there. I should probably only write every 10th data point (or maybe even less)... as it's 244444 samples. Excel is a bit sluggish plotting the data.

    What I did was save the setup to an C program, load that in thread1, execute it, then loaded the move/log program in thread2 and execute it from within KMotion using the C Program window.

    The attached data and plot are not using any I gain yet. One other thing, the velocity that I'm testing at is the max speed for moving the stone into position (I guess this is called Jog), I would never cut at that velocity. Max cutting speed would be half. Should I try tuning with the Motion Profile - Velocity on the Step Response screen set to the lower cutting speed (20 counts/sec instead of 40 it is now)?

    Thanks again.

    Code:
    #include "KMotionDef.h"
    
    main()
    {	
    	double T0;
    	double* p = gather_buffer;
    			
    	int i,n_Samples = 20 / TIMEBASE;
    	printf("Gathering %d samples...\n",n_Samples);
    	gather.Inject = FALSE;	// Don't inject any Data anywhere
    
    	gather.list[0].type = GATHER_DOUBLE_TYPE;  
    	gather.list[0].addr = &ch0->Dest;
    
    	gather.list[1].type = GATHER_DOUBLE_TYPE; 
    	gather.list[1].addr = &ch0->Position;
    
    	gather.list[2].type = GATHER_FLOAT_TYPE; 
    	gather.list[2].addr = &ch0->Output;
    
    	gather.list[3].type = GATHER_END_TYPE;  
    	
            gather.bufptr = gather_buffer;//(double *)0xfffffffc;   // force more than endbuf    
    	gather.endptr = gather_buffer + 3 * n_Samples;
        
            printf("Zeroing axis\n");
            Zero(0);
    	printf("Starting move...\n");
    	TriggerGather();  // start capturing data	
            Delay_sec(0.2);	
    	MoveRel(0,300); // Start a motion
    	while (!CheckDone(0));
    	printf("First move complete.\n");
    	Delay_sec(0.2);
    	MoveRel(0,-300);
    	while (!CheckDone(0));
    	printf("Second move complete.\n");	
    	while (!CheckDoneGather()) ; // what till all captured
    	printf("Move and capture done, writing data to disk...\n");
    	Zero(0);
    	FILE *f=fopen("d:\\temp\\kflopdata.txt","wt");
    
    	
            if (f!=NULL)
    	{
    		//Sample,Time,Command,Position,Output
    		fprintf(f,"Sample,Command,Position,Output\n");
    		for (i=0; i<n_Samples; i++)
    		{
    			// round times to neaarest servo tick
    			//p[0] = ((int)(p[0]/TIMEBASE + 0.5))*TIMEBASE;
    			fprintf(f,"%d,%f,%f,%f\n",i,p[0],p[1],p[2]);
    			p += 3;
    		}
    		fclose(f);
    	}
    	else
    	{
    		printf("Error opening file.\n");
    	}
    	printf("Finished writing file.\n");
    	
    	
    }


    Attached Thumbnails Attached Thumbnails Retrofit CNC to this saw with kflop?-300countmovandreturnplot-jpg  
    Attached Files Attached Files
    Last edited by Greg9504; 08-04-2016 at 01:05 AM.


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

    Default Re: Retrofit CNC to this saw with kflop?

    Hi Gred,

    Well done. But it looks like the Output is saturated during the move so the motion you are testing is just a little too fast for your system and the servo isn't capable of making any adjustments..

    Since you don't need or want to capture data every 90us you might use a User Program like the example:

    CaptureXYMotionPosDest.c

    The "4" in this line:

    for (k=0; k<4; k++) WaitNextTimeSlice();

    can be used to skip N 180us time slices between samples.

    Regards



  10. #22
    Registered
    Join Date
    Jun 2005
    Location
    USA
    Posts
    1350
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    That is a very cool machine man. Nice job

    Russ



  11. #23
    Registered
    Join Date
    Apr 2007
    Location
    Canada
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    Hi,

    OK after getting the logging app working I've been playing with the tuning of the axis a bit more. I think where I'm at is pretty good, but I don't have the knowledge to know. I reduced my acceleration to 3 counts/sec^2 which seemed to help things, then from there I added I Gain to bring the position error down. I have a little bit of oscillation when motion starts or changes direction.

    I've attached a command,position,output vs time and a position error, output vs time plot. Also played around a bit with plotting velocity, not sure it's the best way. Right now every 200 points I calculated the velocity over those points (so average) and use a "stair step" plot, so it's a bit delayed.

    Should I assume this is good enough for now and move on to tuning my other axis? If not any suggestions for improving the tuning?
    Code:
            ch0->Vel=40;
    	ch0->Accel=3;
    	ch0->Jerk=50;
    	ch0->P=170;
    	ch0->I=0.03;
    	ch0->D=0;
    	ch0->FFAccel=0;
    	ch0->FFVel=0;
    	ch0->MaxI=2000;
    	ch0->MaxErr=200;
    	ch0->MaxOutput=2047;
    	ch0->DeadBandGain=0.1;
    	ch0->DeadBandRange=4;
    Thanks.

    Attached Thumbnails Attached Thumbnails Retrofit CNC to this saw with kflop?-v40a3j50p170i0-03maxi2000maxerr200maxoutput2047_novel-jpg   Retrofit CNC to this saw with kflop?-v40a3j50p170i0-03maxi2000maxerr200maxoutput2047_error-jpg   Retrofit CNC to this saw with kflop?-v40a3j50p170i0-03maxi2000maxerr200maxoutput2047-jpg  
    Attached Files Attached Files


  12. #24
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2998
    Downloads
    0
    Uploads
    0

    Default Re: Retrofit CNC to this saw with kflop?

    Hi Greg,

    Looking here:

    Retrofit CNC to this saw with kflop?-tk3values-kfp-png

    you can see at T=28 seconds the output saturates at maximum for about a full second and there is no encoder motion at all. So there is nothing the servo can do to avoid lagging behind. With any integrator gain the average error must be zero. So if the system lags behind it must overshoot to make the average zero. I assume there is backlash in the system? It looks to follow within ~ 10 counts. Is that acceptable to you?

    Reducing the Deadband Range would help reduce the error. I assume you added that to help with dithering?

    Regards

    P.S. I love your Plot program. We intend to include it in the next Version.



Page 2 of 3 FirstFirst 123 LastLast

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

Retrofit CNC to this saw with kflop?

Retrofit CNC to this saw with kflop?