├── lcnc2ramps ├── MyDevice.dcm ├── lcnc2ramps.pdf ├── MyDevice.lib ├── lcnc2ramps.pro └── lcnc2ramps.sch ├── .gitignore ├── config ├── custom_postgui.hal ├── custompanel.xml ├── custom.hal ├── MendelMax.ini └── MendelMax.hal ├── README.md └── components ├── ADC2Temp.comp ├── thermistors.h └── I2C.comp /lcnc2ramps/MyDevice.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 Date: 11/26/2012 6:24:41 AM 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /lcnc2ramps/lcnc2ramps.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdsteinkuehler/LinuxCNC-RepRap/HEAD/lcnc2ramps/lcnc2ramps.pdf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | 9 | # Compiled Static libraries 10 | *.lai 11 | *.la 12 | *.a 13 | -------------------------------------------------------------------------------- /config/custom_postgui.hal: -------------------------------------------------------------------------------- 1 | # Include your customized HAL commands here 2 | # The commands in this file are run after the AXIS GUI (including PyVCP panel) starts 3 | 4 | net e0.temp.meas => pyvcp.Temp 5 | 6 | -------------------------------------------------------------------------------- /config/custompanel.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | "Temp" 13 | 300 14 | 15 | 16 | -------------------------------------------------------------------------------- /lcnc2ramps/MyDevice.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 Date: 11/26/2012 6:24:40 AM 2 | #encoding utf-8 3 | # 4 | # ADC101C021MSOP 5 | # 6 | DEF ADC101C021MSOP U 0 40 Y Y 1 F N 7 | F0 "U" 550 50 60 H V C CNN 8 | F1 "ADC101C021MSOP" 550 -550 60 H V C CNN 9 | DRAW 10 | S 300 0 800 -500 0 1 0 N 11 | X SCL 1 0 -100 300 R 50 50 1 1 I 12 | X Alert 2 0 -200 300 R 50 50 1 1 O 13 | X ADR0 3 0 -300 300 R 50 50 1 1 I 14 | X Vin 4 0 -400 300 R 50 50 1 1 I 15 | X VA 5 1100 -400 300 L 50 50 1 1 I 16 | X AD1 6 1100 -300 300 L 50 50 1 1 I 17 | X GND 7 1100 -200 300 L 50 50 1 1 I 18 | X SDA 8 1100 -100 300 L 50 50 1 1 C 19 | ENDDRAW 20 | ENDDEF 21 | # 22 | #End Library 23 | -------------------------------------------------------------------------------- /config/custom.hal: -------------------------------------------------------------------------------- 1 | # Include your customized HAL commands here 2 | # This file will not be overwritten when you run stepconf again 3 | 4 | loadrt I2C 5 | loadrt ADC2Temp 6 | loadrt comp 7 | 8 | addf I2C.0 base-thread -3 9 | addf ADC2Temp.0 servo-thread 10 | addf comp.0 servo-thread 11 | 12 | net SDAOut <= I2C.0.SDAOut 13 | net SCLOut <= I2C.0.SCLOut 14 | net SDAIn => I2C.0.SDAIn 15 | 16 | net SDAOut => parport.0.pin-14-out 17 | setp parport.0.pin-14-out-invert 1 18 | net SCLOut => parport.0.pin-16-out 19 | net SDAIn <= parport.0.pin-15-in 20 | 21 | net ADCRaw <= I2C.0.AnalogOut0 22 | net ADCNew <= I2C.0.NewValue0 23 | 24 | net ADCRaw => ADC2Temp.0.ADCIn 25 | net ADCNew => ADC2Temp.0.NewValue 26 | net e0.temp.meas <= ADC2Temp.0.TempOut 27 | 28 | setp comp.0.hyst 0.25 29 | net e0.temp.meas => comp.0.in0 30 | net ext.temp.set => comp.0.in1 31 | net e0.htr.on <= comp.0.out 32 | net e0.htr.on => parport.0.pin-17-out 33 | setp parport.0.pin-17-out-invert 1 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LinuxCNC-RepRap 2 | =============== 3 | 4 | Code and configurations to use LinuxCNC to control a RepRap 3D printer 5 | 6 | HAL Modules 7 | =========== 8 | 9 | Copy the contents of the components/ directory to src/hal/components 10 | in a LinuxCNC source working directory and build as usual. 11 | 12 | LinuxCNC Configuration 13 | ====================== 14 | 15 | Run stepconf to generate a configuration for your specific 3D printer, 16 | or start with the MendelMax.hal or MendelMax.ini file provided. 17 | 18 | Copy the custom* files to your LinuxCNC configuration directory to 19 | load the I2C ADC driver and add an extruder temperature monitor panel 20 | to the axis gui. 21 | 22 | Hardware 23 | ======== 24 | 25 | The interface between a standard PC parallel port and the RAMPS board 26 | is pretty simple (see KiCAD schematic and PDF file in lcnc2ramps). 27 | 28 | There is a single transistor inverter to convert an output pin into an 29 | open-collector drive SDA signal. Combined with a second output for SCL 30 | and an input to read the SDA status these three pins form an I2C bus to 31 | talk to the ADC (and anything else you want to connect and write code 32 | for). If you do want to add additional I2C chips, crafting a command is 33 | reasonably straight-forward. E-mail me if you can't figure it out from the comments in the I2C.comp file. 35 | 36 | There are two more single transistor inverters to insure the RAMPS FETs 37 | have enough gate drive to turn on hard. 38 | 39 | Finally, the RAMPS board is powered by 3.3V and *NOT* 5V. This is 40 | because of the ADC input requirements and to insure the stepper driver 41 | chips see the 3.3V high typical of most PC parallel ports as a logic 42 | high. 43 | 44 | -------------------------------------------------------------------------------- /config/MendelMax.ini: -------------------------------------------------------------------------------- 1 | # Generated by stepconf at Tue Oct 23 16:56:21 2012 2 | # If you make changes to this file, they will be 3 | # overwritten when you run stepconf again 4 | 5 | [EMC] 6 | MACHINE = MendelMax 7 | DEBUG = 0 8 | 9 | [DISPLAY] 10 | DISPLAY = axis 11 | EDITOR = gedit 12 | POSITION_OFFSET = RELATIVE 13 | POSITION_FEEDBACK = ACTUAL 14 | MAX_FEED_OVERRIDE = 1.2 15 | INTRO_GRAPHIC = linuxcnc.gif 16 | INTRO_TIME = 5 17 | PROGRAM_PREFIX = /home/charles/linuxcnc/nc_files 18 | INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm 19 | PYVCP = custompanel.xml 20 | 21 | [FILTER] 22 | PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image 23 | PROGRAM_EXTENSION = .py Python Script 24 | png = image-to-gcode 25 | gif = image-to-gcode 26 | jpg = image-to-gcode 27 | py = python 28 | 29 | [TASK] 30 | TASK = milltask 31 | CYCLE_TIME = 0.010 32 | 33 | [RS274NGC] 34 | PARAMETER_FILE = linuxcnc.var 35 | 36 | [EMCMOT] 37 | EMCMOT = motmod 38 | COMM_TIMEOUT = 1.0 39 | COMM_WAIT = 0.010 40 | BASE_PERIOD = 40000 41 | SERVO_PERIOD = 1000000 42 | 43 | [HAL] 44 | HALFILE = MendelMax.hal 45 | HALFILE = custom.hal 46 | POSTGUI_HALFILE = custom_postgui.hal 47 | 48 | [TRAJ] 49 | AXES = 4 50 | COORDINATES = X Y Z A 51 | MAX_ANGULAR_VELOCITY = 45.00 52 | DEFAULT_ANGULAR_VELOCITY = 4.50 53 | LINEAR_UNITS = mm 54 | ANGULAR_UNITS = degree 55 | CYCLE_TIME = 0.010 56 | DEFAULT_VELOCITY = 20.00 57 | MAX_LINEAR_VELOCITY = 200.00 58 | 59 | [EMCIO] 60 | EMCIO = io 61 | CYCLE_TIME = 0.100 62 | TOOL_TABLE = tool.tbl 63 | 64 | [AXIS_0] 65 | TYPE = LINEAR 66 | HOME = 0.0 67 | MAX_VELOCITY = 200.0 68 | MAX_ACCELERATION = 3000.0 69 | STEPGEN_MAXACCEL = 3750.0 70 | SCALE = 80.0 71 | FERROR = 1 72 | MIN_FERROR = .25 73 | MIN_LIMIT = -0.001 74 | MAX_LIMIT = 200.0 75 | HOME_OFFSET = 0.0 76 | 77 | [AXIS_1] 78 | TYPE = LINEAR 79 | HOME = 0.0 80 | MAX_VELOCITY = 200.0 81 | MAX_ACCELERATION = 3000.0 82 | STEPGEN_MAXACCEL = 3750.0 83 | SCALE = 80.0 84 | FERROR = 1 85 | MIN_FERROR = .25 86 | MIN_LIMIT = -0.001 87 | MAX_LIMIT = 200.0 88 | HOME_OFFSET = 0.0 89 | 90 | [AXIS_2] 91 | TYPE = LINEAR 92 | HOME = 0.0 93 | MAX_VELOCITY = 5.0 94 | MAX_ACCELERATION = 100.0 95 | STEPGEN_MAXACCEL = 125.0 96 | SCALE = 1511.81102362 97 | FERROR = 1 98 | MIN_FERROR = .25 99 | MIN_LIMIT = -4.0 100 | MAX_LIMIT = 200.0 101 | HOME_OFFSET = 0.0 102 | 103 | [AXIS_3] 104 | TYPE = ANGULAR 105 | HOME = 0.0 106 | MAX_VELOCITY = 31.8993189453 107 | MAX_ACCELERATION = 3000.0 108 | STEPGEN_MAXACCEL = 3750.0 109 | SCALE = 744.530002058 110 | FERROR = 1 111 | MIN_FERROR = .25 112 | MIN_LIMIT = -9999.0 113 | MAX_LIMIT = 9999.0 114 | HOME_OFFSET = 0.0 115 | -------------------------------------------------------------------------------- /lcnc2ramps/lcnc2ramps.pro: -------------------------------------------------------------------------------- 1 | update=11/26/2012 6:21:00 AM 2 | version=1 3 | last_client=eeschema 4 | [cvpcb] 5 | version=1 6 | NetITyp=0 7 | NetIExt=.net 8 | PkgIExt=.pkg 9 | NetDir= 10 | LibDir= 11 | NetType=0 12 | [cvpcb/libraries] 13 | EquName1=devcms 14 | [pcbnew] 15 | version=1 16 | PadDrlX=320 17 | PadDimH=600 18 | PadDimV=600 19 | PadForm=1 20 | PadMask=14745599 21 | ViaDiam=450 22 | ViaDril=250 23 | Isol=60 24 | Countlayer=2 25 | Lpiste=170 26 | RouteTo=15 27 | RouteBo=0 28 | TypeVia=3 29 | Segm45=1 30 | Racc45=1 31 | Unite=0 32 | SegFill=1 33 | SegAffG=0 34 | NewAffG=1 35 | PadFill=1 36 | PadAffG=1 37 | PadSNum=1 38 | ModAffC=0 39 | ModAffT=0 40 | PcbAffT=0 41 | SgPcb45=1 42 | TxtPcbV=800 43 | TxtPcbH=600 44 | TxtModV=600 45 | TxtModH=600 46 | TxtModW=120 47 | HPGLnum=1 48 | HPGdiam=15 49 | HPGLSpd=20 50 | HPGLrec=2 51 | HPGLorg=0 52 | GERBmin=15 53 | VEgarde=100 54 | DrawLar=150 55 | EdgeLar=150 56 | TxtLar=120 57 | MSegLar=150 58 | ForPlot=1 59 | WpenSer=10 60 | UserGrX=0,01 61 | UserGrY=0,01 62 | UserGrU=1 63 | DivGrPc=1 64 | TimeOut=600 65 | MaxLnkS=3 66 | ShowRat=0 67 | ShowMRa=1 68 | [pcbnew/libraries] 69 | LibDir= 70 | LibName1=sockets 71 | LibName2=connect 72 | LibName3=discret 73 | LibName4=pin_array 74 | LibName5=divers 75 | LibName6=libcms 76 | LibName7=display 77 | LibName8=valves 78 | LibName9=led 79 | LibName10=dip_sockets 80 | [general] 81 | version=1 82 | [eeschema] 83 | version=1 84 | LibDir= 85 | NetFmt=1 86 | HPGLSpd=20 87 | HPGLDm=15 88 | HPGLNum=1 89 | offX_A4=0 90 | offY_A4=0 91 | offX_A3=0 92 | offY_A3=0 93 | offX_A2=0 94 | offY_A2=0 95 | offX_A1=0 96 | offY_A1=0 97 | offX_A0=0 98 | offY_A0=0 99 | offX_A=0 100 | offY_A=0 101 | offX_B=0 102 | offY_B=0 103 | offX_C=0 104 | offY_C=0 105 | offX_D=0 106 | offY_D=0 107 | offX_E=0 108 | offY_E=0 109 | RptD_X=0 110 | RptD_Y=100 111 | RptLab=1 112 | LabSize=60 113 | [eeschema/libraries] 114 | LibName1=power 115 | LibName2=device 116 | LibName3=transistors 117 | LibName4=conn 118 | LibName5=linear 119 | LibName6=regul 120 | LibName7=74xx 121 | LibName8=cmos4000 122 | LibName9=adc-dac 123 | LibName10=memory 124 | LibName11=xilinx 125 | LibName12=special 126 | LibName13=microcontrollers 127 | LibName14=dsp 128 | LibName15=microchip 129 | LibName16=analog_switches 130 | LibName17=motorola 131 | LibName18=texas 132 | LibName19=intel 133 | LibName20=audio 134 | LibName21=interface 135 | LibName22=digital-audio 136 | LibName23=philips 137 | LibName24=display 138 | LibName25=cypress 139 | LibName26=siliconi 140 | LibName27=opto 141 | LibName28=atmel 142 | LibName29=contrib 143 | LibName30=valves 144 | LibName31=arduino_shieldsNCL 145 | LibName32=MyDevice 146 | -------------------------------------------------------------------------------- /components/ADC2Temp.comp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright (C) 2012 Charles Steinkuehler (charles AT steinkuehler DOT net 4 | * 5 | * 6 | * This module implements a conversion between ADC values representing 7 | * thermistor based temperature readings and the measured temperature 8 | * 9 | ****************************************************************************** 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of version 2 of the GNU General 13 | * Public License as published by the Free Software Foundation. 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this library; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA 22 | * 23 | * THE AUTHORS OF THIS LIBRARY ACCEPT ABSOLUTELY NO LIABILITY FOR 24 | * ANY HARM OR LOSS RESULTING FROM ITS USE. IT IS _EXTREMELY_ UNWISE 25 | * TO RELY ON SOFTWARE ALONE FOR SAFETY. Any machinery capable of 26 | * harming persons must have provisions for completely removing power 27 | * from all motors, etc, before persons enter any danger area. All 28 | * machinery must be designed to comply with local and national safety 29 | * codes, and the authors of this software can not, and do not, take 30 | * any responsibility for such compliance. 31 | * 32 | * This code was written as part of the LinucCNC HAL project. For more 33 | * information, go to www.linuxcnc.org. 34 | * 35 | ******************************************************************************/ 36 | 37 | component ADC2Temp "ADC value to Temperature Converter"; 38 | 39 | description """Converts analog thermistor reading from ADC to temperature, currently assumes a 10-bit ADC and Epcos B57560G1104 thermistor."""; 40 | 41 | pin in unsigned ADCIn "ADC input value"; 42 | pin in bit NewValue "Toggles to indicate a new sample"; 43 | pin out float TempOut "Temperature output"; 44 | 45 | function _ ; 46 | license "GPLv2 or greater"; 47 | author "Charles Steinkuehler"; 48 | 49 | variable int NewValueQ = 0; 50 | ;; 51 | 52 | 53 | #include "hal/components/thermistors.h" 54 | 55 | float TempSlope(int i) 56 | { 57 | return (TempTable[i].temp - TempTable[i-1].temp) / (TempTable[i].adc - TempTable[i-1].adc); 58 | 59 | } 60 | 61 | FUNCTION(_) 62 | { 63 | if (NewValue != NewValueQ){ 64 | NewValueQ = NewValue; 65 | 66 | int i; 67 | 68 | // Calculate new output value 69 | for (i=1 ; i < TempTableLen ; i++) 70 | { 71 | if (TempTable[i].adc > (float)ADCIn) { 72 | TempOut = TempTable[i-1].temp + (((float)ADCIn - TempTable[i-1].adc) * TempSlope(i)); 73 | break; 74 | } 75 | } 76 | } 77 | } 78 | 79 | 80 | -------------------------------------------------------------------------------- /config/MendelMax.hal: -------------------------------------------------------------------------------- 1 | # Generated by stepconf at Tue Oct 23 16:56:21 2012 2 | # If you make changes to this file, they will be 3 | # overwritten when you run stepconf again 4 | loadrt trivkins 5 | loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES 6 | loadrt probe_parport 7 | loadrt hal_parport cfg="0xdf00 out " 8 | setp parport.0.reset-time 5000 9 | loadrt stepgen step_type=0,0,0,0 10 | 11 | addf parport.0.read base-thread 12 | addf stepgen.make-pulses base-thread 13 | addf parport.0.write base-thread 14 | addf parport.0.reset base-thread 15 | 16 | addf stepgen.capture-position servo-thread 17 | addf motion-command-handler servo-thread 18 | addf motion-controller servo-thread 19 | addf stepgen.update-freq servo-thread 20 | net spindle-cmd <= motion.spindle-speed-out 21 | 22 | net xstep => parport.0.pin-02-out 23 | setp parport.0.pin-02-out-reset 1 24 | setp parport.0.pin-03-out-invert 1 25 | net xdir => parport.0.pin-03-out 26 | net ystep => parport.0.pin-04-out 27 | setp parport.0.pin-04-out-reset 1 28 | net ydir => parport.0.pin-05-out 29 | net zstep => parport.0.pin-06-out 30 | setp parport.0.pin-06-out-reset 1 31 | net zdir => parport.0.pin-07-out 32 | net astep => parport.0.pin-08-out 33 | setp parport.0.pin-08-out-reset 1 34 | net adir => parport.0.pin-09-out 35 | 36 | 37 | 38 | 39 | setp stepgen.0.position-scale [AXIS_0]SCALE 40 | setp stepgen.0.steplen 1 41 | setp stepgen.0.stepspace 0 42 | setp stepgen.0.dirhold 45000 43 | setp stepgen.0.dirsetup 45000 44 | setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL 45 | net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd 46 | net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb 47 | net xstep <= stepgen.0.step 48 | net xdir <= stepgen.0.dir 49 | net xenable axis.0.amp-enable-out => stepgen.0.enable 50 | 51 | setp stepgen.1.position-scale [AXIS_1]SCALE 52 | setp stepgen.1.steplen 1 53 | setp stepgen.1.stepspace 0 54 | setp stepgen.1.dirhold 45000 55 | setp stepgen.1.dirsetup 45000 56 | setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL 57 | net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd 58 | net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb 59 | net ystep <= stepgen.1.step 60 | net ydir <= stepgen.1.dir 61 | net yenable axis.1.amp-enable-out => stepgen.1.enable 62 | 63 | setp stepgen.2.position-scale [AXIS_2]SCALE 64 | setp stepgen.2.steplen 1 65 | setp stepgen.2.stepspace 0 66 | setp stepgen.2.dirhold 45000 67 | setp stepgen.2.dirsetup 45000 68 | setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL 69 | net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd 70 | net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb 71 | net zstep <= stepgen.2.step 72 | net zdir <= stepgen.2.dir 73 | net zenable axis.2.amp-enable-out => stepgen.2.enable 74 | 75 | setp stepgen.3.position-scale [AXIS_3]SCALE 76 | setp stepgen.3.steplen 1 77 | setp stepgen.3.stepspace 0 78 | setp stepgen.3.dirhold 45000 79 | setp stepgen.3.dirsetup 45000 80 | setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL 81 | net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd 82 | net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb 83 | net astep <= stepgen.3.step 84 | net adir <= stepgen.3.dir 85 | net aenable axis.3.amp-enable-out => stepgen.3.enable 86 | 87 | net estop-out <= iocontrol.0.user-enable-out 88 | net estop-out => iocontrol.0.emc-enable-in 89 | 90 | loadusr -W hal_manualtoolchange 91 | net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change 92 | net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed 93 | net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number 94 | net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared 95 | -------------------------------------------------------------------------------- /components/thermistors.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright (C) 2012 Charles Steinkuehler (charles AT steinkuehler DOT net) 4 | * 5 | * 6 | * This module contains thermister look-up tables for use by the ADC2Temp 7 | * module in converting ADC readings to temperature. 8 | * 9 | ****************************************************************************** 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of version 2 of the GNU General 13 | * Public License as published by the Free Software Foundation. 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this library; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA 22 | * 23 | * THE AUTHORS OF THIS LIBRARY ACCEPT ABSOLUTELY NO LIABILITY FOR 24 | * ANY HARM OR LOSS RESULTING FROM ITS USE. IT IS _EXTREMELY_ UNWISE 25 | * TO RELY ON SOFTWARE ALONE FOR SAFETY. Any machinery capable of 26 | * harming persons must have provisions for completely removing power 27 | * from all motors, etc, before persons enter any danger area. All 28 | * machinery must be designed to comply with local and national safety 29 | * codes, and the authors of this software can not, and do not, take 30 | * any responsibility for such compliance. 31 | * 32 | * This code was written as part of the LinucCNC HAL project. For more 33 | * information, go to www.linuxcnc.org. 34 | * 35 | ******************************************************************************/ 36 | 37 | struct TableEntry { 38 | float adc; 39 | float temp; 40 | }; 41 | 42 | // TempTable is expected to start with adc=0 and cover all possible ADC readings 43 | 44 | const struct TableEntry TempTable[] = { 45 | // adc, temp 46 | { 0.00, 400.0 }, 47 | { 22.83, 300.0 }, 48 | { 24.42, 295.0 }, 49 | { 26.15, 290.0 }, 50 | { 28.04, 285.0 }, 51 | { 30.09, 280.0 }, 52 | { 32.32, 275.0 }, 53 | { 34.76, 270.0 }, 54 | { 37.42, 265.0 }, 55 | { 40.34, 260.0 }, 56 | { 43.52, 255.0 }, 57 | { 47.01, 250.0 }, 58 | { 50.83, 245.0 }, 59 | { 55.03, 240.0 }, 60 | { 59.64, 235.0 }, 61 | { 64.70, 230.0 }, 62 | { 70.27, 225.0 }, 63 | { 76.40, 220.0 }, 64 | { 83.15, 215.0 }, 65 | { 90.58, 210.0 }, 66 | { 98.77, 205.0 }, 67 | { 107.80, 200.0 }, 68 | { 117.74, 195.0 }, 69 | { 128.70, 190.0 }, 70 | { 140.77, 185.0 }, 71 | { 154.04, 180.0 }, 72 | { 168.64, 175.0 }, 73 | { 184.67, 170.0 }, 74 | { 202.23, 165.0 }, 75 | { 221.43, 160.0 }, 76 | { 242.36, 155.0 }, 77 | { 265.11, 150.0 }, 78 | { 289.76, 145.0 }, 79 | { 316.32, 140.0 }, 80 | { 344.81, 135.0 }, 81 | { 375.19, 130.0 }, 82 | { 407.37, 125.0 }, 83 | { 441.20, 120.0 }, 84 | { 476.47, 115.0 }, 85 | { 512.92, 110.0 }, 86 | { 550.22, 105.0 }, 87 | { 587.99, 100.0 }, 88 | { 625.81, 95.0 }, 89 | { 663.24, 90.0 }, 90 | { 699.84, 85.0 }, 91 | { 735.17, 80.0 }, 92 | { 768.87, 75.0 }, 93 | { 800.57, 70.0 }, 94 | { 830.04, 65.0 }, 95 | { 857.10, 60.0 }, 96 | { 881.61, 55.0 }, 97 | { 903.57, 50.0 }, 98 | { 923.00, 45.0 }, 99 | { 940.00, 40.0 }, 100 | { 954.73, 35.0 }, 101 | { 967.34, 30.0 }, 102 | { 978.03, 25.0 }, 103 | { 987.01, 20.0 }, 104 | { 994.48, 15.0 }, 105 | { 1000.63, 10.0 }, 106 | { 1005.66, 5.0 }, 107 | { 1009.72, 0.0 }, 108 | { 1012.98, -5.0 }, 109 | { 1015.57, -10.0 }, 110 | { 1017.61, -15.0 }, 111 | { 1019.20, -20.0 }, 112 | { 1020.43, -25.0 }, 113 | { 1021.37, -30.0 }, 114 | { 1022.09, -35.0 }, 115 | { 1022.62, -40.0 }, 116 | { 1023.02, -45.0 }, 117 | { 1023.31, -50.0 }, 118 | { 1023.52, -55.0 } }; 119 | 120 | int TempTableLen = sizeof(TempTable) / sizeof(TempTable[0]); 121 | 122 | -------------------------------------------------------------------------------- /components/I2C.comp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright (C) 2012 Charles Steinkuehler (charles AT steinkuehler DOT net) 4 | * 5 | * 6 | * This module implements a crude I2C interface to an ADC intended to assist 7 | * in connecting LinuxCNC with a 3D printer 8 | * 9 | ****************************************************************************** 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of version 2 of the GNU General 13 | * Public License as published by the Free Software Foundation. 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public 20 | * License along with this library; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA 22 | * 23 | * THE AUTHORS OF THIS LIBRARY ACCEPT ABSOLUTELY NO LIABILITY FOR 24 | * ANY HARM OR LOSS RESULTING FROM ITS USE. IT IS _EXTREMELY_ UNWISE 25 | * TO RELY ON SOFTWARE ALONE FOR SAFETY. Any machinery capable of 26 | * harming persons must have provisions for completely removing power 27 | * from all motors, etc, before persons enter any danger area. All 28 | * machinery must be designed to comply with local and national safety 29 | * codes, and the authors of this software can not, and do not, take 30 | * any responsibility for such compliance. 31 | * 32 | * This code was written as part of the LinucCNC HAL project. For more 33 | * information, go to www.linuxcnc.org. 34 | * 35 | ******************************************************************************/ 36 | 37 | component I2C "I2C Interface"; 38 | 39 | description """Crude I2C Interface. Reads analog data from hard-coded address, and assumes an ADC101C021."""; 40 | 41 | pin in bit SDAIn "SDA Input"; 42 | pin out bit SDAOut "SDA Output"; 43 | pin out bit SCLOut "SCL Output"; 44 | 45 | //param rw unsigned cmdparm[5] = { 0x01, 0x102, 0x103, 0x204, 0x205 } "I2C Command Parameter"; 46 | pin out unsigned AnalogOut# [2] "ADC Result"; 47 | pin out bit NewValue# [2] "Toggles to indicate new value on Analog"; 48 | 49 | // Debugging 50 | param r unsigned RawRxData# [5] "Data received from I2C bus"; 51 | param r unsigned RawRxBit "Internal Rx Bit from SDA"; 52 | 53 | function _ nofp; 54 | license "GPLv2 or greater"; 55 | author "Charles Steinkuehler"; 56 | 57 | variable int dir; 58 | variable u16 TxByte; 59 | variable u16 TxBit; 60 | variable u16 RxByte; 61 | variable u16 RxBit; 62 | variable u16 RxData [5]; 63 | variable int CmdByte = 0; 64 | variable int RxByteNum = 0; 65 | variable int ByteState = 0; 66 | variable int BitState = 0; 67 | ;; 68 | 69 | 70 | // #include 71 | 72 | // u16 I2C data byte breaks down into: 73 | // 0x00FF Data Byte : Data byte to transmit if Direction=Write 74 | // 0x0100 Ack : Ack value to transmit if Direction=Read 75 | // : 1=Send Ack (SDA low) 76 | // 0x0200 Skip-Ack : 1=Skip ack bit (required for some broken I2C devices) 77 | // 0x0400 Start : 1=Generate Start before Data_Byte is transfered 78 | // 0x0800 Stop : 1=Generate Stop after Ack is transfered 79 | // 0x1000 Direction : 1=Read, 0=Write 80 | // 0xE000 Reserved 81 | 82 | 83 | enum I2C_Byte_State 84 | { // Byte State Definitions 85 | eIdle = 0, // 0000 = Idle 86 | eStart = 1, // 0001 = Start 87 | eBit7 = 2, // 0010 = Bit7 88 | eBit6 = 3, // 0011 = Bit6 89 | eBit5 = 4, // 0100 = Bit5 90 | eBit4 = 5, // 0101 = Bit4 91 | eBit3 = 6, // 0110 = Bit3 92 | eBit2 = 7, // 0111 = Bit2 93 | eBit1 = 8, // 1000 = Bit1 94 | eBit0 = 9, // 1001 = Bit0 95 | eAck = 10, // 1010 = Ack 96 | eStop = 11, // 1011 = Stop 97 | eNewByte = 12, // 1100 = Reserved 98 | eReserved_13 = 13, // 1101 = Reserved 99 | eReserved_14 = 14, // 1110 = Reserved 100 | eReserved_15 = 15 // 1111 = Reserved 101 | }; 102 | 103 | enum I2C_Bit_State 104 | { 105 | eBitIdle = 0, 106 | eSDA_Valid = 1, 107 | eSCL_High = 2, 108 | eSCL_Low = 3, 109 | eBitStart = 4, 110 | eBitStop = 5, 111 | eNewBit = 6 112 | }; 113 | 114 | // Clock out a bunch of ones and send a stop, in case I2C bus got confused 115 | const u16 command_init[5] = { 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x08FF }; 116 | 117 | // Select register 0 (conversion result) and read two bytes 118 | const u16 command[5] = { 0x04a8, 0x0000, 0x04a9, 0x1100, 0x1800 }; 119 | 120 | FUNCTION(_) 121 | { 122 | unsigned RxValue; 123 | 124 | // Command state machine 125 | // Cycles through all Tx/Rx bytes then repeats 126 | if (ByteState==eIdle) { 127 | if (CmdByte==0 && RxByteNum != 0){ 128 | RxValue = (RxData[4] & 0xFC) >> 2; 129 | RxValue |= (RxData[3] & 0x0F) << 6; 130 | AnalogOut(0) = RxValue; 131 | NewValue(0) = ! NewValue(0); 132 | } 133 | ByteState = eNewByte; 134 | TxByte = command[CmdByte]; 135 | RxByte = 0; 136 | RxByteNum = CmdByte; 137 | CmdByte++; 138 | if (CmdByte == 5) { 139 | CmdByte = 0; 140 | } 141 | 142 | if ((TxByte & 0x1000) == 0x1000) { 143 | dir = 1; // Read 144 | } else { 145 | dir = 0; // Write 146 | } 147 | 148 | } 149 | 150 | // Byte state machine 151 | // Cycles through the various bits in a byte until all are transmitted 152 | if (BitState==eBitIdle || BitState==eSCL_Low) { 153 | switch (ByteState) { 154 | case eNewByte : 155 | if ((TxByte & 0x0400) == 0x0400) { 156 | ByteState = eStart; 157 | TxBit = 1; 158 | BitState = eNewBit; 159 | } else { 160 | ByteState = eBit7; 161 | TxBit = (dir==0) ? (TxByte >> 7) & 0x01 : 1; 162 | BitState = eNewBit; 163 | } 164 | break; 165 | case eStart: 166 | case eBit7 : 167 | case eBit6 : 168 | case eBit5 : 169 | case eBit4 : 170 | case eBit3 : 171 | case eBit2 : 172 | case eBit1 : 173 | ByteState++; 174 | TxBit = (dir==0) ? (TxByte >> (eBit0 - ByteState)) & 0x01 : 1; 175 | BitState = eNewBit; 176 | if (ByteState != eStart) { 177 | RxByte <<= 1; 178 | RxByte |= RxBit; 179 | } 180 | break; 181 | case eBit0 : 182 | ByteState = eAck; 183 | TxBit = (dir==0) ? 1 : ((TxByte >> 8) & 0x01) ^ 0x01; 184 | BitState = eNewBit; 185 | RxByte <<= 1; 186 | RxByte |= RxBit; 187 | break; 188 | case eAck : 189 | if ((TxByte & 0x0800) == 0x0800) { 190 | ByteState = eStop; 191 | TxBit = 0; 192 | BitState = eNewBit; 193 | } else { 194 | ByteState = eIdle; 195 | } 196 | if (RxBit==0) { 197 | RxByte |= 0x0100; 198 | } 199 | RxData[RxByteNum] = RxByte; 200 | // Debugging 201 | RawRxData(RxByteNum) = RxByte; 202 | break; 203 | case eStop : 204 | default : 205 | ByteState = eIdle; 206 | } 207 | } 208 | 209 | // Bit state machine 210 | // Cycles through the various states required to send one bit on the I2C bus 211 | // Bit type : State transitions 212 | // Start : eSDA_Valid (SDA=1) -> eSCL_High -> eBitStart (SDA=0) -> eSCL_Low 213 | // Normal: eSDA_Valid (SDA=x) -> eSCL_High -> eSCL_Low 214 | // Stop : eSDA_Valid (SDA=0) -> eSCL_High -> eBitStop (SDA=1) -> eIdle 215 | switch (BitState) { 216 | case eNewBit : 217 | BitState = eSDA_Valid; 218 | SDAOut = TxBit; 219 | break; 220 | case eSDA_Valid : 221 | BitState = eSCL_High; 222 | SCLOut = 1; 223 | break; 224 | case eSCL_High : 225 | if (SDAIn == 0) { 226 | RxBit = 0x00; 227 | } else { 228 | RxBit = 0x01; 229 | } 230 | RawRxBit = SDAIn; 231 | if (ByteState==eStart) { 232 | BitState = eBitStart; 233 | SDAOut = 0; 234 | } else { 235 | if (ByteState==eStop) { 236 | BitState = eBitStop; 237 | SDAOut = 1; 238 | } else { 239 | BitState = eSCL_Low; 240 | SCLOut = 0; 241 | } 242 | } 243 | break; 244 | case eSCL_Low : 245 | BitState = eBitIdle; 246 | break; 247 | case eBitStart : 248 | BitState = eSCL_Low; 249 | SCLOut = 0; 250 | break; 251 | case eBitStop : 252 | BitState = eBitIdle; 253 | SCLOut = 1; 254 | break; 255 | default : 256 | BitState = eBitIdle; 257 | SCLOut = 1; 258 | SDAOut = 1; 259 | } 260 | } 261 | 262 | 263 | -------------------------------------------------------------------------------- /lcnc2ramps/lcnc2ramps.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 2 date 11/26/2012 6:16:10 AM 2 | LIBS:power 3 | LIBS:device 4 | LIBS:transistors 5 | LIBS:conn 6 | LIBS:linear 7 | LIBS:regul 8 | LIBS:74xx 9 | LIBS:cmos4000 10 | LIBS:adc-dac 11 | LIBS:memory 12 | LIBS:xilinx 13 | LIBS:special 14 | LIBS:microcontrollers 15 | LIBS:dsp 16 | LIBS:microchip 17 | LIBS:analog_switches 18 | LIBS:motorola 19 | LIBS:texas 20 | LIBS:intel 21 | LIBS:audio 22 | LIBS:interface 23 | LIBS:digital-audio 24 | LIBS:philips 25 | LIBS:display 26 | LIBS:cypress 27 | LIBS:siliconi 28 | LIBS:opto 29 | LIBS:atmel 30 | LIBS:contrib 31 | LIBS:valves 32 | LIBS:arduino_shieldsNCL 33 | LIBS:MyDevice 34 | LIBS:lcnc2ramps-cache 35 | EELAYER 25 0 36 | EELAYER END 37 | $Descr A4 11700 8267 38 | encoding utf-8 39 | Sheet 1 1 40 | Title "" 41 | Date "26 nov 2012" 42 | Rev "" 43 | Comp "" 44 | Comment1 "" 45 | Comment2 "" 46 | Comment3 "" 47 | Comment4 "" 48 | $EndDescr 49 | Text Notes 5800 1400 0 60 ~ 0 50 | Power RAMPS from 3.3V to insure\nstepper drivers recognize the 3.3V\nparallel port signals as a logical high\nand prevent thermistor signals from\nexceeding the ADC input range 51 | Text Notes 1750 7200 0 60 ~ 0 52 | Resistor values are not critical\nAnything from 1K to 10K\nshould work fine 53 | Text Notes 7800 6500 0 60 ~ 0 54 | Bypass capacitors \nfor ADC converters\n0.01uF to 0.1 uF 55 | Connection ~ 7400 6900 56 | Wire Wire Line 57 | 7000 6900 7000 6800 58 | Wire Wire Line 59 | 7600 6900 7000 6900 60 | Connection ~ 7400 6300 61 | Wire Wire Line 62 | 7000 6400 7000 6300 63 | Wire Wire Line 64 | 7000 6300 7600 6300 65 | Wire Wire Line 66 | 8000 1500 8200 1500 67 | Wire Wire Line 68 | 5600 6500 5600 6600 69 | Wire Wire Line 70 | 5600 6600 5500 6600 71 | Wire Wire Line 72 | 3900 6400 4400 6400 73 | Wire Wire Line 74 | 6000 6400 5500 6400 75 | Connection ~ 8100 1700 76 | Wire Wire Line 77 | 8100 1600 8100 5900 78 | Wire Wire Line 79 | 8100 1600 8200 1600 80 | Connection ~ 10200 4100 81 | Wire Wire Line 82 | 10200 1000 10200 5650 83 | Wire Wire Line 84 | 10200 1000 10100 1000 85 | Connection ~ 8100 3850 86 | Wire Wire Line 87 | 8100 3850 8200 3850 88 | Connection ~ 8100 5700 89 | Wire Wire Line 90 | 8200 5700 8100 5700 91 | Connection ~ 8100 2900 92 | Wire Wire Line 93 | 8100 2900 8200 2900 94 | Wire Wire Line 95 | 10100 1400 10900 1400 96 | Wire Wire Line 97 | 7400 2100 8200 2100 98 | Wire Wire Line 99 | 7400 2700 8200 2700 100 | Wire Wire Line 101 | 7400 4650 8200 4650 102 | Wire Wire Line 103 | 10100 4500 10900 4500 104 | Wire Wire Line 105 | 10100 4300 10900 4300 106 | Wire Wire Line 107 | 7400 4850 8200 4850 108 | Wire Wire Line 109 | 7400 2600 8200 2600 110 | Wire Wire Line 111 | 7400 2000 8200 2000 112 | Wire Wire Line 113 | 1400 6600 700 6600 114 | Wire Wire Line 115 | 700 5000 1400 5000 116 | Connection ~ 1700 1200 117 | Wire Wire Line 118 | 1600 1200 1800 1200 119 | Wire Wire Line 120 | 2400 3500 1600 3500 121 | Wire Wire Line 122 | 2400 3200 1600 3200 123 | Wire Wire Line 124 | 2400 4000 2300 4000 125 | Wire Wire Line 126 | 2300 4000 2300 4100 127 | Wire Wire Line 128 | 2400 5300 2300 5300 129 | Wire Wire Line 130 | 2300 5300 2300 5200 131 | Connection ~ 4500 4700 132 | Wire Wire Line 133 | 5000 4700 4500 4700 134 | Wire Wire Line 135 | 4500 4800 4500 4600 136 | Wire Wire Line 137 | 4100 5000 4200 5000 138 | Wire Wire Line 139 | 1600 3300 2400 3300 140 | Wire Wire Line 141 | 1600 2900 2400 2900 142 | Wire Wire Line 143 | 1600 2500 2400 2500 144 | Wire Wire Line 145 | 1600 2100 2400 2100 146 | Connection ~ 1700 2400 147 | Wire Wire Line 148 | 1700 2400 1600 2400 149 | Connection ~ 1700 2000 150 | Wire Wire Line 151 | 1700 2000 1600 2000 152 | Connection ~ 1700 1600 153 | Wire Wire Line 154 | 1700 1600 1600 1600 155 | Wire Wire Line 156 | 1700 1200 1700 2600 157 | Wire Wire Line 158 | 1700 2600 1600 2600 159 | Wire Wire Line 160 | 1700 1400 1600 1400 161 | Connection ~ 1700 1400 162 | Wire Wire Line 163 | 1700 1800 1600 1800 164 | Connection ~ 1700 1800 165 | Wire Wire Line 166 | 1700 2200 1600 2200 167 | Connection ~ 1700 2200 168 | Wire Wire Line 169 | 1600 1900 2400 1900 170 | Wire Wire Line 171 | 1600 2300 2400 2300 172 | Wire Wire Line 173 | 1600 2700 2400 2700 174 | Wire Wire Line 175 | 1600 3100 2400 3100 176 | Wire Wire Line 177 | 1900 5000 2000 5000 178 | Wire Wire Line 179 | 2300 4800 2300 4600 180 | Wire Wire Line 181 | 2800 4700 2300 4700 182 | Connection ~ 2300 4700 183 | Wire Wire Line 184 | 4500 5200 4500 5300 185 | Wire Wire Line 186 | 4500 5300 4600 5300 187 | Wire Wire Line 188 | 4500 4100 4500 4000 189 | Wire Wire Line 190 | 4500 4000 4600 4000 191 | Wire Wire Line 192 | 1600 3000 2400 3000 193 | Wire Wire Line 194 | 2400 3400 1600 3400 195 | Wire Wire Line 196 | 2400 2800 1600 2800 197 | Wire Wire Line 198 | 3100 5000 3600 5000 199 | Wire Wire Line 200 | 8100 2200 8200 2200 201 | Wire Wire Line 202 | 8100 5900 8000 5900 203 | Wire Wire Line 204 | 10100 4100 10200 4100 205 | Wire Wire Line 206 | 10200 5650 10300 5650 207 | Wire Wire Line 208 | 8100 3950 8200 3950 209 | Connection ~ 8100 3950 210 | Wire Wire Line 211 | 8100 1700 8200 1700 212 | Connection ~ 8100 2200 213 | Wire Wire Line 214 | 5500 6700 5700 6700 215 | Wire Wire Line 216 | 5700 6500 5500 6500 217 | Connection ~ 5600 6500 218 | Wire Wire Line 219 | 3900 6700 4400 6700 220 | Wire Wire Line 221 | 7400 3400 8200 3400 222 | Wire Wire Line 223 | 7400 3500 8200 3500 224 | Wire Wire Line 225 | 7400 3600 8200 3600 226 | Connection ~ 2300 6300 227 | Wire Wire Line 228 | 2800 6300 2300 6300 229 | Wire Wire Line 230 | 2300 6200 2300 6400 231 | Wire Wire Line 232 | 1900 6600 2000 6600 233 | Wire Wire Line 234 | 2300 6800 2300 6900 235 | Wire Wire Line 236 | 2300 6900 2400 6900 237 | Wire Wire Line 238 | 2300 5700 2300 5600 239 | Wire Wire Line 240 | 2300 5600 2400 5600 241 | Wire Wire Line 242 | 3900 7500 4400 7500 243 | Wire Wire Line 244 | 5500 7300 5700 7300 245 | Wire Wire Line 246 | 5500 7500 5700 7500 247 | Wire Wire Line 248 | 6000 7200 5500 7200 249 | Wire Wire Line 250 | 3900 7200 4400 7200 251 | Wire Wire Line 252 | 10100 1600 10900 1600 253 | Wire Wire Line 254 | 7400 6300 7400 6400 255 | Wire Wire Line 256 | 7400 6900 7400 6800 257 | Text GLabel 7600 6900 2 60 Input ~ 0 258 | GND 259 | Text GLabel 7600 6300 2 60 Input ~ 0 260 | +3.3V 261 | $Comp 262 | L C C? 263 | U 1 1 50B35B97 264 | P 7400 6600 265 | F 0 "C?" H 7450 6700 50 0000 L CNN 266 | F 1 "C" H 7450 6500 50 0000 L CNN 267 | 1 7400 6600 268 | 1 0 0 -1 269 | $EndComp 270 | $Comp 271 | L C C? 272 | U 1 1 50B35B8E 273 | P 7000 6600 274 | F 0 "C?" H 7050 6700 50 0000 L CNN 275 | F 1 "C" H 7050 6500 50 0000 L CNN 276 | 1 7000 6600 277 | 1 0 0 -1 278 | $EndComp 279 | Text GLabel 8000 1500 0 60 Input ~ 0 280 | +3.3V 281 | Text Label 10300 1600 0 60 ~ 0 282 | D8 283 | $Comp 284 | L ADC101C021MSOP U? 285 | U 1 1 50AA6EA5 286 | P 4400 7100 287 | F 0 "U?" H 4950 7150 60 0000 C CNN 288 | F 1 "ADC101C021MSOP" H 4950 6550 60 0000 C CNN 289 | 1 4400 7100 290 | 1 0 0 -1 291 | $EndComp 292 | Text Label 5600 7200 0 60 ~ 0 293 | SDA 294 | Text Label 4000 7200 0 60 ~ 0 295 | SCL 296 | Text GLabel 5700 7500 2 60 Input ~ 0 297 | +3.3V 298 | Text GLabel 5700 7300 2 60 Input ~ 0 299 | GND 300 | Text Label 4000 7500 0 60 ~ 0 301 | Therm1 302 | $Comp 303 | L NPN Q? 304 | U 1 1 50AA6E44 305 | P 2200 6600 306 | F 0 "Q?" H 2200 6450 50 0000 R CNN 307 | F 1 "NPN" H 2200 6750 50 0000 R CNN 308 | 1 2200 6600 309 | 1 0 0 -1 310 | $EndComp 311 | $Comp 312 | L R R? 313 | U 1 1 50AA6E43 314 | P 2300 5950 315 | F 0 "R?" V 2380 5950 50 0000 C CNN 316 | F 1 "R" V 2300 5950 50 0000 C CNN 317 | 1 2300 5950 318 | 1 0 0 -1 319 | $EndComp 320 | $Comp 321 | L R R? 322 | U 1 1 50AA6E42 323 | P 1650 6600 324 | F 0 "R?" V 1730 6600 50 0000 C CNN 325 | F 1 "R" V 1650 6600 50 0000 C CNN 326 | 1 1650 6600 327 | 0 -1 -1 0 328 | $EndComp 329 | Text GLabel 2400 6900 2 60 Input ~ 0 330 | GND 331 | Text GLabel 2400 5600 2 60 Input ~ 0 332 | +12V 333 | Text Label 2400 6300 0 60 ~ 0 334 | D8 335 | Text Label 7500 3600 0 60 ~ 0 336 | Therm2 337 | Text Label 7500 3500 0 60 ~ 0 338 | Therm1 339 | Text Label 7500 3400 0 60 ~ 0 340 | Therm0 341 | Text Label 4000 6700 0 60 ~ 0 342 | Therm0 343 | Text GLabel 5700 6500 2 60 Input ~ 0 344 | GND 345 | Text GLabel 5700 6700 2 60 Input ~ 0 346 | +3.3V 347 | Text Label 4000 6400 0 60 ~ 0 348 | SCL 349 | Text Label 5600 6400 0 60 ~ 0 350 | SDA 351 | $Comp 352 | L ADC101C021MSOP U? 353 | U 1 1 50AA6C25 354 | P 4400 6300 355 | F 0 "U?" H 4950 6350 60 0000 C CNN 356 | F 1 "ADC101C021MSOP" H 4950 5750 60 0000 C CNN 357 | 1 4400 6300 358 | 1 0 0 -1 359 | $EndComp 360 | Text GLabel 8000 5900 0 60 Input ~ 0 361 | GND 362 | Text GLabel 10300 5650 2 60 Input ~ 0 363 | GND 364 | Text Notes 7600 5700 0 60 ~ 0 365 | X-En 366 | Text Notes 10300 4100 0 60 ~ 0 367 | E0-En 368 | $Comp 369 | L ARDUINO_MEGA_SHIELD SHIELD? 370 | U 1 1 50944BF3 371 | P 9200 3250 372 | F 0 "SHIELD?" H 8800 5750 60 0000 C CNN 373 | F 1 "ARDUINO_MEGA_SHIELD" H 9100 550 60 0000 C CNN 374 | 1 9200 3250 375 | 1 0 0 -1 376 | $EndComp 377 | Text Label 2400 4700 0 60 ~ 0 378 | D10 379 | Text Notes 7600 2900 0 60 ~ 0 380 | Z-En 381 | Text Notes 7600 2200 0 60 ~ 0 382 | Y-En 383 | Text Label 10300 4300 0 60 ~ 0 384 | E0-Step 385 | Text Label 10300 4500 0 60 ~ 0 386 | E0-Dir 387 | Text Label 7600 2000 0 60 ~ 0 388 | X-Step 389 | Text Label 7600 2100 0 60 ~ 0 390 | X-Dir 391 | Text Label 7600 2600 0 60 ~ 0 392 | Y-Step 393 | Text Label 7600 2700 0 60 ~ 0 394 | Y-Dir 395 | Text Label 7600 4850 0 60 ~ 0 396 | Z-Step 397 | Text Label 7600 4650 0 60 ~ 0 398 | Z-Dir 399 | Text Label 10300 1400 0 60 ~ 0 400 | D10 401 | Text Label 800 6600 0 60 ~ 0 402 | Bed-Heater 403 | Text Label 800 5000 0 60 ~ 0 404 | E0-Heater 405 | Text Label 3150 5000 0 60 ~ 0 406 | SDA-Out 407 | Text GLabel 1800 1200 2 60 Input ~ 0 408 | GND 409 | Text Label 4600 4700 0 60 ~ 0 410 | SDA 411 | Text GLabel 4600 4000 2 60 Input ~ 0 412 | +3.3V 413 | Text GLabel 2400 4000 2 60 Input ~ 0 414 | +12V 415 | Text GLabel 2400 5300 2 60 Input ~ 0 416 | GND 417 | Text GLabel 4600 5300 2 60 Input ~ 0 418 | GND 419 | Text Label 1800 3500 0 60 ~ 0 420 | Bed-Heater 421 | Text Label 1800 2800 0 60 ~ 0 422 | E0-Heater 423 | Text Label 1800 3400 0 60 ~ 0 424 | SDA-Out 425 | Text Label 1800 3200 0 60 ~ 0 426 | SDA 427 | Text Label 1800 3000 0 60 ~ 0 428 | SCL 429 | Text Label 1800 2300 0 60 ~ 0 430 | Z-Dir 431 | Text Label 1800 2500 0 60 ~ 0 432 | Z-Step 433 | Text Label 1800 2700 0 60 ~ 0 434 | Y-Dir 435 | Text Label 1800 2900 0 60 ~ 0 436 | Y-Step 437 | Text Label 1800 3100 0 60 ~ 0 438 | X-Dir 439 | Text Label 1800 3300 0 60 ~ 0 440 | X-Step 441 | Text Label 1800 1900 0 60 ~ 0 442 | E0-Dir 443 | Text Label 1800 2100 0 60 ~ 0 444 | E0-Step 445 | $Comp 446 | L DB25 J? 447 | U 1 1 508D25E7 448 | P 1150 2300 449 | F 0 "J?" H 1200 3650 70 0000 C CNN 450 | F 1 "DB25" H 1100 950 70 0000 C CNN 451 | 1 1150 2300 452 | -1 0 0 -1 453 | $EndComp 454 | $Comp 455 | L R R? 456 | U 1 1 508D2547 457 | P 3850 5000 458 | F 0 "R?" V 3930 5000 50 0000 C CNN 459 | F 1 "R" V 3850 5000 50 0000 C CNN 460 | 1 3850 5000 461 | 0 -1 -1 0 462 | $EndComp 463 | $Comp 464 | L R R? 465 | U 1 1 508D2530 466 | P 1650 5000 467 | F 0 "R?" V 1730 5000 50 0000 C CNN 468 | F 1 "R" V 1650 5000 50 0000 C CNN 469 | 1 1650 5000 470 | 0 -1 -1 0 471 | $EndComp 472 | $Comp 473 | L R R? 474 | U 1 1 508D252B 475 | P 4500 4350 476 | F 0 "R?" V 4580 4350 50 0000 C CNN 477 | F 1 "R" V 4500 4350 50 0000 C CNN 478 | 1 4500 4350 479 | 1 0 0 -1 480 | $EndComp 481 | $Comp 482 | L R R? 483 | U 1 1 508D2523 484 | P 2300 4350 485 | F 0 "R?" V 2380 4350 50 0000 C CNN 486 | F 1 "R" V 2300 4350 50 0000 C CNN 487 | 1 2300 4350 488 | 1 0 0 -1 489 | $EndComp 490 | $Comp 491 | L NPN Q? 492 | U 1 1 508D24FA 493 | P 4400 5000 494 | F 0 "Q?" H 4400 4850 50 0000 R CNN 495 | F 1 "NPN" H 4400 5150 50 0000 R CNN 496 | 1 4400 5000 497 | 1 0 0 -1 498 | $EndComp 499 | $Comp 500 | L NPN Q? 501 | U 1 1 508D24E4 502 | P 2200 5000 503 | F 0 "Q?" H 2200 4850 50 0000 R CNN 504 | F 1 "NPN" H 2200 5150 50 0000 R CNN 505 | 1 2200 5000 506 | 1 0 0 -1 507 | $EndComp 508 | $EndSCHEMATC 509 | --------------------------------------------------------------------------------