Nonlinear PWM

More
14 Jan 2014 05:35 #42721 by PCW
Replied by PCW on topic Nonlinear PWM
P term will generate an output proportional to the error
(difference between command and feedback)
so the PID loop is behaving as expected.

If you want the output to reflect the command, you can set FF0
This is appropriate for PID loops with command and PID output that
are the same (your loop is velocity in and out)

(FF0 =1 will make the output match the command)
Then you can add P and possibly I on top of this to correct errors

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

More
14 Jan 2014 05:41 #42722 by eslavko
Replied by eslavko on topic Nonlinear PWM
Now I hit with some other problem?
How to connect signal??? The bias and FF0 are RW!

#piece of HAL
net spindle-lps <= lowpass.0.out #lowpas for softstart

net spindle-lps => pid.0.command
net spindle-lps => pid.0.FF0 #Got error here!

'spindle-lps' can not add I/O pin 'pid.0.FF0', it already has OUT pin 'lowpass.0.out'

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

More
14 Jan 2014 05:50 #42724 by andypugh
Replied by andypugh on topic Nonlinear PWM

Now I hit with some other problem?
How to connect signal??? The bias and FF0 are RW!
'spindle-lps' can not add I/O pin 'pid.0.FF0', it already has OUT pin 'lowpass.0.out'


You don't normally "net" FF0. It is a gain (like PGain) and so you would normally just setp the value to 1 (as you already have good open loop control, that will work fine).

If you _did_ want to make it variable, then the lincurve component has an RW pin specifically to be connected to the PID gains.

(I may have been confused and misleading in a previous message)

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

More
14 Jan 2014 06:11 #42725 by eslavko
Replied by eslavko on topic Nonlinear PWM
I just get it that FF0 need to be 1 (setp)

Control loop works now. Just need fine tune.
If I change speed UP all things is ok. Work quick and no overshots. But if I speed it down I got unwanted behaviour. As control signal goes down more quickly as router slows down the I error goes high. When spindle decelerate to commanded value then due I term goes far under commanded speed and then return to correct one.

Need to solve this.
I have lowpass for command signal and can make it slower (but then speedup is slower too...)
I set I-limit and response is a lot better but not perfect yet.
...will continue tomorow...

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

More
14 Jan 2014 06:18 #42726 by PCW
Replied by PCW on topic Nonlinear PWM
This is because you dont have 4 quadrant control
of your spindle. Its more like a temperature control (Heat and cool are asymmetrical)

This makes PID control "interesting"

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

More
14 Jan 2014 07:07 #42727 by andypugh
Replied by andypugh on topic Nonlinear PWM

But if I speed it down I got unwanted behaviour. As control signal goes down more quickly as router slows down the I error goes high. When spindle decelerate to commanded value then due I term goes far under commanded speed and then return to correct one.


We call this "I-term windup" in the trade. :-)

You probably need to lower the I-Gain until the problem goes away, then see how much of the speed tracking you can get back with P-gain.

If that doesn't work then you can make the I-Gain come out of a seconf "lincurve", one that takes PID error as X and outputs I-Gain as Y, and which has a lower I-Gain when the error is positive than when it is negative.

There is a PID controller that I look after at work where the P-Gain is the product of 2 16x16 maps, the D term is the same, and the I-Gain is the product of 3 16x16 maps.
Then the precontrol (like your FF0) is another 4 16x16 maps. I have about 3000 numbers to adjust to get it all to work right.
The following user(s) said Thank You: eslavko

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

More
14 Jan 2014 18:24 #42753 by eslavko
Replied by eslavko on topic Nonlinear PWM
After some tunning the spindle works ok.
the lincurve works in 2.5.3 version too...

Thanks for support...

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

Time to create page: 0.077 seconds
Powered by Kunena Forum