DRIVER_RMT was not declared in scope
Hi,
I assume this is my issue as when I use
stepperConnectPin(STEP_PIN_MAIN)
everything is fine. But When I attempt
117 | stepperMain = engine.stepperConnectToPin(STEP_PIN_MAIN, DRIVER_RMT);
| ^~~~~~~~~~
exit status 1
Compilation error: 'DRIVER_RMT' was not declared in this scope
It is attaching to an ESP32-WROOM-32. Using without attempting to declare DRIVER_RMT works fine, a few RPM inconstancies as it will vary slightly (hence trying DRIVER_RMT). But the above error is driving me mad, as I cannot get round it. I know the is probably my issue/understanding but a pointer in the right direction/your an idiot it won't work would be helpful - thanks,
It seems espidf5 is in use, but the mcpwm/pcnt-driver is no longer available with espidf5. Therefore, this driver option is no longer available.
Could you please clarify the rpm inconsistencies and which FastAccelStepper version is currently in use?
Thanks for the feedback, that would explain it.
As for the RPM, I have an RPM monitor (connected to an attached encoder). If I run a dedicated Stepper controller module at various speeds ( 200 - 800) the RPM is very stable, it reads with + or - 1 rpm what it has been set to.
But when using the lib (0.33.0) the RPM seems jump around, so for example, when set to run 400 RPM, it will jump between 390 - 410 (according to the monitor).
The code simplified is (the speed is just an example):
engine.init();
stepperMain = engine.stepperConnectToPin(STEP_PIN_MAIN);
if(stepperMain ){
Serial.println("Enabling Steppers....");
stepperMain->setDirectionPin(DIRECTION_PIN_MAIN);
stepperMain->setAutoEnable(true);
stepperMain->setAcceleration(10000);
delay(3000);
stepperMain->setSpeedInHz(11000);
stepperMain->runForward();
} else {
Serial.println("Error Enabling Steppers...");
errorCode = ERROR_STEPPER_INIT;
}
I need the continuous speed to be a stable as possible as it is controlling a cutter.
Actually the rmt-driver should be very stable. Could you please share the actually frequency, which need to be generated ?
I have added test case to check the rmt entry generation and all looks fine. I only saw, that the high time of the step was slightly changing. This I have corrected, but should not have an impact on the step rate. This could be only visible, if the hardware stepper module is acting on step transition HIGH to LOW, instead of the LOW to HIGH transition. Could you please check for this ?
Stepper is now acting on LOW to HIGH, in fact now controlling 2 steppers. There was also a slight discrepancy due to the stepper motors mountings. Updating all this seems to have corrected the issue seen - thank you.