Comments (11)
from sapog.
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.
PX4ESC doesn't measure average current, it's phase current. It converges with average current at 100% thrust.
from sapog.
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.
from sapog.
@pavel-kirienko It seems to correlate more or less linearly though, so can we maybe offer the transformed (average) value as well?
from sapog.
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.
Can we also filter the value digitally or is this not observable at the current speeds?
from sapog.
ADC sampling is synchronized with PWM and always happens during PWM-on state, so no, we can't filter it digitally.
from sapog.
How fast is the PWM out happening? Any chance to ramp up ADC?
from sapog.
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.
Let me update the schematics with larger C9.
from sapog.
Related Issues (20)
- Increase the space allocated for bootloader to 16K HOT 3
- Shorten parameter names in order to comply with PX4 limitations
- Build failure: Unable to checkout 'chibios @ e7a5b54' in submodule path 'firmware/chibios' HOT 4
- Temp sensor autodetect
- sapog development environment HOT 6
- [Feature request]Add support DSHOT signal input HOT 4
- segfaults during linking HOT 1
- undefined reference to `main' HOT 7
- esc_setpoint_raw is offset from rpm feedback. HOT 7
- Compile Error HOT 6
- On which pin UART2 isοΌ HOT 1
- Myxa ESC issues HOT 5
- Why do I compile so many errors with UBUNTU?
- Python 3 syntax error on filter(lambda (x, y): ) HOT 3
- Support UAVCAN v1.0 HOT 6
- Enable CAN acceptance filters
- Configurable Telemetry Rate HOT 1
- Maximum RPM Command Rate HOT 1
- What other processors are already coded for this HOT 1
- Missed mid-flight rotation feature HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sapog.