Dynomotion

Group: DynoMotion Message: 4515 From: mrosenfield2 Date: 4/7/2012
Subject: SoftLimits3Axis.c
Tom,
You referred to SoftLimits3Axis.c in an earlier post. Where would I find this code? I looked through the c programs I got with KMotion428, but I don't see it there.

Thanks,
Michael Rosenfield
Group: DynoMotion Message: 4516 From: Tom Kerekes Date: 4/7/2012
Subject: Re: SoftLimits3Axis.c
Hi Michael,
 
See attached.
 
Regards
TK

Group: DynoMotion Message: 4517 From: Michael Rosenfield Date: 4/7/2012
Subject: Re: SoftLimits3Axis.c [1 Attachment]
Thanks, Tom.
So, how does this get combined with the MDI software, for instance? Do I just put the sections sequentially after for(;;) or WaitNextTimeSlice(); as they are written individually?
 
Michael
Group: DynoMotion Message: 4518 From: Tom Kerekes Date: 4/7/2012
Subject: Re: SoftLimits3Axis.c
Hi Michael,
 
Well you have to merge the two loops into one bigger loop in such a way that there is only one WaitNextTimeSlice() per loop.  I'm not sure how familiar you are with programming concepts.  A common mistake of non-programmers is to add one forever loop after another forever loop without realizing that because the CPU will remain in the first loop forever the second loop will never be executed.
 
Regards
TK 

Group: DynoMotion Message: 4519 From: Michael Rosenfield Date: 4/7/2012
Subject: Re: SoftLimits3Axis.c
I'm rusty on C but current on PIC assembly language programming. Just a little fuzzy on how the various sections of KFlop and KmotionCNC code talk to each other.
But you said essentially what I meant about merging.
So can I stick the code from softlimits WaitNextTimeSlice section just after the code from the MDI WaitNextTimeSlice section?

Second question: There is an Init button and a Home button in KMotionCNC, and I found where the link to each routine goes. But the default link calls program.c - an ascii file, not a compiled binary file. So how does this work?
Third question: Does the MDI and SoftLimit code go in its own program, or can it be stuck at the end of the Init program?
Forth question: If the Home routine is separate from the Init routine does this require separate programs, or are there separate entry points available?
 
Thanks,
Michael
Group: DynoMotion Message: 4520 From: Tom Kerekes Date: 4/7/2012
Subject: Re: SoftLimits3Axis.c
Hi Michael,
 
#1 Yes
 
#2 The button references the acsii C program.  It is automatically compiled, downloaded, and executed
 
#3 It is added to the end of the Init Program.
 
#4 The Home program should be a separate program
 
Regards
TK

Group: DynoMotion Message: 4523 From: Michael Rosenfield Date: 4/8/2012
Subject: Re: SoftLimits3Axis.c
Thanks, Tom.
It's practically acting like a mill now!
I have the Home function and the Init function working, except that axis 3 moves very slowly with KMotionCNC, but works the way it should with KMotion. I have attached the Init file - do you see anything wrong?

Regards,
Michael 
Group: DynoMotion Message: 4530 From: Michael Rosenfield Date: 4/9/2012
Subject: Re: SoftLimits3Axis.c


Thanks, Tom.
It's practically acting like a mill now!
I have the Home function and the Init function working, except that axis 3 moves very slowly with KMotionCNC, but works the way it should with KMotion. I have attached the Init file - do you see anything wrong?

Regards,
Michael 

 
  @@attachment@@
Group: DynoMotion Message: 4531 From: Tom Kerekes Date: 4/9/2012
Subject: Re: SoftLimits3Axis.c [1 Attachment]
Hi Michael,
 
What do you have the KMotionCNC | Tool Setup | Trajectory Planner Settings for X set at?  What speed does it move?  For what command?  G0?  G1?  Jogging?
 
Regards
TK 

Group: DynoMotion Message: 4532 From: Michael Rosenfield Date: 4/9/2012
Subject: Re: SoftLimits3Axis.c
I'll have to check tomorrow. I haven't changed the TP settings from the default. So far, I have only jogged the axes slow, fast, and various steps (0.01". 0.1"). X, Y, and quill operate as I would expect, and move the correct step distances. With fast jog, the knee moves maybe 1/10 of the speed it moves with a 1000 or 4000 count move in KMotion. Its encoder is 40,000 counts/inch.
 
Regards,
Michael
 
Group: DynoMotion Message: 4533 From: Michael Rosenfield Date: 4/10/2012
Subject: Re: SoftLimits3Axis.c
Attachments :
Tom,
I guess the TP settings expain what I'm seeing!
Question is - where did TP get this info? It got XYZ correct, but not A.
 
