Setting up Closed loop Spindle speed control and Feedback (0-10V Analog)

More
04 Aug 2020 19:47 #177272 by Mike_Eitel
As fare as i know there is something in the 7i76e parameters for encoder. I should too, but have been to lazy to go that road...
Mike

P. S. Do you own an oscilloscope and had a look on the signal quality

Please Log in or Create an account to join the conversation.

More
04 Aug 2020 20:16 - 04 Aug 2020 20:17 #177275 by PCW
I think you are making this a bit too complicated, Your posted hal file is close to right


1. You don't need the scale component for the commanded spindle
speed. All scaling is done by setting the INI file value of OUTPUT_SCALE
in the spindle section. This should simply be set to the RPM at full scale output.

2. Once this has been done (and you have FF0=1 and all other PID terms = 0) you should
have fairly accurate speeds. Your listed speeds are probably accurate enough, but you can
then try tuning the loop to get better speed accuracy, especially under load.

3. As far as the spindle speed filter not having any effect, is spindle-fb-rpm-abs-filtered
connected to the GUI anywhere? (is there another hal file that's missing because that signal
is not connected to anything other than the source in the hal file)
Last edit: 04 Aug 2020 20:17 by PCW.

Please Log in or Create an account to join the conversation.

More
04 Aug 2020 20:46 #177279 by Mike_Eitel
Question to pcw
Setting the cards encoder filter to true. Could this be enough

General question: is the fpga's meassured value (dont know whether counts or frequency) depending from a jitter free cyclic hal-read. Or in other words: If my system has higher jitter, does it shows bigger value jumps?
Thx in advance
Mike

Please Log in or Create an account to join the conversation.

More
04 Aug 2020 20:56 #177283 by PCW
The encoder filter should normally be on, but this is just for electrical noise immunity
its not likely to make a difference in the (somewhat expected) velocity estimation noise

The host jitter does not affect the velocity calculation because the velocity calculation
is based on count_deltas/time_deltas but the time_delta is not determined by the
servo thread but rather a crystal controlled time stamp.
The following user(s) said Thank You: Mike_Eitel

Please Log in or Create an account to join the conversation.

More
04 Aug 2020 20:58 #177285 by denhen89

1. You don't need the scale component for the commanded spindle
speed. All scaling is done by setting the INI file value of OUTPUT_SCALE
in the spindle section. This should simply be set to the RPM at full scale output.

Perfect, that was one thing i did not understand. Thank you.

3. As far as the spindle speed filter not having any effect, is spindle-fb-rpm-abs-filtered
connected to the GUI anywhere? (is there another hal file that's missing because that signal
is not connected to anything other than the source in the hal file)

Thats it. It was my fault and a very stupid one from me. I went to my workshop and immediately tested it out. It works.

2. Once this has been done (and you have FF0=1 and all other PID terms = 0) you should
have fairly accurate speeds. Your listed speeds are probably accurate enough, but you can
then try tuning the loop to get better speed accuracy, especially under load.

As i wrote at point 3., i connected the filtered signal do the GUI and i see the RPM not anymore bouncing. The rpm is out, not pretty much, but it is. .

I checked couple speeds and wrote down the real rpm
S150 = 152 rpm
S250 = 225 rpm
S500 = 500 rpm
S800 = 834 rpm
S1000 = 1060 rpm
S1420 = 1483 rpm

When tuning with P I D, i am not able to get the RPM right at all tested speeds. When i use a I command, the speed goes faster and faster, even at values like e.g. 0.000045. At this value it goes faster not that quickly, but at values like 0.045 (not anymore sure what values i tested), the spindle turns faster and faster until it reaches max speed.

I am not sure why the rpm is so strangly out depending on the S-Command. I mean why at S150 the rpm is 2 rpm higher, but at S250 the rpm is 25rpm slower. Then e.g. at S1000 the rpm is 60 rpm too high and at S1420 the RPM is 1483rpm.

Should i use lincurve?

Please Log in or Create an account to join the conversation.

More
04 Aug 2020 21:20 #177288 by PCW
I am actually not sure why you would care about the RPM that much

You could increase the scale value to improve the higher RPM match
Small non-linearitys are expected both on the 7I76E output (about 1% linear)
and the drive

If you get a runaway, its likely that the encoders velocity signal is not scaled
properly or has the wrong sign

Please Log in or Create an account to join the conversation.

More
04 Aug 2020 21:43 #177290 by denhen89

I am actually not sure why you would care about the RPM that much

Because i thought that i need that to be able to use constant surface speed, but it seems i dont need that, right?
In general i think it would be nice to get the rpm right to use closed loop.

You could increase the scale value to improve the higher RPM match

I increased the max rpm already in the .INI from 1420rpm (as it is written on the motorplate: 50hz = 1420 rpm) to 1483 rpm which is the rpm feedback from encoder when S1420. So, 1483 seems to be the max rpm at 50hz, but setting up the max rpm to 1483 rpm does not solve the problem, because when using S1420 i get still 1483 rpm.

Small non-linearitys are expected both on the 7I76E output (about 1% linear)
and the drive

Good to know that. Thanks

If you get a runaway, its likely that the encoders velocity signal is not scaled
properly or has the wrong sign

I am using a 100ppr Omron ABZ Encoder. In the .INI file that i uploaded here, the parameter setp scale.0.gain 100 was wrong, but i changed it already on today to setp scale.0.gain 60
So, the scale should be correct with the value 60 and the sign i think also.
The rpm is unlinear, so i am wondering if i can solve the problem with lincurve when using 0-10 analog signal?

Please Log in or Create an account to join the conversation.

More
05 Aug 2020 07:54 #177356 by denhen89
One more question:
Can i expect more accurate spindle speeds with PWM control or is 0-10V Analog control the way to go when MODBUS control is not a option ?

Please Log in or Create an account to join the conversation.

More
05 Aug 2020 08:11 #177357 by Mike_Eitel
By principle pwm accuracy is only depending from the bit resolution.. BUT you need a converter f.x. the usual cheepo in the normal bob's. I doubt that you get good infomation over that patrs linearity.
On the other side pcw gave 1% precision for the 7i76e output in another tread.
In both cases you have to add the vfd input's error...
So if you insist to have correct rpm, go pid.
Mike

Please Log in or Create an account to join the conversation.

More
05 Aug 2020 08:22 #177358 by denhen89
Thanks Mike.

I would like to use PID, but it seems there is a feedback problem in my configuration.
I found this thread: Spindle PID control , where the author described exactly the same behavior of PID as i do.
Andy Pugh wrote:

It looks like you do not have any feedback, so the PID will, as you have noticed, ramp up indefinitely.

You probably have spindle speed into HAL from the encoder? You will need to pass this through an ABS component and into the spindle-vel-fb-rpm-abs signal.

I do get a Encoder feedback (synchronized motion works), but there for sure is something wrong in my .HAL file.
Currently i am not at my Lathe Computer, but as soon as i will be, i will change the line what Andy Pugh mentioned in the next reply in the same thread:

This is starting to look like just a confusion about signal names.

Try changing:
net spindle-vel-fb-rpm-abs => pid.s.feedback

to
net spindle-fb-rpm-abs => pid.s.feedback

Please Log in or Create an account to join the conversation.

Time to create page: 0.089 seconds
Powered by Kunena Forum