فهرست منبع

fix mirror issue

Tuan Nguyen 11 ماه پیش
والد
کامیت
64ea72d99e

+ 3 - 3
dune_weaver_flask/modules/core/pattern_manager.py

@@ -143,14 +143,14 @@ def move_polar(theta, rho):
     
     delta_theta = theta - state.current_theta
     delta_rho = rho - state.current_rho
-    x_increment = delta_theta * 100 / (2 * pi * x_scaling_factor) # Scale down x from 100mm to 50mm per revolution
-    y_increment = delta_rho * 100 / y_scaling_factor # Scale down y from 100mm to 20mm from center to perimeter
+    x_increment = delta_theta * 100 / (2 * pi * x_scaling_factor)  # Added -1 to reverse direction
+    y_increment = delta_rho * 100 / y_scaling_factor
     
     x_total_steps = state.x_steps_per_mm * (100/x_scaling_factor)
     y_total_steps = state.y_steps_per_mm * (100/y_scaling_factor)
         
     offset = x_increment * (x_total_steps * x_scaling_factor / (state.gear_ratio * y_total_steps * y_scaling_factor))
-    y_increment -= offset
+    y_increment += offset
     
     new_x_abs = state.machine_x + x_increment
     new_y_abs = state.machine_y + y_increment

+ 2 - 2
dune_weaver_flask/modules/core/state.py

@@ -8,7 +8,7 @@ class AppState:
         # Private variables for properties
         self._current_playing_file = None
         self._pause_requested = False
-        self._speed = 250
+        self._speed = 150
         self._current_playlist = None
         
         # Regular state variables
@@ -120,7 +120,7 @@ class AppState:
         self.is_clearing = data.get("is_clearing", False)
         self.current_theta = data.get("current_theta", 0)
         self.current_rho = data.get("current_rho", 0)
-        self._speed = data.get("speed", 250)
+        self._speed = data.get("speed", 150)
         self.machine_x = data.get("machine_x", 0.0)
         self.machine_y = data.get("machine_y", 0.0)
         self.x_steps_per_mm = data.get("x_steps_per_mm", 0.0)

+ 7 - 1
dune_weaver_flask/static/js/main.js

@@ -366,7 +366,13 @@ async function previewPattern(fileName, containerId = 'pattern-preview-container
 
         const result = await response.json();
         if (result.success) {
-            const coordinates = result.coordinates;
+            // Mirror the theta values in the coordinates
+            const coordinates = result.coordinates.map(coord => [
+                (coord[0] < Math.PI) ? 
+                    Math.PI - coord[0] : // For first half
+                    3 * Math.PI - coord[0], // For second half
+                coord[1]
+            ]);
 
             // Render the pattern in the specified container
             const canvasId = containerId === 'currently-playing-container'

+ 1 - 1
firmware/dune_weaver/config.yaml

@@ -22,7 +22,7 @@ axes:
       pulloff_mm: 2
       stepstick:
         step_pin: i2so.1
-        direction_pin: i2so.2
+        direction_pin: i2so.2:low
         disable_pin: NO_PIN
         ms1_pin: NO_PIN
         ms2_pin: NO_PIN

+ 1 - 1
firmware/dune_weaver/dlc32_sensorless_homing.yml

@@ -24,7 +24,7 @@ axes:
       pulloff_mm: 2
       stepstick:
         step_pin: i2so.1
-        direction_pin: i2so.2
+        direction_pin: i2so.2:low
         disable_pin: NO_PIN
         ms1_pin: NO_PIN
         ms2_pin: NO_PIN

+ 2 - 2
firmware/dune_weaver_mini/config.yaml

@@ -19,9 +19,9 @@ axes:
       hard_limits: false
       unipolar:
         phase0_pin: gpio.14
-        phase1_pin: gpio.12
+        phase1_pin: gpio.27
         phase2_pin: gpio.26
-        phase3_pin: gpio.27
+        phase3_pin: gpio.12
         half_step: false
       limit_neg_pin: NO_PIN
       limit_pos_pin: NO_PIN

+ 1 - 1
firmware/dune_weaver_pro/config.yaml

@@ -22,7 +22,7 @@ axes:
       pulloff_mm: 2
       stepstick:
         step_pin: i2so.1
-        direction_pin: i2so.2:low
+        direction_pin: i2so.2
         disable_pin: NO_PIN
         ms1_pin: NO_PIN
         ms2_pin: NO_PIN

+ 1 - 1
firmware/dune_weaver_pro/dlc32_dwpro_sensorless_homing.yaml

@@ -24,7 +24,7 @@ axes:
       pulloff_mm: 2
       stepstick:
         step_pin: i2so.1
-        direction_pin: i2so.2.low
+        direction_pin: i2so.2
         disable_pin: NO_PIN
         ms1_pin: NO_PIN
         ms2_pin: NO_PIN