Dual PID loops with motor encoder + scale encoder per axis

More
14 Apr 2024 18:57 #298247 by TangentAudio
A little bench experiment running the motor open loop with no load across 0%-100% PWM values.  

Except for the discontinuity at the bottom, voltage looks more linear to me, though they both look reasonably linear.    Maybe loading the motor would make it more clear, but I have to find a good way to do that on the bench.

 
Attachments:

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

More
14 Apr 2024 21:20 - 14 Apr 2024 22:15 #298258 by TangentAudio
Another test with cleaner results.  One of my DMMs had a low battery so it was having some trouble auto-ranging I think, so the last results were a bit screwy.  I also measured RPM with my optical tach this time.

Another observation: when I run the motor at a fixed PWM value and apply a physical load to the motor, current will jump up substantially but the voltage will drop a much smaller amount percentage-wise.  So it behaves more like a CV power supply and not a CC power supply.  The voltage drop could be explained by the 10ft long 16 gauge wire that feeds the motor.

 
 
Attachments:
Last edit: 14 Apr 2024 22:15 by TangentAudio.

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

More
17 Apr 2024 22:54 #298508 by TangentAudio
I am speculating these may just be plain H bridge drives.

An apparent quote from PCW, found at the very bottom of wiki.linuxcnc.org/cgi-bin/wiki.pl?Servo_Tuning_Detail_How_To

Bare H-bridge drives running PM DC motors behave somewhat like velocity mode servos
(with quite low velocity feedback gain) So they end up being somewhere between velocity
and torque mode.
That is, you are setting the average motor drive voltage with the PWM value. This sets the
approximate motor velocity because the motor will accelerate to a velocity where the generated
back EMF is close to the supplied voltage. If the motor impedance was zero, you would have close
to a perfect velocity mode servo, but the impedance is substantial which leads to the low
inherent feedback gain.

Normally for Hbridges, I would start with a low P value and tune the D term as high as
possible without excessive buzzyness, then set FF1 so that the actual position does
not lead or lag the commanded position at full speed, then I would tune FF2 so that
the actual position does not lead or lag the commanded position during acceleration
Then I would tune P as high as possible without oscillation, overshoot and then when
everything else is close, add as much I term as possible without instability.

The following user(s) said Thank You: tommylight

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

More
18 Apr 2024 06:27 - 18 Apr 2024 06:29 #298534 by Tinine
In velocity-mode, the drive is a rate-device where the command signal dictates the RPM of the motor. Remove the command and the motor stops dead and the shaft can't be rotated by hand.

In Torque-mode, the command dictates the amount of current applied to the motor. Remove the command and the motor will coast to a stop and then the shaft can be easily rotated by hand, as if the drive was dis-abled.
Last edit: 18 Apr 2024 06:29 by Tinine.
The following user(s) said Thank You: TangentAudio

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

More
18 Apr 2024 12:45 #298553 by TangentAudio
So by that definition, it's behaving more like torque mode because commanded "0" means no voltage and no current on the motor; it will freely spin by hand. But my observations seem to show the command value is changing the drive voltage to the motor in a linear fashion with respect to the PWM value (0 - 80V). Current varies based on motor loading (ignoring small voltage drops).

This is why that quote from PCW caught my eye - he says PWM H-bridge drives appear to work as a hybrid between velocity and torque mode drives. H-bridge seems likely to me as they are simple and relatively low-cost, and this would not have been an exceptionally high-end system back in the 1980s.

So maybe this is all good news? I should be able to make an inner velocity PID loop that takes in commanded velocity from an outer position loop, and uses the motor encoder velocity for feedback.

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

More
19 Apr 2024 07:36 #298604 by Tinine
Yes, the voltage has to increase to produce more current. I don't want to contradict the "hybrid" statement but for all intents and purposes, it's torque mode and yes it's great news.

Provided that the control system is capable of handling position and velocity control, a dumb drive keeps things simple. 

Craig
The following user(s) said Thank You: TangentAudio

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

More
19 Apr 2024 13:44 #298614 by PCW
I would say a voltage mode drive (PWM)  is more like a velocity drive.
(the inherent velocity feedback from the BEMF makes it so)

At 0 voltage, the shaft _will_ resist turning because it acts as a generator
into a shorted load. In fact, if the PWM and motor had 0 resistance it would
hold position!

This similarity to velocity mode also is illustrated in the tuning which
matches velocity mode tuning in that the FF1 term (that compensates for BEMF)
is critical. (torque mode tuning typically uses no FF1)
The following user(s) said Thank You: TangentAudio

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

More
19 Apr 2024 13:56 #298616 by TangentAudio
Well, I'm as confused as ever. 

 

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

More
19 Apr 2024 14:30 #298618 by TangentAudio
Based on my rough experiment where I plotted PWM vs motor voltage/current, my intuition was telling me it behaved more as a velocity drive as well.  Unfortunately I don't have a good enough grasp of the theory to prove it.  Trying to cram the motor theory and controls theory into my brain is going about as well as you would expect.  But I'm learning and starting to understand from an intuitive level.

If we assume it is a velocity-like drive, I'm a bit confused about the topology of the PID loops, especially the inner one in this dual loop scenario. 

Rather than the summed dual loop that I diagrammed several days ago in this thread (the one that splits PD and I across the two loops), it seems like it's preferable to have the two loops cascade?  In other words, outer loop takes a position command from the axis joint and uses the linear scale encoder position value to close that loop.  The output from the outer loop would be a velocity command fed into the inner loop, which would use the velocity from the motor encoder as its feedback. 

Here's my main point of confusion, however: wouldn't the output of that inner loop would be a torque command and not a velocity command?  How do we use that when the PWM drives seem to expect a velocity input.  Am I wrong in my understanding that the output of the loop is the derivative of its command/feedback ?
 

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

More
19 Apr 2024 14:35 #298619 by Tinine
I use H-Bridge drivers for my desk-top motion developments (I design motion controllers).

With no motor command, they freely rotate.
When the loop is closed, I absolutely need the D-term (of the PID) or I have unacceptable overshoot.

These are the characteristics of an industrial drive in torque-mode (aka: current mode).

Craig

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

Time to create page: 0.440 seconds
Powered by Kunena Forum