DAC Spindle Speed Feedback
Hi Tom
Hopefully the last Question regarding this build as almost everything is functioning perfectly
i have configured my VFD servo Drive as an axis with DAC 0-10v control and is all working through Kanalog board and direction is controlled through a latching relay
The Machine spindle is belt driven from the servo motor and has a disk on the spindle with 50 holes around it , onto which is mounted a slotted opto switch (RS stock Number 306-061) , the output is an npn photo transistor .
Is it possible to use this for speed measurement for the spindle ? and could you point me to an article to set up the speed measuring function
Regards
Sean
Re: DAC Spindle Speed Feedback
Hi Sean,
KFLOP encoder inputs require a quadrature signal so it can track direction and therefore position. If you could mount another opto sensor shifted 1/4 of the hole pitch then it could be used.
What is the max RPM you will be using? If not too fast you may be able to count hole transitions in software.
Otherwise an RC (resistor - capacitor) circuit can be used to generate a phase shifted version of the pulses to create quadrature. See this Thread.
Re: DAC Spindle Speed Feedback
Tom
Thank you for your reply , after a few hours searching i found a thread that mentioned using an RC delay to the signal. it kind of worked but the delayed signal was more rounded that the original pulse. if you can imagine bottom of the signals starting at the same time but the tops separated by 5us.
I have now made a new bracket to mount two opto sensors side by side , which will be a better solution i think
Max speed of the spindle is 3750rpm @ 10v .
regards
Sean
Re: DAC Spindle Speed Feedback
Hi Sean,
Two optos should be the best solution. Note they don't need to necessarily be side-by-side. For example they might be 10.25 hole pitches apart.
4 Attachment(s)
Re: DAC Spindle Speed Feedback
Tom
Managed to find two opto sensors in a draw with built in triggers and 10K resistors
i have added the encoder trace before connecting , not sure 4.8v is ok into the kanalog encoder connections ? (seems ok on my axis inputs )
i have no idea what the settings for my spindle should be , i have added config screen and step response output screens
spindle motor is 7100rpm @11.2v for some reason that is what comes out of DAC0 at max rpm
spindle is 3750rpm
encoder disk has 50 holes
sean
Re: DAC Spindle Speed Feedback
Quote:
not sure 4.8v is ok into the kanalog encoder connections ? (seems ok on my axis inputs )
it is ok
Quote:
i have no idea what the settings for my spindle should be , i have added config screen and step response output screens
encoder input gain seems to be set near zero. I'd put it at 1. Is the Position changing? There should be 200 counts/rev.
You should be able to operate closed loop for accurate RPM control. FF is probably too high set to zero for now.
Try a move of 10 revs (2000 counts). Vel = 2000 counts/sec = 10revs/sec = 600 RPM Jerk 20000 counts/sec (apply Acceleration in 0.1 seconds)
Adjust PD gains to follow trajectory reasonably.
Quote:
spindle motor is 7100rpm @11.2v for some reason that is what comes out of DAC0 at max rpm
Not sure what you mean by this. It should not be possible for the DACs to go that much over 10V.
HTH
Re: DAC Spindle Speed Feedback
Tom
if i put FF = 0 nothing moves , at 2047 it gives me full speed
ground seems to be floating at 1.2v between the Kanalog and VFD ?
Sean
Re: DAC Spindle Speed Feedback
Hi Sean,
Quote:
if i put FF = 0 nothing moves , at 2047 it gives me full speed
Please answer my questions and do what I suggested.
Quote:
ground seems to be floating at 1.2v between the Kanalog and VFD ?
Do you have a GND connection between Kanalog and the VFD?
3 Attachment(s)
Re: DAC Spindle Speed Feedback
Quote:
Originally Posted by
TomKerekes
encoder input gain seems to be set near zero. I'd put it at 1. Is the Position changing? There should be 200 counts/rev.
encoder input set to 1 ( where would i see position change ?)
Quote:
Originally Posted by
TomKerekes
You should be able to operate closed loop for accurate RPM control. FF is probably too high set to zero for now.
i have set the config screen to encoder input and FF =0
Quote:
Originally Posted by
TomKerekes
Try a move of 10 revs (2000 counts). Vel = 2000 counts/sec = 10revs/sec = 600 RPM Jerk 20000 counts/sec (apply Acceleration in 0.1 seconds)
see plots , no movement
Quote:
Originally Posted by
TomKerekes
Adjust PD gains to follow trajectory reasonably.
any number in P motor just runs once move is pressed (Edit in the I box not P )
Re: DAC Spindle Speed Feedback
Hi Sean,
Quote:
where would i see position change ?
On the KMotion.exe | Axis Screen
Quote:
see plots , no movement
With PID and FF gains zero output will remain at zero and be as expected.
Quote:
any number in P motor just runs once move is pressed
Where's the plot? That would show what is happening. A common problem is to have something reversed resulting in positive feedback and runaway. If the motor moves away from the target instead of towards the target the error and output will increase forever. In this case try reversing the sign of the input or output gain. Otherwise maybe the encoder position isn't changing at all?
2 Attachment(s)
Re: DAC Spindle Speed Feedback
Quote:
Originally Posted by
TomKerekes
On the KMotion.exe | Axis Screen
Cannot see any axis move should it be in the lower the S box ? . i can see the encoder pulses working in encoder 3 A/B in the digital I/O screen
Quote:
Originally Posted by
TomKerekes
Where's the plot? That would show what is happening. A common problem is to have something reversed resulting in positive feedback and runaway. If the motor moves away from the target instead of towards the target the error and output will increase forever. In this case try reversing the sign of the input or output gain. Otherwise maybe the encoder position isn't changing at all?
changed the input gain to -1 trace attached
Re: DAC Spindle Speed Feedback
Hi Tom
1 thing i have noticed when doing the step/response is the DAC voltage goes +10v then goes - 10v and stays there until i disable the axis ??
1 Attachment(s)
Re: DAC Spindle Speed Feedback
Hi Sean?
Quote:
Cannot see any axis move should it be in the lower the S box ?
?? No the KMotion.exe Axis Screen
Attachment 466898
It would have been helpful to describe what physically happened and post the raw data. Also include the Filter and Configuration Screens.
A is crazy low so the commanded position barely moves several counts.
I Gain is crazy high so even with tiny error the Output ramps a lot quickly.
Regardless of being configured oddly the result is very strange. See in the plot the output curves up to ~1200 counts over about a full second. This should be about 6V not the 10V you mentioned. But its strange the spindle does nothing at all while being commanded over 50%. Then the spindle suddenly jumps about 50 counts (1/4 rev) and stops. Because of the low A we should have only moved about 2 counts so this is a huge overshoot. The Output immediately slams to 100% full reverse. Yet the encoder continues to show weird "steppy" positive motion of approximately 1/4 turns.
Please verify the encoder is counting properly. You might also command DAC commands from the Console Screen to verify the VFD is behaving properly. ie it can be commanded slowly, reversed, fast, etc.
BTW are the encoder signals connected to Kanalog differential? Or are you leaving inputs floating?
5 Attachment(s)
Re: DAC Spindle Speed Feedback
Quote:
Originally Posted by
TomKerekes
No the KMotion.exe Axis Screen
yes the position is moving looked like missed counts or something weird , checked factory installed holed disk and was seeing +/- 0.25mm runnout have remounted it today and not missing hole edges .
4 of the holes at 90degs are actually slots for indexing i guess so was picking up these and some holes
Quote:
Originally Posted by
TomKerekes
It would have been helpful to describe what physically happened and post the raw data. Also include the Filter and Configuration Screens.
A is crazy low so the commanded position barely moves several counts.
I Gain is crazy high so even with tiny error the Output ramps a lot quickly.
Regardless of being configured oddly the result is very strange. See in the plot the output curves up to ~1200 counts over about a full second. This should be about 6V not the 10V you mentioned. But its strange the spindle does nothing at all while being commanded over 50%. Then the spindle suddenly jumps about 50 counts (1/4 rev) and stops. Because of the low A we should have only moved about 2 counts so this is a huge overshoot. The Output immediately slams to 100% full reverse. Yet the encoder continues to show weird "steppy" positive motion of approximately 1/4 turns.
I have now attached test 4 plots and raw data after making sure encoder is counting properly , the output goes into reverse but spindle doesn't reverse as anything below 0v is stopped so the motor just slows down
Quote:
Originally Posted by
TomKerekes
You might also command DAC commands from the Console Screen to verify the VFD is behaving properly. ie it can be commanded slowly, reversed, fast, etc.
DAC Commands in console screen work ,after i realised have to disable drive from step/response screen DAC0= -51 is the slowest i can get and works all the way up to DAC0= - 2047.
my VFD only accepts + 0-10 v i am controlling direction with bit 154 and 155 into a latching relay . (is there a way to have the step/response screen move not to go negative voltage)
Quote:
Originally Posted by
TomKerekes
BTW are the encoder signals connected to Kanalog differential? Or are you leaving inputs floating?
I thought this maybe the problem single ended into the differential on the kanalog board (before i noticed the hole problem ) so i rewired the encoder into pin 13 and 14 on the KFLOP JP7
i hope this makes it clearer as to what is happening
and thanks again for your continued patience
Sean
Re: DAC Spindle Speed Feedback
Hi Sean,
Thanks for all the info.
Quote:
my VFD only accepts + 0-10 v i am controlling direction with bit 154 and 155 into a latching relay . (is there a way to have the step/response screen move not to go negative voltage)
Not easily. You would need to set the Axis to No Output and then write the ch3->Output to the DAC yourself with a C Program while taking the absolute value and controlling the relays and so forth. Its probably not worth the trouble just to get the Step Response Diagnostic to work.
I see the input gain magnitude is set for 1/50. I would probably have left it at 1 (hole transitions) or 1/200 to be Revs. But that's ok as long as we know 1 unit is 1/4 rev.
A Velocity setting of 2000/4 = 500 revs/sec = 30,000 RPM is way too high. In the test the trajectory's Velocity is only reaching 320/4 = 80revs/sec = 4800RPM before it needs to start stopping (based on Acceleration and move size).
Also Acceleration is too high as you can see from the plot the red line can't keep up with the blue line even with the Output pegged at max 10V.
This isn't telling us anything about the tuning because the gains are set so high the Output is just slamming to both rails.
So please try a smaller move (10 revs = 40 units) at lower A and V. Remove FF. I'd use P gain rather than I gain..
Re: DAC Spindle Speed Feedback
Hi Tom
Quote:
Originally Posted by
TomKerekes
I see the input gain magnitude is set for 1/50. I would probably have left it at 1 (hole transitions) or 1/200 to be Revs. But that's ok as long as we know 1 unit is 1/4 rev.
The plate has 50 holes in so i set input gain at 1/50
Quote:
Originally Posted by
TomKerekes
A Velocity setting of 2000/4 = 500 revs/sec = 30,000 RPM is way too high. In the test the trajectory's Velocity is only reaching 320/4 = 80revs/sec = 4800RPM before it needs to start stopping (based on Acceleration and move size).
Max Spindle speed is 3750 , so that would be a max V =250 , so i should use something smaller than this ie 200
Quote:
Originally Posted by
TomKerekes
Also Acceleration is too high as you can see from the plot the red line can't keep up with the blue line even with the Output pegged at max 10V.
When i set the A Lower the spindle spins up slowly - stops - then spins up faster but is outside of the plot area
Quote:
Originally Posted by
TomKerekes
So please try a smaller move (10 revs = 40 units) at lower A and V. Remove FF. I'd use P gain rather than I gain..
If i use P gain rather than I gain the motor doesn't move ?
Re: DAC Spindle Speed Feedback
Hi Sean,
Quote:
The plate has 50 holes in so i set input gain at 1/50
Each hole creates a quadrature cycle so creates 4 counts.
Quote:
When i set the A Lower the spindle spins up slowly - stops - then spins up faster but is outside of the plot area
Unfortunately the plot is limited to 3.5 seconds. Most systems aren't that slow to respond. Maybe your still using I gain and it is unstable (slowly increasing, overshooting, then undershooting).
Quote:
If i use P gain rather than I gain the motor doesn't move ?
It should move. Maybe it is too low value. Post a plot to see how much output there is. Because your count units are so large (1/4 rev = 1 count) with an error of a full rev the error will only be 4. So with a gain of 1 this will only be 4 DAC counts.
1 Attachment(s)
Re: DAC Spindle Speed Feedback
Tom
you were correct i was using to small a P gain
new plot attached
Sean
Re: DAC Spindle Speed Feedback
Hi Sean,
That seems reasonable albeit so slow to respond. What kind of VFD is this? Are there any settings to speed it up?
Anyway it may work. If you Jog from the console does it go to proper speed and maintain speed without variation?
Jog3=66.67
Should be 1000RPM
Re: DAC Spindle Speed Feedback
Tom
JOG3=66.66 click Send seems like a delay of a second then ramps up to approx. 1500 rpm then down to 800 rpm over another second then stabilizes at 1000rpm
VFD is a Lenze 534 speed controller
according to the manual i have found online acceleration time is 1-10 S which is really slow unless i am missing something
sean