Determining OUTPUT_SCALE with PWD to BDC motor

More
15 Nov 2020 04:08 - 15 Nov 2020 04:30 #189429 by lrak
Looking at the pid-block-diag - ( wish I had the original - this copy hurts the eyes).. I have a good understanding of PID loops.

Seems important to have the output scaled correctly for the FF parts before starting the tuning process.
linuxcnc.org/docs/devel/html/hal/rtcomps.html#_pid

So a DC motor gets a speed from this equation:

w = V/k - TR/k^2

k and R are constants - but k in the torque term it is squared so less of a factor (torque load slows things down a bit) so I see this as mostly a velocity input device. The slowing of the speed by tool force has to be corrected by the PID loop.

I am thinking of the electric output of pwgen as a voltage - 7i29

I have numbers for the motors, but I don't think useful - which makes me think that a basic test of sending some number to the pwmgen and timing the speed to connect the number with machine-units/sec.

I've looked at a lot of the threads here on tuning - I see 10V bit for analog systems, but nothing about what I'm set to do.

If I set PID all to zero - and FF0 to 1 - it seems like I should be able to command some continuous jog-rate and look at velocity?
Am I on the right track?
Last edit: 15 Nov 2020 04:30 by lrak. Reason: readability

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

More
15 Nov 2020 04:39 #189431 by cmorley
I think you are asking what units to set the scale at.

You could scale this to represent:
motor speed (scale of maximum axis speed in machine units per second)

voltage,(scale of maximum voltage)

duty cycle (scale of maximum duty cycle)

or anything else.

I strongly recommend axis speed; then the experts can look at your numbers with a normalized reference.

Chris
The following user(s) said Thank You: lrak

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

More
15 Nov 2020 22:40 #189484 by lrak
@cmorley

I had the units figured out - I'm trying to determine how to measure what OUTPUT_SCALE should be.

pwmgen.N.scale is normally set to OUTPUT_SCALE

Where:
Mu = Machine units
Dc = duty cycle
V = or 'value' ( the commanded input to pwmgen in Mu/s )
S = scale

So I need to find S where

V = Dc * scale

So the question is how to do this test - calibrate lets me play with FF0 - this didn't work. kicks out errors ..

So I looked at pwmgen.00.value and encoder.00.velocity while doing a continuous jog --

I was able to set OUTPUT_SCALE to 50 and get close match between value and velocity, but if I change the jog speed - this relationship moves around - probably the TR/k^2 term There is a minimum amount to make things move.

Could be I need to use the pwmgen.N.offset parameter? It is on the man page, but not in hm2_7i93.0.pwmgen.00 ???

There was a place where PWC said FF1 needs to be quite accurate "FF1 should be set to within 1/10 1%"
Don't understand what he means now?

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

More
15 Nov 2020 23:10 #189485 by lrak
See attached --

Better on the eyes

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

More
15 Nov 2020 23:47 #189486 by PCW
I would do as cmorely suggests and set OUTPUT_SCALE to the
velocity in machine units per second at full voltage (100% PWM)
Then FF1 should be very close to 1
The following user(s) said Thank You: lrak

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

More
16 Nov 2020 22:50 #189556 by lrak
Fairly close to what I did. .. I just shouldn't have done it at slow speed. Going fast makes the second term of

w = V/k - TR/k^2 insignificant.

If I use that scale number pwmgen.N.value and encoder.N.velocity now match very close if I stay below max (112.5mm/s).

Going full speed was easier said than done. Not for the faint at heart - don't want to be near an end of travel..

Always got following errors, but after adjusting the ini file - I could get up to 112mm/sec and It would error before I could test..

By using encoder.N.velocity at max speed for OUTPUT_SCALE - it makes pwmgen.N.value and encoder.N.velocity now match very closely if I don't go over max.
,.,.

I have what I think is close to your procedure for H-bridge with a couple of questions:
Set Deadband to resolution *0.6
Set OUTPUT_SCALE to encoder.N.velocity when pwmgen is pedal-to-the-metal
Set FF1 = 1
Set P to low value ( What is low? -- 1/2 the oscillation point? )

Might help to describe the closeness to oscillation with this:
en.wikipedia.org/wiki/Damping_ratio#/med...r_Damping_Ratios.svg

Set D below buzzyness - ( a few wiggles in f-error plot ? )
Set FF1 so that the actual position does not lead or lag the commanded position at full speed
Set FF2 so that the actual position does not lead or lag the commanded position during acceleration
Increase P as much as possible without causing overshoot
Increase I below but close to instability. No slow hunting oscillations..

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

Time to create page: 0.080 seconds
Powered by Kunena Forum