Skip to content

motor.c : Manage the absolute min value of speed and explain the limit of speed change period in order to obtain an correct effect #2

@nathmo

Description

@nathmo

Hi,
I spent some time scratching my head on why the robot was not moving, even tho I kept calling left/right_motor_set_speed(vitesse) in my main loop.
I'm not sure if the comment on line 314 meant that the problem was supposedly fixed or if it's known, but it seems that the problem is still present.
My workaround was to call X_motor_set_speed(vitesse) only if there is a change from the previous state.

I would suggest doing the same inside left_motor_set_speed(vitesse) and right_motor_set_speed(vitesse) unless the root cause can be addressed, as I couldn't find anything about this issue in the documentation

void motor_set_speed(struct stepper_motor_s *m, int speed)
{
[...]
    uint16_t interval;
    if (speed == 0) {
        m->direction = HALT;
        //Resolves a problem when the motors take about 650ms to restart
[...]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions