Skip to content

Commit

Permalink
well two out of three motors are now stepping
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Aug 7, 2024
1 parent 9bfa10c commit 1d465c1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ void MX_TIM3_Init(void) {

void motor_hardware_interrupt_init(void){
MX_TIM17_Init();
// MX_TIM20_Init();
// MX_TIM3_Init();
MX_TIM20_Init();
MX_TIM3_Init();
}

void motor_hardware_init(void){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "firmware/freertos_tasks.hpp"
#include "firmware/ui_hardware.h"

static constexpr uint32_t HALF_SECOND = 100;
static constexpr uint32_t HALF_SECOND = 500;

namespace ui_control_task {

Expand Down
4 changes: 2 additions & 2 deletions stm32-modules/flex-stacker/firmware/ui/ui_hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ void ui_hardware_set_heartbeat_led(bool setting) {
HAL_GPIO_WritePin(nSTATUS_LED_GPIO_Port, nSTATUS_LED_Pin,
setting ? GPIO_PIN_SET : GPIO_PIN_RESET);

HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2,
setting ? GPIO_PIN_SET : GPIO_PIN_RESET);
// HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2,
// setting ? GPIO_PIN_SET : GPIO_PIN_RESET);
}
10 changes: 5 additions & 5 deletions stm32-modules/include/flex-stacker/firmware/motor_interrupt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class MotorInterruptController {
public:
MotorInterruptController(MotorID m_id): m_id(m_id) {}
void tick() {
// unstep_motor(m_id);
// step_count = (step_count + 1) % 20000;
// if (step_count == 0) {
// step_motor(m_id);
// }
unstep_motor(m_id);
step_count = (step_count + 1) % 20000;
if (step_count == 0) {
step_motor(m_id);
}
}
private:
MotorID m_id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static constexpr tmc2160::TMC2160RegisterMap motor_x_config{
.hstrt = 0b111,
.hend = 0b1001,
.tbl = 0b1,
.mres = 0b100},
.mres = 0b1000},
.coolconf = {.semin = 0b11, .semax = 0b100},
.pwmconf = {.pwm_ofs = 0x1F,
.pwm_grad = 0x18,
Expand Down

0 comments on commit 1d465c1

Please sign in to comment.