C axis AC servo info
Moderators: TomKerekes, dynomotion
C axis AC servo info
i want to direct drive a 2.5KW AC servo for my lathe spindle and have indexing also
this will have typical A,B,Z encoder input and dual dac output
i have no idea which C program to start with on this. completely beginner
my first question would be about this line in the dualdac program
"DefineCoordSystem(0,-1,2,-1);"
is the last channel in there the C or would it be A?
would it not be more like this?
DefineCoordSystem(0,-1,2,-1,-1,6);
also not sure about the kmotion screen showing A axis with the X and Y
i might have to get some experience with the editor on that
this will have typical A,B,Z encoder input and dual dac output
i have no idea which C program to start with on this. completely beginner
my first question would be about this line in the dualdac program
"DefineCoordSystem(0,-1,2,-1);"
is the last channel in there the C or would it be A?
would it not be more like this?
DefineCoordSystem(0,-1,2,-1,-1,6);
also not sure about the kmotion screen showing A axis with the X and Y
i might have to get some experience with the editor on that
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: C axis AC servo info
Hi turbothis,
Will you need to sometimes use it as a regular free spinning Spindle? If so you might create two C Programs to add and remove it from the Coordinate System and assign those to M Code Actions.
I assume you mean you wish to drive the Spindle Axis like an A Axis Servo to certain angles?i want to direct drive a 2.5KW AC servo for my lathe spindle and have indexing also
this will have typical A,B,Z encoder input and dual dac output
i have no idea which C program to start with on this. completely beginner
Will you need to sometimes use it as a regular free spinning Spindle? If so you might create two C Programs to add and remove it from the Coordinate System and assign those to M Code Actions.
Amy first question would be about this line in the dualdac program
"DefineCoordSystem(0,-1,2,-1);"
is the last channel in there the C or would it be A?
The standard 4 Axis Screen shows XYZA. If you don't want to see the Y Axis you will need to create a custom Screen with the Screen Editor and Hide the Axes you don't want.also not sure about the kmotion screen showing A axis with the X and Y
i might have to get some experience with the editor on that
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: C axis AC servo info
morning bump 4 answer.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: C axis AC servo info
Hi turbothis,
The angular axes operate over +/- infinity.
You can use an MCode to reset the commanded destination to modulo 360 degrees. See the Modulo360.c example.
The angular axes operate over +/- infinity.
You can use an MCode to reset the commanded destination to modulo 360 degrees. See the Modulo360.c example.
Code: Select all
#include "KMotionDef.h"
#define CNTS_PER_DEG 1000.0
#define AXISA 4
double modf(double, double*); // returns integer part with more han 32-bit precision
double floor(double x) // truncate down toward -ininity
{
double y;
return (modf(x, &y) < 0 ? y - 1 : y);
}
main()
{
double dest = chan[AXISA].Dest;
double cnts = CNTS_PER_DEG * 360.0;
EnableAxisDest(AXISA, dest - (floor(dest/cnts)) * cnts);
}
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: C axis AC servo info
awesome!
getting ready to start my weekend of tweaking on this
getting ready to start my weekend of tweaking on this
Re: C axis AC servo info
how would i use this program?
add it to my main axis enable program or into the spindle jog?
add it to my main axis enable program or into the spindle jog?
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: C axis AC servo info
Hi turbothis,
Configure an MCode to execute this program. Add the MCode into your GCode wherever you wish to reset the Position.how would i use this program?
add it to my main axis enable program or into the spindle jog?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: C axis AC servo info
i set this as M100 in kmotioncnc
i ran it through and downloaded in kmotion
if i command M100 in the MDIm bar it should read up to 360 and start over right?
it does not now
i ran it through and downloaded in kmotion
if i command M100 in the MDIm bar it should read up to 360 and start over right?
it does not now
Code: Select all
#include "KMotionDef.h"
#define CNTS_PER_DEG 32.97907
#define AXISA 4
double modf(double, double*); // returns integer part with more han 32-bit precision
double floor(double x) // truncate down toward -ininity
{
double y;
return (modf(x, &y) < 0 ? y - 1 : y);
}
main()
{
double dest = chan[AXISA].Dest;
double cnts = CNTS_PER_DEG * 360.0;
EnableAxisDest(AXISA, dest - (floor(dest/cnts)) * cnts);
}
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: C axis AC servo info
Hi turbothis,
Actually if your Spindle has an encoder the code will need to be slightly different. See here.
But it isn't clear what you are saying. When executed the program resets the current value to a value between 0 and 360. It does not cause future movements to roll over at 360. For example if the current machine position is 400 then executing M100 should change it to 40.
Actually if your Spindle has an encoder the code will need to be slightly different. See here.
But it isn't clear what you are saying. When executed the program resets the current value to a value between 0 and 360. It does not cause future movements to roll over at 360. For example if the current machine position is 400 then executing M100 should change it to 40.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.