Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Motors (http://www.chiefdelphi.com/forums/forumdisplay.php?f=52)
-   -   Modeling motor control (http://www.chiefdelphi.com/forums/showthread.php?t=88193)

kamocat 04-01-2011 17:30

Re: Modeling motor control
 
The motors are barely warm.
I think I have to run them for 10-15 minutes at full power to warm them up.

Al Skierkiewicz 04-01-2011 18:47

Re: Modeling motor control
 
Marshall,
In looking at the schematic, the data for Vout would appear to be a calculation based on the supply voltage to the output stages (Vsense) and the percent of the output PWM commanded for output. In most cases, this should give you good data in the normal operating range for FRC motors. It cannot compensate for voltage drops due to wiring and motor lead length nor can it compensate for LR distortions at low values of pulse width as discussed earlier. At true free speeds, is likely to be inaccurate as well.

As an edit, I just thought of something. Are these brand new motors that you are testing? There may be some discontinuity while the brush assembly is wearing into the commutator shape. Also, I wonder what the reaction time to a command is once the motor starts to speed up. It surely will take a finite time to get the mass moving at a new speed. I wonder if 200msec is long enough. (thinking out loud here)

kamocat 04-01-2011 19:15

Re: Modeling motor control
 
Would you give an estimate on the accuracy?

Neither of these motors are new. The first one has at least 20 hours of sine-wave operation. The second one has been used as a drill and a robot manipulator.

Al Skierkiewicz 04-01-2011 19:21

Re: Modeling motor control
 
Quote:

Originally Posted by kamocat (Post 991171)
The first one has at least 20 hours of sine-wave operation.

Can you explain that?
I wouldn't know where to start with an estimate. I am wondering why you are trying to evaluate for torque now that we have arrived at this spot. Except for the low RPM, you should be able to make calculations from the current and motor voltage since the variables will remain rather constant. Are you just trying to keep part count low?

kamocat 04-01-2011 19:24

Re: Modeling motor control
 
I'm trying to make this software based, using hardware other teams have easily available.
It's a motor-selection tool, to determine the speed and torque requirements of your mechanism.

Chris is me 04-01-2011 19:43

Re: Modeling motor control
 
Quote:

Originally Posted by kamocat (Post 991185)
I'm trying to make this software based, using hardware other teams have easily available.
It's a motor-selection tool, to determine the speed and torque requirements of your mechanism.

Why not mathematically solve this using motor specifications and force / torque calculations?

Kevin Sevcik 04-01-2011 20:04

Re: Modeling motor control
 
I've now deciphered the current sampling strategy employed by the Jaguars. It's a pretty simple scheme, they probably just wanted a robust fast solution over the broad range of motor inductances, etc. Anyways, the current, bus voltage, analog input, and temperature are sampled every PWM cycle, with an offset to put the sample in the middle of the PWM pulse (15.625 kHz). Voltage, analog, and temperature are used as-is, no filtering whatsoever.

The voltage returned over CAN is, indeed, the instantaneous bus voltage scaled by the percent command.

Current, on the other hand, is put through a 16x super-sampling, 8-point moving average filter. That is, 16 consecutive samples are put into a bucket, and when the bucket is full, it's averaged with the last 7 buckets, and that's your new current value till the next bucket's full.

So you end up with something like a 976Hz update rate for the current, but a bandwidth of something like 122Hz or less. Of the instantaneous value in the middle of the PWM pulse, lest we forget. This is the value reported back over CAN, and also used for current control mode. Interestingly, the instantaneous value is used for I2T overcurrent protection, which is set for 23A over 46A for 2 seconds (ie. 69A for 2s, or 78A for 1s, etc.).

No, I don't know why the overload specs differ from the specs in the data sheet. Either they fudged the DS numbers down for safety, or their conversion functions are wrong by that amount, which seems unlikely.

This is all assuming the FRC firmware is identical in these regards to the reference design firmware on Luminary Micro's site, of course. I'm not going to decompile the FRC firmware unless lives are at stake of something.

Ether 04-01-2011 20:22

Re: Modeling motor control
 
Quote:

Originally Posted by Kevin Sevcik (Post 991257)
I've now deciphered the current sampling strategy employed by the Jaguars...

current... [is] sampled every PWM cycle, with an offset to put the sample in the middle of the PWM pulse...

Current ... is put through a 16x super-sampling, 8-point moving average filter.

Nice work! Thank you for this information!

So the Jag firmware is doing both: digital filtering and phase-locking the sample to the bridge switching.

Quote:

So you end up with something like a 976Hz update rate for the current, but a bandwidth of something like 122Hz or less.
Well, the 976Hz makes sense, since the PID in the Jags is updated at about the same rate.

Quote:

Of the instantaneous value in the middle of the PWM pulse, lest we forget.
Right. Now the question now becomes: what is the relationship between this metric, RMS, and algebraic average.






EricVanWyk 04-01-2011 22:02

Re: Modeling motor control
 
Marshall -

To account for motor heating, consider re-ordering your tests pseudo-randomly. This will spread the time dependent effects across your sample space. Hopefully, this will result in a curve that makes more sense (but will likely be "wider").


Calculating effective motor voltage from Vbus * Duty Cycle is actually a pretty good method as long as the motor current is continuous (doesn't go to zero), and your measurement of Vbus is good enough.

Measuring Vbus half way through the pulse is a reasonably standard method. Assume that the applied voltage waveform looks roughly like a trapezoid: It starts at Vbus nominal when the switch starts, linearly(ish) droops due to increasing IR loss, and then goes to zero when the switch stops. The measured Vbus looks just like this, but with some ugly ringing around the transitions. By measuring halfway through, we kill two birds:
1) We are far away from the ringing.
2) We effectively take the average of the Vbus across the cycle (if it droops linearly).
Pretty sweet, eh? Simple way to get a darn good estimation. If you think about 2) a bit, you'll see why there usually isn't a filter in place - it would mess up the reading! If there is one, it usually has a very small time constant compared to the pulse width.

