Updated firmware for new pcb

This commit is contained in:
2025-04-11 15:41:02 +02:00
parent a4691caeed
commit f064bcfc69
4 changed files with 34 additions and 16 deletions

View File

@ -1,10 +1,10 @@
#pragma once
//############## CONFIG STEPPERS ################
#define DIR_PIN_A 16
#define DIR_PIN_B 26
#define PULSE_PIN_A 17
#define PULSE_PIN_B 27
#define DIR_PIN_A 26
#define DIR_PIN_B 16
#define PULSE_PIN_A 27
#define PULSE_PIN_B 17
#define SM_A 0
#define SM_B 1

View File

@ -59,8 +59,8 @@ bool update_pos_cb() {
vel_l /=64 * ENCODER_CPR;
vel_r /=64 * ENCODER_CPR;
vel_l *= WHEEL_RADIUS * 2 * M_PI * wheel_ratio_l;
vel_r *= -WHEEL_RADIUS * 2 * M_PI * wheel_ratio_r;
vel_l *= WHEEL_RADIUS * 2 * M_PI;
vel_r *= -WHEEL_RADIUS * 2 * M_PI;
const double linear = (vel_l + vel_r) / 2;
const double angular = (vel_r - vel_l) / wheel_separation;