Comments (8)
Hi,
An offset of a few 100mA is normal. The shunts are 0.001 ohm, so at 0.5 A there is only 0.0005 V across them that is centred and amplified. With such a small motor, I suggest that you use a larger value shunt, maybe 0.01 ohm.
However, for the startup, that is not likely to be the problem. It is very important that you get the motor parameters right. There is an autodetect-function in BLDC_Tool that you can use, but I haven't documented how to do that yet. If you get the parameters completely wrong, you are lucky if the motor runs at all.
from bldc.
Yes, I know this that this current is small, but it is only for testing.
I was just surprised, the offset is considerably larger than noise and similar on both channels. Reading the documents, maybe input bias current of amplifier can be the reason (input is disconnected during calibration, input bias is specified < 100uA, bias difference would be hopefully much smaller).
In my case it's quite difficult to get autodetect to spin up the motor, but reported values seem quite consistent when returned. Usually motor just resonates. I'll try increasing the current.
from bldc.
The motor must be able to spin up during auto detect, otherwise it won't work. Do you happen to use an hdd-drive motor? Auto-detect does not work well for them for some reason. Probably because they need so low current that the current control loop does a bad job with the varying offset.
The current is calibrated right after startup, so then I usually get less than 50mA offset. When the PCB changes temperature after running the motor for a while, the offset usually goes up to a few 100 mA. I have been experimenting a lot with the offset calibration, and so far this is the best I could do. Maybe I could add some runtime offset estimation (by e.g. sampling while no PWM is applied and taking the average), but for the motors I have been running this offset is not really a problem.
What do you mean by that the input is disconnected during calibration? You must have input power connected when the stm32 boots. If you, for example, only have the programmer connected to power the stm32 and the drv8302 has no voltage, the current offset calibration will fail.
from bldc.
I have one 22xx '100w' airplane motor and DMB0224C10002 CL B 1607 24V (from microchip kit, probably).
In my case I get +400mA on both phases right after startup, before starting the motor. This value is quite stable (with my currents board temperature stays the same).
With DC_CAL high, 'device shorts inputs of shunt amplifiers and disconnects loads'. So voltage caused by input bias current of sense amplifiers is not compensated. Maybe that is causing offset I see ... I'll try to measure the voltage tomorrow ..
from bldc.
I did some testing.
The bias current is creating voltage on filter resistors, about 3mV (30uA), but this current is exactly the same on both inputs, so voltage difference is zero.
With DCCAL_ON() there is about 2mV increase in current amplifier output voltage (200mA on 1uR shunt). Measured with Metex M-4660A, so this value is a bit above measurement error.
Also phase1 offset is about -1.6A, phase2 is +200mA. I interpreted phase order wrong in previous post.
So phase 2 is perfect, phase 1 is off by 1.8A. This is 18mV difference, 22lsb, way larger than +-2lsb typical for ADC.
I am probably doing some stupid mistake or maybe my board is wrong ..
from bldc.
Found something .. I switched to bipolar PWM mode during testing ...
do_dc_cal in bipolar mode runs with curr_samp_volt=1, so cur0_sum value is calculated from ADC_Value[ADC_IND_CURR1];
instead from ADC_GetInjectedConversionValue(ADC1, ADC_InjectedChannel_1);
In synchronous PWM mode I get expected offset of -200mA (3lsb) on both channels.
Strange thing is that in bipolar mode there is 20 count difference on curr0_offset when I measure twice, once with DCCAL_ON() and just after that with DCCAL_OFF();
from bldc.
I'll need to understand code better. Thanks for help, it's probably OK to close this ..
from bldc.
Sampling the currents and voltages is tricky. The sampling is synchronized to the PWM period and sampled at different points depending on the duty cycle, the commutation step and the switching frequency. Since the current shunts are on the low side and not directly on the motor phases, they have to be sampled when the low-side FETs are on. Getting the sampling right is among the things I have spent the most time on.
from bldc.
Related Issues (20)
- It needs more default number HFI start samples to resolve the initial ambiguity HOT 1
- Feature Request: add option to invert wake up switch function from normally closed to normally open button
- Better support for digital/ switch-based brakes HOT 3
- Waiting for vesc suport step/dir interface!
- Feature Request:How to customize my VESC firmware?
- Can 1 STM32F drive 2 mosfet Driver? HOT 4
- I want to drive two mosfet drivers with one stm32f like foCbox unity. I'm going to use two DRV8301's. I don't know if VESC allows 1 STM32F to receive SPI from two Mosfet Drivers. Is there anyone who can help me with the PROJECT? HOT 2
- [LispBM] Shutdown event issues HOT 6
- Feature request: Redundant analog signals for throttle and brake
- Feature Request: Disable Field Weakening at compile HOT 2
- Current control tuning HOT 1
- make qt_install failed
- Adding MakerX hardware HOT 1
- Lisp app-adc-override wrong values HOT 16
- TCP connection for VESC tools is unavailable when uart connection is established with Lisp
- Unexpected sensor port voltage on VESC 6 75V HOT 1
- Traction control on dissimilar motors. HOT 2
- CAN bus spamming
- Suport UART commands VS LispBM commands HOT 2
- Bug in release 6.02, in COMM_GET_IMU_DATA command handler, controller_id is never sent
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 bldc.