Fixed firmware and toid_bot_description

This commit is contained in:
2026-01-28 17:09:50 +01:00
parent d9f179bda5
commit 6156657c2e
7 changed files with 22 additions and 24 deletions

View File

@@ -1,5 +1,9 @@
#pragma once
// STEP_PIN 26
// DIR_PIN 27
//############## CONFIG STEPPERS ################
#define DIR_PIN_A 26
#define DIR_PIN_B 16
@@ -10,7 +14,7 @@
#define SM_B 1
#define PULSE_PER_REV (1 / 3200.0)
#define SPEED_SET_TIMEOUT 1000
#define SPEED_SET_TIMEOUT 1000000
//###############################################
//================ CONFIG ENCODERS =====================

View File

@@ -213,8 +213,6 @@ void stepper_fifo(char c, uint8_t itf) {
double vr = btod(stepper_instr + 10);
set_speeds(vl, vr);
last_speed_change = SPEED_SET_TIMEOUT;
// tud_cdc_n_write(itf, (uint8_t const *) stepper_instr, 18);
// tud_cdc_n_write_flush(itf);
}
@@ -265,10 +263,6 @@ int main()
while (true) {
if(last_speed_change--) {
set_speeds(0, 0);
last_speed_change = SPEED_SET_TIMEOUT;
}
tud_task();
sleep_ms(1);
}

View File

@@ -34,7 +34,7 @@ void start_pulse(PIO pio, uint sm, uint offset, uint pin, uint freq) {
void update_sm(PIO pio, uint sm, const uint pin ,double v) {
double u_v = fabs(v);
if(u_v > 0.0005)
if(u_v > 0.00005)
pio->txf[sm] = (int)((double)clock_get_hz(clk_sys) * PULSE_PER_REV / u_v) / 2 - 5;
else
pio->txf[sm] = 0;