Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Motor starts and stops with Pixhawk 1.6 ESC with constant setpoint #12

Open
CarlOlsson opened this issue Nov 19, 2015 · 10 comments
Open
Labels

Comments

@CarlOlsson
Copy link

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?

11

12

13

  • Erased the microcontroller with a JLink Debugger
  • Flashed the current master bootloader to the ESC with a JLink Debugger
  • Flashed the current master fw to the ESC via the Pixhawk

We built the fw using gcc 4.8.3, the git hash is 544c8 and the binaries are in the ESC_bringup Drive.

@bendyer
Copy link
Contributor

bendyer commented Nov 20, 2015

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.

@CarlOlsson
Copy link
Author

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?

@bendyer
Copy link
Contributor

bendyer commented Nov 21, 2015

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.

@bendyer
Copy link
Contributor

bendyer commented Nov 22, 2015

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.

@CarlOlsson
Copy link
Author

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:
constant1

constant2

constant3

If we set the setpoint to 10 the motor does not stop. Here is a plot from such a case:
working_setpoint_10

And here is a plot of rpm estimation with motor not spinning

motor_still_rpm_estimated_strange

@bendyer
Copy link
Contributor

bendyer commented Nov 24, 2015

Thanks @CarlOlsson, those charts provide the information I need to continue investigating.

@bendyer bendyer added the bug label Nov 24, 2015
@CarlOlsson
Copy link
Author

No problem! Just ping us if you want any other logs etc!

@bendyer
Copy link
Contributor

bendyer commented Nov 24, 2015

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

@CarlOlsson
Copy link
Author

Preparation:

  • Erased flash on the Pixhawk ESC 1.6
  • Flashed the bootloader
  • Flashed the fw built from the pixhawk_esc_bringup with hash 6dd1217
  • Nice sound on startup!
  • Changed parameters to the ones suggested.

Results when running the motor with different setpoints:

  • The Motor does not start and stop anymore
  • Sometimes (rarely) the motor does not start at all, we then stopped and started and the motor starts to spin
  • The setpoint value did not seam to influence the rpm much, at least not above a setpoint of 20
  • Even with a setpoint of 100 (or even 300) the current draw was not more than 0.8 A

Some plots:
Setpoint 10:
setpoint_10

Setpoint 20:
setpoint_20

Setpoint 30:
setpoint_30

Setpoint 50:
setpoint_50

Setpoint 70:
setpoint_70

Setpoint 100:
setpoint_100

Setpoint 300:
selection_300

We tried increasing the maximum current and voltage but with the same qualitative behaviour

@mhkabir
Copy link

mhkabir commented Feb 15, 2016

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants