Browse Source

feat: move_mag_at_pos. changed stepper direction in order to work with positive position value, e.g. 0--->400mm axis travel

SG/Cellrobot 4 months ago
parent
commit
701a6b465a
2 changed files with 2 additions and 2 deletions
  1. 1 1
      playgrounds/gpio_playground.py
  2. 1 1
      robot_control/src/robot/mag_distributor.py

+ 1 - 1
playgrounds/gpio_playground.py

@@ -6,7 +6,7 @@ A simple GPIO pin toggler using pigpio and asyncio.
 Toggles GPIO pins based on keyboard input (Enter key).
 """
 
-pins = [27]
+pins = [22]
 # pins = [17, 27, 22]
 
 async def toggle_pin(pin: int, shared_state):

+ 1 - 1
robot_control/src/robot/mag_distributor.py

@@ -123,7 +123,7 @@ class MagDistributor:
             step_delay = self._speed_to_step_delay(self.max_speed_mmmin)
 
         linear_steps = int(abs(pos_target - self.curr_pos_mm) * self.steps_per_mm)
-        linear_dir = True if pos_target > self.curr_pos_mm else False
+        linear_dir = False if pos_target > self.curr_pos_mm else True
         if linear_steps > 0:
             self.gpio.do_step(self.linear_dir_pin, self.linear_step_pin, linear_steps, step_delay, linear_dir)
             self.curr_pos_mm = pos_target