Hello,
I've got running Spindle as a servo ADC, configured according to Dynomotion Documentation. Spidle is tuned roughly and responds on M3 ,M4 , M5 commands. Thing is I have no readout on KMotionCNC screen (ID_SpindleRateLabel), it is always zero. Is it because The Variable assigned on screeneditor is -1 rather 113 ?
Thanks
Mateusz
Spindle DAC - no read out of spindle rate
Moderators: TomKerekes, dynomotion
Re: Spindle DAC - no read out of spindle rate
I will add , that I'm using encoder feedback on spindle on axis 3
these are my definitions:
#define SPINDLEAXIS 3 // Axis Channel to Jog to rotate Spindle
#define FACTOR (3413.333333/60.0) // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 147 // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 147 // bit to activate to cause CCW rotation
#define SPEEDVAR 99 // global persistant variable to store latest speed
#define STATEVAR 98 // global persistant variable to store latest state (-1=CCW,0=off,1=CW)
#define KMVAR PC_COMM_CSS_S // variable KMotionCNC will pass speed parameter (113)
#define USE_POS_NEG_VOLTAGE 1 // 0 = output Magnitude, 1 = output positive and negative speed
these are my definitions:
#define SPINDLEAXIS 3 // Axis Channel to Jog to rotate Spindle
#define FACTOR (3413.333333/60.0) // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 147 // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 147 // bit to activate to cause CCW rotation
#define SPEEDVAR 99 // global persistant variable to store latest speed
#define STATEVAR 98 // global persistant variable to store latest state (-1=CCW,0=off,1=CW)
#define KMVAR PC_COMM_CSS_S // variable KMotionCNC will pass speed parameter (113)
#define USE_POS_NEG_VOLTAGE 1 // 0 = output Magnitude, 1 = output positive and negative speed
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Spindle DAC - no read out of spindle rate
Hi Mateusz,
Have you configured Threading in KMotionCNC | Too Setup | Trajectory Planner | Threading?
Have you configured Threading in KMotionCNC | Too Setup | Trajectory Planner | Threading?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Spindle DAC - no read out of spindle rate
Hello Tom,
Good point ! I did configured but rather placing axis 3 I placed number 4, this should resolve an issue, Tomorrow I'm going to see my 11 tons beast.
Thank you !
Good point ! I did configured but rather placing axis 3 I placed number 4, this should resolve an issue, Tomorrow I'm going to see my 11 tons beast.
Thank you !
- Attachments
-
- threading.png (3.62 KiB) Viewed 4970 times
Re: Spindle DAC - no read out of spindle rate
Another thing, I've got extra signal from Spindle VFD which says "I'm reached set speed'' (Speed Coincidence Signal). May I use it with command M3 ? to make sure spindle has declared RPM.....
Thanks
Mateusz
Thanks
Mateusz
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Spindle DAC - no read out of spindle rate
Yes. Interface the signal to some KFLOP input. Then you might add C program code to your M3 program to wait for it.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Spindle DAC - no read out of spindle rate
Hi Tom,
I sticked an input with "while(VFD_IN);" command just after SetBit(SPINDLECW_BIT), It is running, but I'm nut sure I've made it correctly My next step is to introduce Rigid Tap and I'm not sure this change will influence a TAP cycle...I've got few question on this but I'll rise them on different topic.
BTW. This time I did configured a spindle correctly in threading window - and RDO shows speed as it should.
Thanks
Mateusz
I sticked an input with "while(VFD_IN);" command just after SetBit(SPINDLECW_BIT), It is running, but I'm nut sure I've made it correctly My next step is to introduce Rigid Tap and I'm not sure this change will influence a TAP cycle...I've got few question on this but I'll rise them on different topic.
BTW. This time I did configured a spindle correctly in threading window - and RDO shows speed as it should.
Thanks
Mateusz
- Attachments
-
- OnCWJog.c
- (1.2 KiB) Downloaded 216 times
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Spindle DAC - no read out of spindle rate
Hi Mateusz,
You forgot to read the input with a call to ReadBit(). So the while loop is testing the bit number not the input bit.
The wait loop is in the wrong place. It should be after the speed is changed not before.
Also a KFLOP Jog only commands the speed to start changing. You should wait until the Axis is done changing to the new speed before waiting for the drive to be at that speed.
You forgot to read the input with a call to ReadBit(). So the while loop is testing the bit number not the input bit.
The wait loop is in the wrong place. It should be after the speed is changed not before.
Also a KFLOP Jog only commands the speed to start changing. You should wait until the Axis is done changing to the new speed before waiting for the drive to be at that speed.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.