Continuous current is absolutely key to using effective motor voltage calculations - if the current stops, the underlying assumptions fall apart entirely. This is "The Big Difference"(TM) between Jaguars and Victors, and is why they have such different responses.
In a continuous current control mode, the effective motor voltage is (nearly) equivalent to what would happen with a pure DC source of the same voltage.

The reason for this gap is that when current is stops flowing, the motor is effectively floating with no applied voltage. If current is always flowing, the motor controller is always in control of the applied voltage.

Continuous current occurs whenever the off period is shorter than the amount of time it takes the current to decay to zero. Mathematically, this puts a relationship between switch frequency (on and off periods, actually) and minimum average current. That is to say that for a given frequency and duty cycle, there is a minimum average current to establish continuous current control. For a Jaguar, this is a few amps. For a Victor, this is a few hundred.

kamocat 04-01-2011 23:13

Re: Modeling motor control
 
Quote:

Originally Posted by Ether (Post 990946)
The average torque generated by the motor is proportional to the algebraic average current, assuming Kt is constant (which in real life it is not, but for most practical purposes it is assumed to be).

The output torque at the motor shaft is equal to the torque generated by the motor, minus the torque losses within the motor.

Is torque loss proportional to speed of the motor?


Will 5A at 4v produce the same internal torque as 5A at 10v?

Is the internal torque of a GEARBOX proportional to its speed?

kamocat 04-01-2011 23:52

Re: Modeling motor control
 
Here's a CIM with a toughbox, using the same measurement system. Sorry, there's no encoder on it yet.


EDIT:
Here's a test using a random sampling sequence.

Ether 05-01-2011 01:24

Re: Modeling motor control
 
Quote:

Originally Posted by kamocat (Post 991394)
Is torque loss proportional to speed of the motor?

It depends on what you mean by "proportional". To me, "proportional" means means a y=k*x relationship. So the answer is no, because at zero speed there is a non-zero static friction torque loss.

Is torque loss linear with speed? Not really, but for simplicity it is usually modeled that way. For example, see this spreadsheet.

Here are some interesting links about internal torque loss vs speed for Globe and FP motors.


Quote:

Will 5A at 4v produce the same internal torque as 5A at 10v?
To a very good approximation, yes, as long as we're talking about the same waveform of 5A in each case.

Quote:

Is the internal torque of a GEARBOX proportional to its speed?
Well, it can vary with speed. A gearbox has static friction. It also has a speed-dependent loss. Both types of loss can vary substantially from one gearbox to the next, even for identical models. Even for one given gearbox the losses can vary as a function of temperature, lubrication, contamination, etc.



Ether 05-01-2011 01:28

Re: Modeling motor control
 
2 Attachment(s)


Look at the difference in current waveforms for a CIM with locked rotor driven at 5% duty with a Jag vs a Victor.

This is a simulation using R=0.090 ohm & L = 200uH.


At 15KHz, the current varies from ~7.4amps to 7.7amps. The RMS is 7.6amps and the algebraic average is 7.6amps.

At 150Hz, the current varies from ~1.8amps to 18.7amps. The RMS is 8.4amps and the algebraic average is 6.7amps.

Since average motor torque is created by algebraic average current, and motor heating is created by RMS current, the 150Hz waveform produces less average torque and more motor heating.




kamocat 05-01-2011 02:05

Re: Modeling motor control
 
Thank you for the straightforward answers.

Quote:

Originally Posted by Ether (Post 991420)
Quote:

Originally Posted by kamocat
Will 5A at 4v produce the same internal torque as 5A at 10v?

To a very good approximation, yes, as long as we're talking about the same waveform of 5A in each case.

How would I measure it in a way that any waveform with the same current would create the same torque? You said algebraic average?

Ether 05-01-2011 02:32

Re: Modeling motor control
 
Quote:

Originally Posted by kamocat (Post 991432)
Thank you for the straightforward answers.

How would I measure it in a way that any waveform with the same current would create the same torque? You said algebraic average?

That's a fair question but the answer has a lot of ifs, ands, and buts.

If the waveform is nice and flat like a 5% 15Khz CIM curve then any sample taken with be both the algebraic average and the RMS, approximately.

If the waveform is an exaggerated sawtooth like a 5% 150Hz CIM curve, then you'd have to sample the instantaneous current and run it through a low-pass filter of some sort. You'd have to make sure your samples captured a reasonable picture of the entire waveform and were set up in such a way that aliasing didn't distort the results. OR, I think a better way would be to hardware-filter the raw analog signal (the amplified voltage across the shunt resistor) before it goes to the ADC. I think a filter could be designed that would give the algebraic average.




All times are GMT -5. The time now is 21:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi