simple 2 axis lathe initial lathe set up
Moderators: TomKerekes, dynomotion
Re: simple 2 axis lathe initial lathe set up
ok
spindle works great with speed and performance
i wanted it to be free/not holding once it slows to a stop.
i had this before, so i searched up my old thread and added in the disable axis part like you provided then
now it works
however now when i try and turn spindle back on it does nothing?
i am feeling like there needs to be an axis enable in the front of the CW and CCW codes?
my M5
spindle works great with speed and performance
i wanted it to be free/not holding once it slows to a stop.
i had this before, so i searched up my old thread and added in the disable axis part like you provided then
now it works
however now when i try and turn spindle back on it does nothing?
i am feeling like there needs to be an axis enable in the front of the CW and CCW codes?
my M5
Code: Select all
#include "KMotionDef.h"
#include "MySpindleDefs.h"
// desired speed is passed from KMotionCNC in variable KMVAR
// save in user variable STATEVAR whether it was off, CW, or CCW (0,1,-1)
// save in user variable SPEEDVAR the last desired speed
main()
{
// spin down
ClearBit(SPINDLECW_BIT);
ClearBit(SPINDLECCW_BIT);
Jog(SPINDLEAXIS, 0);
printf("Jogging Spindle Stop\n");
persist.UserData[STATEVAR] = 0; // remember we are Off
while (!CheckDone(SPINDLEAXIS));
if (CS0_axis_a == -1) // is A axis not defined in the Coordinate System?
DisableAxis(2); // yes, disable the axis, otherwise leave it enabled
}
Re: simple 2 axis lathe initial lathe set up
need like a
lol
Code: Select all
if spindle dac = 0 (DisableAxis(2));
else do nothing
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: simple 2 axis lathe initial lathe set up
I think you need to enable the axis before Jogging in the CW and CCW programs
Code: Select all
if (CS0_axis_a == -1 && !ch2->Enable) // is A axis not defined in the Coordinate System and not enabled?
EnableAxis(2); // yes, enable the axis
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: simple 2 axis lathe initial lathe set up
exactly!
works perfect now
my X axis runs away some and i think it is the encoder (mechanical related?)
it reads good and the right direction
the first tests the servo ran backwards so i changed the
ch0->InputGain0=1;
ch0->InputGain1=1;
to
ch0->InputGain0=-1;
ch0->InputGain1=-1;
to get the servo driving the correct way instead of swapping +/- leads
is this fine and appropriate?
i notice when the X axis tries to run off ( i smack the Estop) and the DAC is at full output. this is with me jogging it only about -226 = 1.104 V
maybe this is the servo trying to catch up to position?
the axis can go nice and slow with jogging though......
works perfect now
my X axis runs away some and i think it is the encoder (mechanical related?)
it reads good and the right direction
the first tests the servo ran backwards so i changed the
ch0->InputGain0=1;
ch0->InputGain1=1;
to
ch0->InputGain0=-1;
ch0->InputGain1=-1;
to get the servo driving the correct way instead of swapping +/- leads
is this fine and appropriate?
i notice when the X axis tries to run off ( i smack the Estop) and the DAC is at full output. this is with me jogging it only about -226 = 1.104 V
maybe this is the servo trying to catch up to position?
the axis can go nice and slow with jogging though......
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: simple 2 axis lathe initial lathe set up
If the servo is working (negative feedback to hold position) and you reverse the input gain then you will have positive feedback (runaway) instead of negative feedback. So you also need to also reverse the output gain to maintain negative feedback.my X axis runs away some and i think it is the encoder (mechanical related?)
it reads good and the right direction
the first tests the servo ran backwards so i changed the
ch0->InputGain0=1;
ch0->InputGain1=1;
to
ch0->InputGain0=-1;
ch0->InputGain1=-1;
to get the servo driving the correct way instead of swapping +/- leads
is this fine and appropriate?
If the Estop just removes motor power then KFLOP will ramp to full output trying to correct any error without any result. If you set small Max Following Error then whenever the servo can't correct the error then the axis will fault with a following error, the axis will disable, and the DAC will go to 0. So in this case the axis wont run away in the first place.i notice when the X axis tries to run off ( i smack the Estop) and the DAC is at full output. this is with me jogging it only about -226 = 1.104 V
maybe this is the servo trying to catch up to position?
the axis can go nice and slow with jogging though......
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: simple 2 axis lathe initial lathe set up
cool
the old encoder felt tight and clunky when i spin it by finger. pretty sure it is not great
with new encoder and putting
ch0->InputGain0=1;
ch0->InputGain1=1;
back, X axis functions as it should
i think mostly this is ready to cut something
is there any way to test the Z pulse on the spindle?
the old encoder felt tight and clunky when i spin it by finger. pretty sure it is not great
with new encoder and putting
ch0->InputGain0=1;
ch0->InputGain1=1;
back, X axis functions as it should
i think mostly this is ready to cut something
is there any way to test the Z pulse on the spindle?
Re: simple 2 axis lathe initial lathe set up
hey, if i have my step settings at 1.00 and the A axis on degrees. shouldn't it step a single degree at a time?
it seems to step kinda odd in that it is random steps about .600-.800 in the A axis
it seems to step kinda odd in that it is random steps about .600-.800 in the A axis
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: simple 2 axis lathe initial lathe set up
See Axis Homing and Indexingis there any way to test the Z pulse on the spindle?
Yes it should. Observe the KMotion | Axis Screen. Does the Command and Position change by 22.2222222 counts?if i have my step settings at 1.00 and the A axis on degrees. shouldn't it step a single degree at a time?
it seems to step kinda odd in that it is random steps about .600-.800 in the A axis
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.