Thanks,
Michael
 
Group: DynoMotion Message: 4534 From: TK Date: 4/10/2012
Subject: Re: SoftLimits3Axis.c [1 Attachment]
Hi Michael,

It is up to you to set the parameters. 

TK

On Apr 10, 2012, at 8:47 AM, Michael Rosenfield <mrosenfield@...> wrote:

 

Tom,
I guess the TP settings expain what I'm seeing!
Question is - where did TP get this info? It got XYZ correct, but not A.
 
Thanks,
Michael
 
Group: DynoMotion Message: 4535 From: Michael Rosenfield Date: 4/10/2012
Subject: Re: SoftLimits3Axis.c
Guess I forgot...
 
Thanks, Tom!
 
Michael
 
Group: DynoMotion Message: 4538 From: Michael Rosenfield Date: 4/10/2012
Subject: Re: SoftLimits3Axis.c
Tom,
I set the parameters, and now the A axis is working fine.
So I tried running some g code - just a simple cube.
Using KMotionCNC, the X & Z axis work as expected (axis 0 & 2).  The Y axis (axis 1) tries to move, and shuts down. However, it works as expected in KMotion.
Even weirder, though, is that a G1 Y1 or G1 Y0.1 cause this shut down, but if the axis has moved, a G1 Y0 does NOT cause the error, and it moves back to 0.
How can I tell what is going on here?
 
Thanks,
Michael
 
Group: DynoMotion Message: 4542 From: Tom Kerekes Date: 4/11/2012
Subject: Re: SoftLimits3Axis.c
Hi Michael,
 
Not sure what you mean by "shuts down". Disabled?  If so check the KMotion Console Screen for any message.
 
It is possible that if an axis is marginally tripping a following error limit then moving one direction vs the other may behave differently.
 
You didn't include your settings, but it may be that you need to decrease the acceleration for the KMotionCNC Trajectory planner.   Coordinated motion (G1,G2,G3) is 2nd order (infinite Jerk) motion.  Where in KMotion you are probably testing smoother Jerk limited 3rd order motion.  This is why there are two independent set of profile settings.  Or not only smoother you may have the Jerk set so slow that for certain length moves you aren't even achieving max acceleration.  To test how well your system can make 2nd order "infinite Jerk" moves in KMotion set the Jerk o a huge value (1000X of the Acceleration value).
 
Regards
TK

Group: DynoMotion Message: 4543 From: Michael Rosenfield Date: 4/11/2012
Subject: Re: SoftLimits3Axis.c
Attachments :
Can I run KMotion and KMotionCNC at the same time?
Yes, the axis is disabled. I can tell because it starts drifting - the associated analog output sits at about 45 mV when the position loop is not closed, and the axis moves slowly.
I have attached the TP settings (axis A is set differently, but not being used currently).
If I want to change the gain of an axis, can I edit the text of Init.c with a text editor? Will KMotionCNC compile or interpret it when I click the INIT button?
 
Thanks,
Michael
 
Group: DynoMotion Message: 4545 From: Tom Kerekes Date: 4/11/2012
Subject: Re: SoftLimits3Axis.c [1 Attachment]
Hi Michael,
 
Yes you can run KMotion.exe and KMotionCNC.exe at the same time.
 
Yes it looks like you forgot to set the accelerations.  They are set quite high at 30 in/sec2.  For the Y axis with a resolution of  20,000 counts/inch that would be
 
30 x 20000 = 600000 counts/sec2
 
I see in a previous email you were testing in KMotion with a value of 80000 counts/sec2.
 
Yes you can edit the Init.c file and any changes will be applied the next time you click the INIT button.  Be aware in this case that the screen values in KMotion may not have the same values so for example if different values are in KMotion and you push the "Move" button to download those the results will then be different.  I'm afraid it is a bit confusing.  We made this video to help explain the relationships:
 
 
Regards
TK
 

Group: DynoMotion Message: 4547 From: Michael Rosenfield Date: 4/11/2012
Subject: Re: SoftLimits3Axis.c
Excellent! That makes things clearer.
I'll go try this on the machine this afternoon.
Thanks, TK.
 
Michael
 
Group: DynoMotion Message: 4548 From: Michael Rosenfield Date: 4/11/2012
Subject: Re: SoftLimits3Axis.c
OK, that solved the problem! I'll probably have to do some fine tuning, but it's cutting air now!
Thanks for all your help!

Michael