Open CarlOlsson opened 8 years ago
Are you still using the 0.021 Ω motor? If so, the current sense measurements at the very start of spin-up look about right; it's getting around 5 A from an applied voltage lower than 0.2 V, so it's definitely well under the 0.1 Ω it estimated during startup.
Current offsets are also minimal, so overall the charts are looking pretty good, but the motor is stopping because the estimator loses track of the rotor position (you can see it starting to slip when you get the noise in the current chart).
For reference, on the "Current draw" chart, red is the current setpoint (i.e. the target torque value), blue is the D current, and black is the Q current. The inner control loop tries to keep the D current at zero, and the Q current at the setpoint; when you see oscillation around those points, either you have a lot of current sense noise, or the estimator is losing sync.
The output of the inner control loop is shown on the "Voltage" chart; the D and Q voltages are blue and black respectively.
Yes we are still using the 0.021 Ω motor. Thanks for the explanation of the labels etc.
Looking at the getting started guide we will try again with adjusting the gain, or do you have any other input on how to proceed? What kind of logs would be most interesting for figuring out if it is an HW, SW or configuration issue?
This is a measurement problem, so I don't think any parameter changes will be useful. I expect it's related to current shunt sample timing during the resistance and inductance measurement, since that was the hardest part to get right during the porting process; it's entirely possible it's not as robust as it needs to be for the Pixhawk ESC 1.6 hardware.
In 68e34de I have introduced per-board motor parameter measurement configuration, and adjusted the PX4ESC's configuration to improve its measurement performance. I did not see the specific issue you had with the motors I'm using, but did see similar issues which arose from poor measurement accuracy.
The new parameters increase measurement currents quite significantly in order to overcome current shunt measurement noise, so you should see better results.
One other point is you may need to reduce the gain to 0.5–0.75 and the braking to 0.2–0.5 to improve stability during significant step changes in throttle.
Hi Ben, thanks for the update! Unfortunately we still have the same problem, see plots below:
The following plots are for constant setpoint (i.e. we do not start and stop intentionally) and different parameter configurations:
If we set the setpoint to 10 the motor does not stop. Here is a plot from such a case:
And here is a plot of rpm estimation with motor not spinning
Thanks @CarlOlsson, those charts provide the information I need to continue investigating.
No problem! Just ping us if you want any other logs etc!
I have been testing using a Scorpion S3026-II 790 Kv, which has reasonably similar specs to the Hacker A40-14S V2 you've been using.
I was able to reproduce the measurement issues you've seen, as well as the starting/stopping behaviour, which is due to a loss of sync during the sudden change in target voltage when it comes out of the initial speed ramp.
Here are some changes which significantly improve performance in my tests: https://github.com/thiemar/vectorcontrol/tree/pixhawk_esc_bringup
Please try them out and let me know how you go. My suggested parameters are:
Current limit: 12 A Voltage limit: 12 V (for now) Acceleration limit: 0.25 V Bandwidth: 50 Hz Gain: 1.0 Braking: 0.2
Preparation:
Results when running the motor with different setpoints:
Some plots: Setpoint 10:
Setpoint 20:
Setpoint 30:
Setpoint 50:
Setpoint 70:
Setpoint 100:
Setpoint 300:
We tried increasing the maximum current and voltage but with the same qualitative behaviour
@bendyer @CarlOlsson I'm trying to bring up a Pixhawk ESC 1.6 with some Turnigy motors. (http://www.hobbyking.com/mobile/viewproduct.asp?idproduct=38456)
I'm facing the exact same issues. I'm on the pixhawk_esc_bringup
branch.
The ESC communicates with the GUI but when the setpoint is set to something higher than approx. 30 the motor starts and stops. @bendyer From the plots, could you indicate what is wrong?
We built the fw using gcc 4.8.3, the git hash is 544c8 and the binaries are in the ESC_bringup Drive.