A platform to create a remote control with display for a 10hp up-cut saw that cuts aluminum, plastic and other materials. It is controlled by a Variable Frequency Drive (VFD) which is mounted at the back of the saw, making it inconvenient to change the blade speed to match the material being cut.

Dependencies:   Grove_LCD_RGB_Backlight mbed

Fork of Grove_LCD_RGB_Backlight_HelloWorld by Chandler Matz

Revision:
1:64466c2ec269
Parent:
0:be3b212d1b17
diff -r be3b212d1b17 -r 64466c2ec269 main.cpp
--- a/main.cpp	Tue Mar 15 17:21:58 2016 +0000
+++ b/main.cpp	Thu Aug 17 15:53:01 2017 +0000
@@ -1,39 +1,70 @@
 #include "Grove_LCD_RGB_Backlight.h"
 #include "mbed.h"
+/*
+I used the "Grove RGB LCD Display" by Chandler Matz
+https://developer.mbed.org/users/cmatz3/notebook/grove-rgb-lcd-display/
+as a platform to create a remote control with display for a
+10hp up-cut saw that cuts aluminum, plastic and other materials. It is 
+controlled by a Variable Frequency Drive (VFD) which is mounted at the 
+back of the saw, making it inconvienient to change the blade speed 
+to match the material being cut.
+****USED****
+Board = FRDM-K22F 
+Pot = 50K multi-turn
+VFD = Leasson Speedmaster series
+Analog input over pot from control 0-10V (T2, T5)
+Analog output from terminal (T30) 0-10V
+3 x 3.3K ohm resistors
+1 x 6.2K ohm  
+2 of the 3.3k are pull ups for I2C and the other is in series with 
+6.2K from T30 for ain max of 1mA @ 10V = 3.47V (this came out to be very 
+close to the K22 supply from the FRDM board)
+*/
 
-Grove_LCD_RGB_Backlight rgbLCD(p9, p10);
-//I2C i2c(p9, p10);
-//Serial pc(USBTX, USBRX);
+AnalogIn pot(PTB0); //Voltage from VFD reference pin in the FRDM-K22F
+Grove_LCD_RGB_Backlight rgbLCD(PTE0, PTE1);
+I2C i2c(PTE0, PTE1);
+
+
 
 int main()
 {
-
-   rgbLCD.setRGB(0xff, 0xff, 0xff);                 //set the color 
-   rgbLCD.print("Hello World!");
+   float ain;  // VFD reference pin 
+   char volts[12];  // make a 'volts' string
+   ain = pot.read()*3550;  // Voltage from VFD * the maximum blade RPM 
+   sprintf(volts, "%f", ain); // send ain to volts
+   rgbLCD.clear(); // Just 
+   wait(5);
+   rgbLCD.print("Blade Speed ");
+   rgbLCD.setRGB(0x00, 0x66, 0xaa); 
    rgbLCD.locate(0,1);
-   rgbLCD.print("This is a test");
-   wait(5);
+   rgbLCD.print(volts);
+   wait(.5);
    int count = 0;
    while(1)
    {
-     if (count == 0)
+     if (count < 0x0fffffff)
      {
-         rgbLCD.setRGB(0xff, 0x00, 0x00);
+         ain = pot.read()*3550;
+         sprintf(volts, "%f", ain);
+         rgbLCD.locate(0,1);
+         rgbLCD.print(volts);
+         wait(.5);
+         count ++;
      }   
-     else if (count == 1)
+     else 
      {
-         rgbLCD.setRGB(0x00, 0xff, 0x00);
+         ain = pot.read()*3550;
+         sprintf(volts, "%f", ain);
+         rgbLCD.locate(0,1);
+         rgbLCD.print(volts);
+         wait(.5);
+         count = 0;
+   
      }
-     else if (count == 2)
-     {
-         rgbLCD.setRGB(0x00, 0x00, 0xff);
-     }
-     wait(1);
-     count++;
-     if(count == 3)
-     {
-         count = 0;
-     }
+    
+
+     
      
    }
 }
\ No newline at end of file