Elias Bakken avatar Elias Bakken committed 2c6cfd9

Unable to compile the firmware on Ubuntu, so the firmware file is added for now

Comments (0)

Files changed (7)

 software:
 	scp software/*.py $(REMOTE):$(RPATH)/software
 
+gui: 
+	scp -r software/gui/ $(REMOTE):$(RPATH)/software
+
 minicom:
 	minicom -o -b 115200 -D /dev/ttyUSB1
 
Add a comment to this file

PCB_rev1/Replicape_BOM_rev1.xlsx

Binary file modified.

eeprom/replicape.json

     "header": "aa5533ee",
     "formatRev": "1",
     "boardName": "Replicape 3D printer cape",
-    "version": "1",
-    "manufacturer": "Elias Bakken",
-    "partNumber": "BB-REPLICAPE-01",
+    "version": "00A1",
+    "manufacturer": "Intelligent Agent AS",
+    "partNumber": "BB-BONE-REPLICAP",
     "numPins": 29,
     "serialNumber": "00000000001",
     "currentVDD_3V3EXP": 40,
Add a comment to this file

firmware/firmware_pru_0.bin

Binary file added.

software/Replicape.py

     
 logging.basicConfig(level=logging.INFO)
 
+#import signal
+#import sys
+#def signal_handler(signal, frame):
+#        print 'You pressed Ctrl+C!'
+#        sys.exit(0)
+#signal.signal(signal.SIGINT, signal_handler)
+
 class Replicape:
     ''' Init '''
     def __init__(self):
         self.steppers = {}
 
         # Init the 5 Stepper motors
-        self.steppers["X"]  = SMD(io.GPIO1_12, io.GPIO1_13, io.GPIO2_4,  0, "X")  # Fault_x should be PWM2A?
-        self.steppers["Y"]  = SMD(io.GPIO1_31, io.GPIO1_30, io.GPIO1_15, 1, "Y")  
-        self.steppers["Z"]  = SMD(io.GPIO1_1,  io.GPIO1_2,  io.GPIO0_27, 2, "Z")  
+        self.steppers["X"] = SMD(io.GPIO1_12, io.GPIO1_13, io.GPIO2_4,  0, "X")  # Fault_x should be PWM2A?
+        self.steppers["Y"] = SMD(io.GPIO1_31, io.GPIO1_30, io.GPIO1_15, 1, "Y")  
+        self.steppers["Z"] = SMD(io.GPIO1_1,  io.GPIO1_2,  io.GPIO0_27, 2, "Z")  
         self.steppers["E"] = SMD(io.GPIO3_21, io.GPIO1_7, io.GPIO2_1,  3, "Ext1")
-        self.steppers["F"]  = SMD(io.GPIO1_14, io.GPIO1_6, io.GPIO2_3,  4, "Ext2")
-
-        
+        self.steppers["F"] = SMD(io.GPIO1_14, io.GPIO1_6, io.GPIO2_3,  4, "Ext2")
 
         # Enable the steppers and set the current, steps pr mm and microstepping  
         self.steppers["X"].setCurrentValue(1.0) # 2A
         self.steppers["Z"].set_steps_pr_mm(155)
         self.steppers["Z"].set_microstepping(2) 
 
-        self.steppers["E"].setCurrentValue(1.0) # 2A        
+        self.steppers["E"].setCurrentValue(1.5) # 2A        
         self.steppers["E"].setEnabled()
         self.steppers["E"].set_steps_pr_mm(5.0)
         self.steppers["E"].set_microstepping(2)
 
         # init the 3 thermistors
-        self.therm_ext1 = Thermistor(io.AIN4, "Ext_1", chart_name="QU-BD")
+        self.therm_ext1 = Thermistor(io.AIN4, "Ext_1", chart_name="B57560G104F") # QU-BD
         self.therm_hbp  = Thermistor(io.AIN6, "HBP", chart_name="B57560G104F")
 
         # init the 3 heaters
             print "Caught signal, exiting" 
             return
         finally:
-            self.ext1.disable()
-            self.hbp.disable()
+            self.ext1.disable()            
+            self.hbp.disable()            
             self.usb.close() 
             self.path_planner.exit()   
-        logging.debug("Done")
+            print "Done"
 		
     ''' Execute a G-code '''
     def _execute(self, g):
             #    self.p.ext1.setPvalue(float(self.tokens[1][1::]))
         elif g.code() == "M140":                                    # Set bed temperature
             self.hbp.setTargetTemperature(float(g.tokenValue(0)))
+        elif g.code() == "M141":
+            fan = self.fans[int(g.getValueByLetter("P"))]
+            fan.setPWMFrequency(int(g.getValueByLetter("F")))
+            fan.setValue(float(g.getValueByLetter("S")))	           
         else:
             print "Unknown command: "+g.message	
    

software/Thermistor.py

 # Import PyBBIO library:
 import bbio as io
 import numpy as np
+import time 
 
 # Import the temp chart. 
 from temp_chart import *
         self.name = name
         # Get the chart and transpose it
         self.temp_table = map(list, zip(*temp_chart[chart_name]))    
-        self.temp_history = list() # Keep the last measurements for calculating the derivative
         self.debug = 0
 	
-    ''' Return the temperture in degrees celcius '''
+    ''' Return the temperature in degrees celcius '''
     def getTemperature(self):	
+        #print "Getting Temp"
         Thermistor.mutex.acquire()                        # Get the mutex
+        #print "Mutex acquired"
         try:
-            io.delay(1)
-            adc_val = 0
-            for i in range(100):                           # Average 100 times
-                adc_val += io.analogRead(self.pin)        # Read the value 		
-                io.delay(1)                               # Make sure it has settled
-            adc_val /= 100    
+            time.sleep(1)
+            #print "Delay done"
+            adc_val = io.analogRead(self.pin)        # Read the value 		
+            time.sleep(1)
+            print "Got adc value: "+str(adc_val)
+        except:
+            print "Unexpected error:", sys.exc_info()[0]          
         finally:
+            #print "Releasing mutex"
             Thermistor.mutex.release()                    # Release the mutex
         voltage = io.inVolts(adc_val)                     # Convert to voltage
         res_val = self.voltage_to_resistance(voltage)     # Convert to resistance  
 
     ''' Convert the voltage to a resistance value '''
     def voltage_to_resistance(self, v_sense):
+        if v_sense == 0:
+            return 10000000.0
         return  4700.0/((1.8/v_sense)-1.0)
 
     ''' Set the deuglevel '''

software/temp_chart.py

 [300., 107.8 ]]
 
 
-temp_chart["QU-BD"] = [[-40, 3244417], 
-[-39, 3037884], 
-[-38, 2846091], 
-[-37, 2667881], 
-[-36, 2502195], 
-[-35, 2348064], 
-[-34, 2204600], 
-[-33, 2070989], 
-[-32, 1946485], 
-[-31, 1830404], 
-[-30, 1722117], 
-[-29, 1619804], 
-[-28, 1524332], 
-[-27, 1435195], 
-[-26, 1351930], 
-[-25, 1274110], 
-[-24, 1201342], 
-[-23, 1133262], 
-[-22, 1069538], 
-[-21, 1009861], 
-[-20, 953946], 
-[-19, 900392], 
-[-18, 850230], 
-[-17, 803222], 
-[-16, 759149], 
-[-15, 717809], 
-[-14, 679013], 
-[-13, 642588], 
-[-12, 608375], 
-[-11, 576224], 
-[-10, 545997], 
-[-9, 516582], 
-[-8, 488956], 
-[-7, 462999], 
-[-6, 438598], 
-[-5, 415652], 
-[-4, 395391], 
-[-3, 376258], 
-[-2, 358181], 
-[-1, 341096], 
+temp_chart["QU-BD"] = [
 [0, 324942], 
 [1, 308535], 
 [2, 293066], 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.