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

堵转条件检测的疑问 #180

Open
ericQiang opened this issue Jun 3, 2023 · 0 comments
Open

堵转条件检测的疑问 #180

ericQiang opened this issue Jun 3, 2023 · 0 comments

Comments

@ericQiang
Copy link

ericQiang commented Jun 3, 2023

在motor.cpp中,堵转条件的检测代码片段如下:

            ((controller->modeRunning == MODE_COMMAND_CURRENT ||
              controller->modeRunning == MODE_PWM_CURRENT) &&
             (current != 0))
            || // Other Mode
            current == config.motionParams.ratedCurrent)
        {
            if (abs(controller->estVelocity) < MOTOR_ONE_CIRCLE_SUBDIVIDE_STEPS / 5)
            {
                if (controller->stalledTime >= 1000 * 1000)
                    controller->isStalled = true;
                else
                    controller->stalledTime += motionPlanner.CONTROL_PERIOD;
            }
        } else // can ONLY clear stall flag  MANUALLY
        {
            controller->stalledTime = 0;
        }```
请教,为何在电流模式下的检测条件是:电流不为零,速度小于1/5转持续时间过长。
我理解的是,电流模式就是输出一个恒定的电流(比如恒力矩),此时电机确实是没有转动的,但只要电流(力矩)是我设定的值,那就应该一直这样保持,不应该置位堵转标志。
所以不是很理解这里的电流模式是什么意思。
还望稚晖君给指点迷津。谢谢。
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

No branches or pull requests

1 participant