Code Monkey home page Code Monkey logo

Comments (11)

LorenzMeier avatar LorenzMeier commented on May 23, 2024

Its not that bad:
data

from sapog.

LorenzMeier avatar LorenzMeier commented on May 23, 2024

I get these coefficients:

p = 1.2129   -1.3072

So the measured value from PX4 ESC - 1.3072, then the result multiplied by 1.2002 should yield something close to Unilog.

from sapog.

pavel-kirienko avatar pavel-kirienko commented on May 23, 2024

PX4ESC doesn't measure average current, it's phase current. It converges with average current at 100% thrust.

from sapog.

LorenzMeier avatar LorenzMeier commented on May 23, 2024

I did this fit / fix:

transformed = (input + p(2)) * p(1);
    if transformed < 0
        transformed = 0;
    end

And I get this output - blue is the Unilog data, red is the scaled ESC data.
fit

from sapog.

LorenzMeier avatar LorenzMeier commented on May 23, 2024

@pavel-kirienko It seems to correlate more or less linearly though, so can we maybe offer the transformed (average) value as well?

from sapog.

pavel-kirienko avatar pavel-kirienko commented on May 23, 2024

I wouldn't expect the coefficients to stay the same for different loads.

Actually, we don't need instant current measurements anymore - it was necessary for earlier revisions of the firmware in order for the variable inductance rotor position detection method to work, which was employed for initial spin-up procedure. In the current implementation, there are only 2 uses for the current measurements:

  • Current limiting
  • UAVCAN feedback

Which means that we can simply replace the instant current measurements with average, by means of increasing C9 to 1uF. This will effectively drop the corner frequency of the RC filter to approx. 42 Hz, making the PWM synchronization effects negligible.

from sapog.

LorenzMeier avatar LorenzMeier commented on May 23, 2024

Can we also filter the value digitally or is this not observable at the current speeds?

from sapog.

pavel-kirienko avatar pavel-kirienko commented on May 23, 2024

ADC sampling is synchronized with PWM and always happens during PWM-on state, so no, we can't filter it digitally.

from sapog.

LorenzMeier avatar LorenzMeier commented on May 23, 2024

How fast is the PWM out happening? Any chance to ramp up ADC?

from sapog.

pavel-kirienko avatar pavel-kirienko commented on May 23, 2024

OK, if we added a parallel ADC sampling process that is not synchronized with PWM, then we probably would be able to get appropriate sampling rate to filter it digitally. However:

  • this free-running sampling process must somehow not interfere with PWM-synchronized sampling;
  • it must cease to generate IRQs after zero-cross, in order to not delay the commutation IRQ that follows ZC detection;
  • it must not require significant processing power. This requirement would be easy to implement if we could simply dump the measurements on a circular buffer via DMA (in order to collect them later from non-IRQ handling code), but the appropriate DMA is already used for the PWM-synchronized sampling.

Despite the above, if we were forced to re-design the motor control having digital filtering as a requirement, I'm sure it would be possible.

PWM frequency is 20~50 KHz.

from sapog.

pavel-kirienko avatar pavel-kirienko commented on May 23, 2024

Let me update the schematics with larger C9.

from sapog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.