Yellow Motor low speed

Dear Totem Team,

we want to use “DC GEARED MOTOR 1:48 6V WITH JST PH 2.0 FEMALE CONNECTOR” for line following tasks, but have trouble with operating it with low speed. Are those Motors build for this task or should we use other ones (ore is it a software driver problem we can fix).

Are you using these motors with RoboBoard X4? They are rated for 6V, while X4 provides ~12V.

You can use this code to reduce maximum power output. If motor still spins to fast - reduce number 30 even lower.

void setup() {
  DC.setRange(0, 30); // Reduce motor power output to 30%
}

void loop() {
  // Change spin speed 0-100%
  for (int power=0; power<100; power+=10) {
    DC.A.spin(power);
    delay(200);
  }
}

Hmm we found out, that it hardly depends on the the batterie. Your code didn’t change anything, sadly.
So with good filled battery we can control it with standard range. But with range 0-30 we couldn’t run e.g. spin(15) even with full battery.

Yes, battery state of charge will have play there, because it is fed directly trough motor driver and PWM modulation - voltage applied to motor will change over time.

Yellow motors also has a durability issue over time. Gears can brake, lock or start slipping (plastic inside). I have tried to abuse them with mecanum wheels. They were surprisingly fast (with overvoltage) and were able to control direction.
image

If you are looking for better quality motors - we are using these in RoboCar: 25mm DC motor 400 rpm 12V with JST PH 2.0 female connector | Totemmaker.net

But with range 0-30 we couldn’t run e.g. spin(15)

Allright. Will check for better yellow motor control settings and will post tomorrow.
The biggest issue here - for linear motor speed control (especially at low speed), a slow decay mode is required. At the moment X4 does not support it (this is available in our new RoboBoard X3), so it is locked at fast decay. There is a plan to add this mode, but it requires some work to do. Can’t estimate when this update will be available.
But this is doable with current configuration. Will test what best performance could be achieved.

Got some better results with these settings. At least there is some speed control under load:

void setup() {
  DC.setFrequency(20000); // Set PWM frequency to 20kHz
  DC.setRange(60, 100); // Limit to 60-100% duty cycle
}

void loop() {
  // Change spin speed 0-100%
  for (int power=0; power<100; power+=10) {
    DC.A.spin(power);
    delay(300);
  }
}

So far, its better. We testet it. We will see if it is sufficient enough to work properly in a competition environment.