proj: switching to ESP32C6

This commit is contained in:
2024-12-14 21:22:20 +01:00
parent 2dc06e8d79
commit bd923e4fdc
11 changed files with 566 additions and 2471 deletions
@@ -204,7 +204,6 @@ class StepperMotor {
}
void demoFullTurn() {
auto steps = _config.resolution * _config.steps;
ESP_LOGI("Stepper", "Running %i * %i steps for full turn", _config.resolution, _config.steps);
ESP_LOGI("Stepper", "Start is %f.2", getScaledPos());
+1 -1
View File
@@ -19,7 +19,7 @@ PwmPort::PwmPort(ledc_timer_t timer, ledc_channel_t channel, gpio_num_t output,
.duty_resolution = resolution,
.timer_num = timer,
.freq_hz = frequency,
.clk_cfg = LEDC_AUTO_CLK,
.clk_cfg = LEDC_AUTO_CLK
};
ESP_ERROR_CHECK(ledc_timer_config(&ledc_timer));
@@ -63,7 +63,6 @@ StepperDriverDrv8833::StepperDriverDrv8833(Pins pins, int resolution)
populateLookUps(resolution, _outA1, _outA2, _outB1, _outB2);
char buffer[resolution * 2 + 10];
ESP_LOGD("Stepper", "Output Data:");
ESP_LOG_BUFFER_HEXDUMP("Stepper", _outA1.data(), _outA1.size(), ESP_LOG_DEBUG);
ESP_LOG_BUFFER_HEXDUMP("Stepper", _outA2.data(), _outA2.size(), ESP_LOG_DEBUG);
+1 -2
View File
@@ -43,7 +43,6 @@ class ProfileGenerator {
Profile createRapidStartSwingInEnd(float delta) {
init();
auto pnt = getStopDistance(_aMax, _wMax);
auto wMax = _wMax;
// t0..t1: acceleration to max velocity
accelUntil(_aMax * 2, 0, [wMax](Point pnt) { return pnt.w > (wMax * 2); });
@@ -159,7 +158,7 @@ class ProfileGenerator {
t = t + _dT;
float env = a * t;
float p = std::sin(sTau * t / TwMax) * env * TwMax / sTau;
float w = (p - _pVec.back()) / _dT;
float w = (p - pX) / _dT;
if (w > _wMax) {
break;
}