Current turning capabilities status
28 Feb 2013 18:59 #30672
by emcPT
Replied by emcPT on topic Current turning capabilities status
I will try to change the signals once at time and post the results.
One thing that I want to ask is when there is a change in the hal and ini files, I always close linuxcnc and open again so that the changes are set up. Can this be done inside linuxcnc, like "reload init settings?" without closing linuxcnc?
One thing that I want to ask is when there is a change in the hal and ini files, I always close linuxcnc and open again so that the changes are set up. Can this be done inside linuxcnc, like "reload init settings?" without closing linuxcnc?
Please Log in or Create an account to join the conversation.
28 Feb 2013 19:26 #30674
by andypugh
You have to exit and reload to use the files.
However, you can change parameters and re-wire HAL live. (just not via the files)
For example, to tune the PID settings you can open the HAL window Machine->Show Hal Configuration, and then type commands like "setp pid.0.Pgain 10" in the text box at the bottom.
You might even be able to tune the spindle with the "Machine -> Calibration" tool. It's certainly worth trying this, as that also writes the new values to the INI file. (commands in the HAL window don't).
A third option is the normal command line "halcmd setp pid.0.Pgain" for example.
To experiment with HAL outside of LinuxCNC you can run a standalone HAL session with "halrun". I do a lot of my testing and development that way. www.linuxcnc.org/docs/html/man/man1/halcmd.1.html
Replied by andypugh on topic Current turning capabilities status
One thing that I want to ask is when there is a change in the hal and ini files, I always close linuxcnc and open again so that the changes are set up. Can this be done inside linuxcnc, like "reload init settings?" without closing linuxcnc?
You have to exit and reload to use the files.
However, you can change parameters and re-wire HAL live. (just not via the files)
For example, to tune the PID settings you can open the HAL window Machine->Show Hal Configuration, and then type commands like "setp pid.0.Pgain 10" in the text box at the bottom.
You might even be able to tune the spindle with the "Machine -> Calibration" tool. It's certainly worth trying this, as that also writes the new values to the INI file. (commands in the HAL window don't).
A third option is the normal command line "halcmd setp pid.0.Pgain" for example.
To experiment with HAL outside of LinuxCNC you can run a standalone HAL session with "halrun". I do a lot of my testing and development that way. www.linuxcnc.org/docs/html/man/man1/halcmd.1.html
Please Log in or Create an account to join the conversation.
28 Feb 2013 22:34 #30685
by emcPT
Replied by emcPT on topic Current turning capabilities status
I was able to make the spindle work but I add to change the OUTPUT_SCALE = 2500 (so I am not sure if I am doing correctly as explicitly Andy told me to use 1)
This is the most stable that I managed, but still not good enough.
[SPINDLE_9]
P = 4.0
I = 0.0
D = 0.0
# Tested 0, 10, 100, 1000 and 2000 (also negative)
FF0 = 58
ENCODER_SCALE = 4000.0
OUTPUT_SCALE = 2500
If I use FF0 with a lower value it is like the PID does not do anything. For example I issue S1000, the output will be like 300 without going up (like the PID should work).
If the FF0 value is for example 100, as soon I make S1000 or any other value the spindle goes to the maximum and stays there...
This is the most stable that I managed, but still not good enough.
[SPINDLE_9]
P = 4.0
I = 0.0
D = 0.0
# Tested 0, 10, 100, 1000 and 2000 (also negative)
FF0 = 58
ENCODER_SCALE = 4000.0
OUTPUT_SCALE = 2500
If I use FF0 with a lower value it is like the PID does not do anything. For example I issue S1000, the output will be like 300 without going up (like the PID should work).
If the FF0 value is for example 100, as soon I make S1000 or any other value the spindle goes to the maximum and stays there...
Please Log in or Create an account to join the conversation.
28 Feb 2013 23:12 #30686
by PCW
Replied by PCW on topic Current turning capabilities status
If you set output scale to VFD RPM at 10V, FF0 will have to be 60 since the PID inputs are in RPS, not RPM.
Can you make it stable with more P term? 4 is very low when full scale output is 2500, taking your example, at 1000 RPM commanded speed (16.6 RPS) the PID error at 300 RPM (5 RPS) is 11.6 RPS. 11.6 X Pgain =~46 RPM (since output is scaled in ~RPM)which is a negligible contribution to the output.
Once you get a reasonable P gain, you might try adding some I term
Can you make it stable with more P term? 4 is very low when full scale output is 2500, taking your example, at 1000 RPM commanded speed (16.6 RPS) the PID error at 300 RPM (5 RPS) is 11.6 RPS. 11.6 X Pgain =~46 RPM (since output is scaled in ~RPM)which is a negligible contribution to the output.
Once you get a reasonable P gain, you might try adding some I term
Please Log in or Create an account to join the conversation.
28 Feb 2013 23:40 #30688
by emcPT
Replied by emcPT on topic Current turning capabilities status
Excuse my difficulties to fully understand.
> If you set output scale to VFD RPM at 10V, FF0 will have to be 60 since the PID inputs are in RPS, not RPM.
When you say set output scale to VFD RPM at 10V, this means when to achieve full VFD speed the output of the 7i37 is set to 10V? If that is the case then yes, it is set like that. If I use with FF0=60 the real speed measured is above the desired speed and it stays there, but I tested only with a small P value. Will try with a larger one.
> If you set output scale to VFD RPM at 10V, FF0 will have to be 60 since the PID inputs are in RPS, not RPM.
When you say set output scale to VFD RPM at 10V, this means when to achieve full VFD speed the output of the 7i37 is set to 10V? If that is the case then yes, it is set like that. If I use with FF0=60 the real speed measured is above the desired speed and it stays there, but I tested only with a small P value. Will try with a larger one.
Please Log in or Create an account to join the conversation.
01 Mar 2013 00:42 #30691
by PCW
Replied by PCW on topic Current turning capabilities status
What I meant is that if your VFD full speed is 2500 RPM at 10V in, using an OUTPUT_SCALE of 2500 means the PID output is scaled in RPM. Since FF0 part of the PID component just takes the PID.command, scales it by the FF0 value and outputs it to the PID.output, you need a value of 60 to
change from the PID command input scale (RPS) to PID output scale (RPM)
The 3.3% difference in 58 from 60 is due to tolerances of the 7I33 analog out and VFD analog in
(note that if you have only FF0 (all other PID parameters 0) you are running open loop)
change from the PID command input scale (RPS) to PID output scale (RPM)
The 3.3% difference in 58 from 60 is due to tolerances of the 7I33 analog out and VFD analog in
(note that if you have only FF0 (all other PID parameters 0) you are running open loop)
Please Log in or Create an account to join the conversation.
01 Mar 2013 01:25 #30692
by emcPT
Replied by emcPT on topic Current turning capabilities status
Using FF0=60 with a higher gain (50) I was able to get better results. This is getting nice! I used also a lowpass filter to display the actual speed and I start to like this as I can do what I want the way I want ! or not so much.... please see the attached video that shows the output speed VS the input speed.
The output speed is always higher than the input (desired speed) in about 10-15 rpm, except at very high speeds. Any consideration why?
The video is in:
Thank you
The output speed is always higher than the input (desired speed) in about 10-15 rpm, except at very high speeds. Any consideration why?
The video is in:
Thank you
Please Log in or Create an account to join the conversation.
01 Mar 2013 01:31 #30693
by andypugh
if your Pgain goes too high then you will get oscillation, but you can increase it until that happens.
You probably want a bit of I-gain to home-in on the exact speed.
Having said that, you don't really _need_ the exact speed for lathe work.
Replied by andypugh on topic Current turning capabilities status
Does the error get less with more Pgain?The output speed is always higher than the input (desired speed) in about 10-15 rpm, except at very high speeds. Any consideration why?
if your Pgain goes too high then you will get oscillation, but you can increase it until that happens.
You probably want a bit of I-gain to home-in on the exact speed.
Having said that, you don't really _need_ the exact speed for lathe work.
Please Log in or Create an account to join the conversation.
01 Mar 2013 01:36 - 01 Mar 2013 03:58 #30694
by PCW
Replied by PCW on topic Current turning capabilities status
Errors are probably due small nonlinearitys in the VFD speed vs voltage function
If you want 0 static speed error you will need to add some I term
I should note that if you add I term you will probably have to feed the
commanded velocity through a 'limit2" component so that the rate of
change of commanded velocity is not faster than the VFD can follow.
If this is not done, the integral term will "windup" while the VFD is
getting to speed after a step change in commanded speed and
then cause the spindle speed to over or undershoot
If you want 0 static speed error you will need to add some I term
I should note that if you add I term you will probably have to feed the
commanded velocity through a 'limit2" component so that the rate of
change of commanded velocity is not faster than the VFD can follow.
If this is not done, the integral term will "windup" while the VFD is
getting to speed after a step change in commanded speed and
then cause the spindle speed to over or undershoot
Last edit: 01 Mar 2013 03:58 by PCW. Reason: ommision
Please Log in or Create an account to join the conversation.
06 Mar 2013 19:46 #30963
by andypugh
Replied by andypugh on topic Current turning capabilities status
If you decide you do want it, there is a config here: www.linuxcnc.org/index.php/english/forum...stion?start=12#30946 Which should help.I do not need the C axis at least for now..
Please Log in or Create an account to join the conversation.
Moderators: piasdom
Time to create page: 0.090 seconds