Hi everyone,
I’m having an issue with my 450 RPM (36:48) 6-motor drivetrain using Arcade Control.
The Issue: When I push the left stick (forward) slightly for low speed, but push the right stick (turn) fully for a high-speed spin, the motors on one side of the chassis stop spinning entirely.
Technical Details:
- Hardware: 6x 11W Motors (600 RPM cartridges, 36:48 external).
- Code: PROS
chassis.arcade(or custom arcade logic). - Symptom: One side “dead” only when combining low linear and high angular velocity.
Is this likely a Voltage/Power Scaling issue in the arcade function, or is the motor triggering a Current Limit (2.5A) due to the high torque demand of a 450 RPM turn?Any advice?
#include "main.h"
#include "robot-config.hpp"
#include "drive.hpp"
// ---- Constants ---------------------------------------------------------------
// Curve intensity for exponential joystick mapping (3.0 ~ 8.0 recommended)
static constexpr double DRIVE_CURVE = 5.0;
// Task loop delay in milliseconds
static constexpr uint32_t TASK_DELAY_MS = 10;
static pros::Task *drive_task_handle = nullptr;
// ---- Helper Functions --------------------------------------------------------
double apply_curve(double input, double curve)
{
if (input == 0.0)
return 0.0;
// Normalize input to [-1, 1]
const double norm = input / 127.0;
// Apply exponential curve, preserve sign
const double curved = (std::exp(curve * std::abs(norm)) - 1.0) / (std::exp(curve) - 1.0);
return std::copysign(curved * 127.0, input);
}
// ---- Task --------------------------------------------------------------------
void drive_task_fn(void *param)
{
while (true)
{
// Read joystick axes
const double throttle = master.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y);
const double turn = master.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_X);
// Apply exponential curves
const double c_throttle = apply_curve(throttle, DRIVE_CURVE);
const double c_turn = apply_curve(turn, DRIVE_CURVE);
// Arcade mixing
double left_power = c_throttle + c_turn;
double right_power = c_throttle - c_turn;
// Clamp to [-127, 127]
left_power = std::fmax(-127.0, std::fmin(127.0, left_power));
right_power = std::fmax(-127.0, std::fmin(127.0, right_power));
// Output to motor groups
left_motors.move(static_cast<int32_t>(left_power));
right_motors.move(static_cast<int32_t>(right_power));
pros::delay(TASK_DELAY_MS);
}
}
// ---- Public API --------------------------------------------------------------
void drive_start()
{
if (drive_task_handle != nullptr)
return; // already running
drive_task_handle = new pros::Task(drive_task_fn, nullptr, "Drive Task");
}
void drive_stop()
{
if (drive_task_handle != nullptr)
{
drive_task_handle->remove();
delete drive_task_handle;
drive_task_handle = nullptr;
}
left_motors.move(0);
right_motors.move(0);
}