|
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.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|