Clear planner coolant and spindle state on stop, Added M8.1 and M7.1 coolant off...
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Tue, 29 Sep 2020 22:33:23 +0000 (15:33 -0700)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Tue, 29 Sep 2020 22:33:23 +0000 (15:33 -0700)
CHANGELOG.md
src/avr/src/spindle.h
src/avr/src/state.c
src/avr/src/vfd_spindle.c
src/pug/templates/tool-view.pug
src/resources/config-template.json

index 77a6144ff66830c47e2de323f363b4dba119635e..71826988c5e0f3e2b301f2616146500b62cfbb8c 100644 (file)
@@ -9,6 +9,9 @@ Buildbotics CNC Controller Firmware Changelog
  - Fix motor step alignment when changing motor parameters like microsteping.
  - Stall detect homing.
  - Improved voltage spike clamping time.
+ - Support for WJ200 VFD
+ - Added M8.1 and M7.1 coolant off commands.
+ - Clear planner coolant and spindle state on stop.
 
 ## v0.4.14
  - Handle file uploads with '#' or '?' in the name.
index 0b01476e9ac8499fa3d81e6df7d595dac5137d9e..14207410bc0698b009bf7ea4f9a3d0dc0014b7af 100644 (file)
@@ -58,6 +58,7 @@ typedef enum {
   SPINDLE_TYPE_SUNFAR_E300,
   SPINDLE_TYPE_OMRON_MX2,
   SPINDLE_TYPE_V70,
+  SPINDLE_TYPE_WJ200,
 } spindle_type_t;
 
 
index 946cae3f0133aa825bca05bafb714a9847688937..6410b54196516a0fdb70f95030a8e636ad1903a4 100644 (file)
@@ -126,6 +126,7 @@ static void _stop() {
     spindle_stop();
     outputs_stop();
     seek_cancel();
+    _set_state(STATE_HOLDING);
     break;
 
   case STATE_STOPPING:
index 82bd4225b166b5b0b1bedc690026cac20bce132c..144383c528bde837b2d086411296f6f4e7d310be 100644 (file)
@@ -154,6 +154,7 @@ const vfd_reg_t sunfar_e300_regs[] PROGMEM = {
 };
 
 
+// Register value for Modbus is one less than in the datasheet
 const vfd_reg_t omron_mx2_regs[] PROGMEM = {
   {REG_CONNECT_WRITE,  0x1200,     3}, // A001 Frequency reference modbus
   {REG_CONNECT_WRITE,  0x1201,     3}, // A002 Run command modbus
@@ -180,6 +181,10 @@ const vfd_reg_t v70_regs[] PROGMEM = {
 };
 
 
+// Same as OMRON MX2
+#define wj200_regs omron_mx2_regs
+
+
 static vfd_reg_t regs[VFDREG];
 static vfd_reg_t custom_regs[VFDREG];
 
@@ -399,6 +404,7 @@ void vfd_spindle_init() {
   case SPINDLE_TYPE_SUNFAR_E300:      _load(sunfar_e300_regs);        break;
   case SPINDLE_TYPE_OMRON_MX2:        _load(omron_mx2_regs);          break;
   case SPINDLE_TYPE_V70:              _load(v70_regs);                break;
+  case SPINDLE_TYPE_WJ200:            _load(wj200_regs);              break;
   default: break;
   }
 
index 390fd20296becf606e53789f36c2216104ba1ab3..7b9a611f5979c393fa1ab2c41295f17d376b27cf 100644 (file)
@@ -442,3 +442,48 @@ script#tool-view-template(type="text/x-template")
           |
           a(href="https://buildbotics.com/upload/vfd/stepperonline-v70.pdf",
             target="_blank") Stepper Online V70 VFD manual
+
+      .notes(v-if="tool_type.startsWith('WJ200')")
+        h2 Notes
+        p Set the following using the VFD's front panel.
+        table.modbus-regs.fixed-regs
+          tr
+            th Address
+            th Value
+            th Meaning
+            th Description
+          tr
+            td.reg-addr A001
+            td.reg-value 3
+            td Modbus
+            td Frequency source
+          tr
+            td.reg-addr A002
+            td.reg-value 3
+            td Modbus
+            td Run source
+          tr
+            td.reg-addr C071
+            td.reg-value 5
+            td 9600 BAUD rate
+            td Must match #[tt baud] above
+          tr
+            td.reg-addr C072
+            td.reg-value 1
+            td Slave address
+            td Must match #[tt bus-id] above
+          tr
+            td.reg-addr C074
+            td.reg-value 0
+            td no parity
+            td Must match #[tt parity] above
+          tr
+            td.reg-addr C075
+            td.reg-value 2
+            td 2 stop bits
+            td Communication stop bits
+        p
+          | Other settings according to the
+          |
+          a(href="https://buildbotics.com/upload/vfd/wj200.pdf",
+            target="_blank") WJ200 VFD manual
index 90c1f52a87ebcbb3b710582baf8fd21f2edc3b55..72e553a74d06e234599ebc42c2cfbf4e2844f6a7 100644 (file)
       "values": ["Disabled", "PWM Spindle", "Huanyang VFD", "Custom Modbus VFD",
                  "AC-Tech VFD", "Nowforever VFD", "Delta VFD015M21A (Beta)",
                  "YL600, YL620, YL620-A VFD (Beta)", "FR-D700 (Beta)",
-                 "Sunfar E300 (Beta)", "OMRON MX2", "V70"],
+                 "Sunfar E300 (Beta)", "OMRON MX2", "V70", "WJ200"],
       "default": "Disabled",
       "code": "st"
     },