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

Brushed max throttle limit #1005

Closed
wants to merge 5 commits into from

Conversation

EvilBadger
Copy link
Contributor

Noticed on the brushed boards its not possible to get 100% duty cycle on the motors, somewhat limiting the power available. This simple fix seemed to make it better for me, let me know if it needs more work.

@hydra
Copy link
Contributor

hydra commented Jun 10, 2015

This seems like a bit of a hack to me.

likely the issue is either in this code:

// Find the maximum motor output.
int16_t maxMotor = motor[0];
for (i = 1; i < motorCount; i++) {
// If one motor is above the maxthrottle threshold, we reduce the value
// of all motors by the amount of overshoot. That way, only one motor
// is at max and the relative power of each motor is preserved.
if (motor[i] > maxMotor) {
maxMotor = motor[i];
}
}
int16_t maxThrottleDifference = 0;
if (maxMotor > escAndServoConfig->maxthrottle) {
maxThrottleDifference = maxMotor - escAndServoConfig->maxthrottle;
}
for (i = 0; i < motorCount; i++) {
// this is a way to still have good gyro corrections if at least one motor reaches its max.
motor[i] -= maxThrottleDifference;

or the pwm output code needs updating.

Can you give me details on which board you're using and how you're measuring the duty cycle?

also, the PR has too many commits, there should be just one for the change. Perhaps use this as an excuse to learn how to rebase your PR and update it if you don't know how?

@EvilBadger
Copy link
Contributor Author

Yea didn't realise github would all commit history just assumed it would be a patch. Tested on a custom board but using alienwii f1 build measured using analyser where you can clearly see the input to the fet not being full duty, motor output was set using GUI to 100% for testing. From a quick look the fix I think needs to be in the pwm output code that constrains the Max pwm for esc's. Thoughts?

@EvilBadger EvilBadger closed this Jun 23, 2015
@dkisselev
Copy link
Contributor

You don't have to close the PR, just rebase/squash your own feature branch. GitHub recognizes rebasing and will update the existing PR to reflect your changes.

@SteveAmor
Copy link
Contributor

The following code appears to act as expected:

// Find the maximum motor output.
int16_t maxMotor = motor[0];
for (i = 1; i < motorCount; i++) {
// If one motor is above the maxthrottle threshold, we reduce the value
// of all motors by the amount of overshoot. That way, only one motor
// is at max and the relative power of each motor is preserved.
if (motor[i] > maxMotor) {
maxMotor = motor[i];
}
}
int16_t maxThrottleDifference = 0;
if (maxMotor > escAndServoConfig->maxthrottle) {
maxThrottleDifference = maxMotor - escAndServoConfig->maxthrottle;
}
for (i = 0; i < motorCount; i++) {
// this is a way to still have good gyro corrections if at least one motor reaches its max.
motor[i] -= maxThrottleDifference;

I actually can't find an issue at all. See #1520

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

Successfully merging this pull request may close these issues.

None yet

4 participants