From a13b8ed1bd46407a02243e8825e3aebe15ec7cc8 Mon Sep 17 00:00:00 2001 From: Terje Io Date: Sat, 1 Feb 2020 12:38:08 +0100 Subject: [PATCH] Added motor disable timeout updatet default file endings to KiCad v5, YOffset config++ --- PCB Laser.suo | Bin 19968 -> 28672 bytes PCB Laser/About.Designer.cs | 4 +- PCB Laser/PCB Laser.csproj | 12 ---- PCB Laser/Program.cs | 4 +- PCB Laser/UserUI.Designer.cs | 73 +++++++++++++------------ PCB Laser/UserUI.cs | 103 +++++++++++++++++++++++++++-------- PCB Laser/app.config | 3 + README.md | 9 +++ 8 files changed, 134 insertions(+), 74 deletions(-) create mode 100644 PCB Laser/app.config diff --git a/PCB Laser.suo b/PCB Laser.suo index cb06fd403a259cef3cbe75636bdc46fc34e6005b..75837152efccf3223ae47c2f7d91951c92f79702 100644 GIT binary patch delta 3290 zcmchZdrX_x6~Mo1j4|+qH-tw_%$s07=lk#r0v&z=CZ>=PvaE5p*uk(6f&t@%5U5Sk zv|Cke!6&WOHC0KYO-yantgf_dlUAyw(*8(C+ohVafBIOvY*VVWQjoH29XrPl>U3JQ zP1COR^S$@n_c`aD`-RW5@Vo5tK^ZS`9QXH)c!F`6x~Lunb%+jWKpGKPR;Y_xu%Jf_ z2#p|&(IuINMdaf-XV28%{c!bdmWHidb#zYtJ@#O-ml8#pNEVWmZAmHTVL2ZuKnjr} zq!=kdwj!knjVn*&RCd9XV*6g&C~cS|v{A~NFxMc>h=6F3oroLx8barw!zIsR#Igx# zMcNSfK+#;~z(N;76DH}!`tF2m4@eme;{HVKfkb`)b1(8>qD~_ZV%d|Z!#6XU-4j^x zBa_G!GK~a~8DthYh8#y|@CnT4kdw$fvVc550M2($`tlBryNmK)q6S>3@TR<0L0#k=%w_fRWY^r3Hn^SDzlD({ zD^jFP0m1A+B^i{qM3eBb8BstflKYBml0lWc5YFXlm@iWB4e%;UGvx7RSX5S2#*3p9 zzG>~DfZ4vwJuvMb^BtNAxc40n1f#13W?3Z9&evc+a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9sM1Xi%Bb_9W?nlzoBp!iIf8O>gGwr7-W9-w{NS)^*x2Mff6)z$>*a zaJF{4ie?81kGjBNv)ddfw$iK^^!(c0Yn&y1=l0c$t4sPnX;!cblk6MK)NuF7mC+hp zMiDN9>1qqNcSGo?2ye9PHUu_%FJ6DJLgaJFhJ{~`tz}wUA1E_FkNlv{taq|XSURl% z`-w_ej(OpXZ#?s5zg?;GcLW0x!tEXH;XzoPNTz$bH7cBj-Uxd5kn9;`Yh_}KT<`f_ zL;tHef{3uuJHXZTrue - - - {F8E4294A-18DF-4CB8-8967-ABE5FD4D18B3} - 4 - 0 - 0 - tlbimp - False - False - True - - False diff --git a/PCB Laser/Program.cs b/PCB Laser/Program.cs index b137d0d..276d795 100644 --- a/PCB Laser/Program.cs +++ b/PCB Laser/Program.cs @@ -11,11 +11,11 @@ static class Program /// The main entry point for the application. /// [STAThread] - static void Main() + static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new UserUI()); + Application.Run(new UserUI(args)); } } } diff --git a/PCB Laser/UserUI.Designer.cs b/PCB Laser/UserUI.Designer.cs index ef72d61..29f4863 100644 --- a/PCB Laser/UserUI.Designer.cs +++ b/PCB Laser/UserUI.Designer.cs @@ -36,14 +36,13 @@ private void InitializeComponent() this.label2 = new System.Windows.Forms.Label(); this.btnStart = new System.Windows.Forms.Button(); this.zFocus = new System.Windows.Forms.TrackBar(); - this.label3 = new System.Windows.Forms.Label(); + this.lblFocus = new System.Windows.Forms.Label(); this.txtStatus = new System.Windows.Forms.TextBox(); this.dropInfo = new System.Windows.Forms.Label(); this.btnCancel = new System.Windows.Forms.Button(); this.grpBox = new System.Windows.Forms.GroupBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); this.zOn = new System.Windows.Forms.CheckBox(); - this.label4 = new System.Windows.Forms.Label(); + this.lblPower = new System.Windows.Forms.Label(); this.zPower = new System.Windows.Forms.TrackBar(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.chkMirror = new System.Windows.Forms.CheckBox(); @@ -57,6 +56,7 @@ private void InitializeComponent() this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.cbxSolderEmulsion = new System.Windows.Forms.ComboBox(); + this.btnMotors = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.pcb)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.zFocus)).BeginInit(); this.grpBox.SuspendLayout(); @@ -120,7 +120,7 @@ private void InitializeComponent() // // zFocus // - this.zFocus.Location = new System.Drawing.Point(23, 47); + this.zFocus.Location = new System.Drawing.Point(84, 47); this.zFocus.Maximum = 100; this.zFocus.Name = "zFocus"; this.zFocus.Orientation = System.Windows.Forms.Orientation.Vertical; @@ -128,15 +128,17 @@ private void InitializeComponent() this.zFocus.TabIndex = 6; this.zFocus.TabStop = false; this.zFocus.Value = 50; + this.zFocus.Visible = false; // - // label3 + // lblFocus // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(20, 31); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(39, 13); - this.label3.TabIndex = 7; - this.label3.Text = "Focus:"; + this.lblFocus.AutoSize = true; + this.lblFocus.Location = new System.Drawing.Point(81, 31); + this.lblFocus.Name = "lblFocus"; + this.lblFocus.Size = new System.Drawing.Size(39, 13); + this.lblFocus.TabIndex = 7; + this.lblFocus.Text = "Focus:"; + this.lblFocus.Visible = false; // // txtStatus // @@ -169,12 +171,11 @@ private void InitializeComponent() // // grpBox // - this.grpBox.Controls.Add(this.textBox1); this.grpBox.Controls.Add(this.zOn); - this.grpBox.Controls.Add(this.label4); - this.grpBox.Controls.Add(this.zPower); + this.grpBox.Controls.Add(this.lblPower); this.grpBox.Controls.Add(this.zFocus); - this.grpBox.Controls.Add(this.label3); + this.grpBox.Controls.Add(this.lblFocus); + this.grpBox.Controls.Add(this.zPower); this.grpBox.Location = new System.Drawing.Point(668, 105); this.grpBox.Name = "grpBox"; this.grpBox.Size = new System.Drawing.Size(137, 179); @@ -182,13 +183,6 @@ private void InitializeComponent() this.grpBox.TabStop = false; this.grpBox.Text = "Laser"; // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(45, 0); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(100, 20); - this.textBox1.TabIndex = 11; - // // zOn // this.zOn.AutoSize = true; @@ -199,19 +193,19 @@ private void InitializeComponent() this.zOn.Text = "On"; this.zOn.UseVisualStyleBackColor = true; // - // label4 + // lblPower // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(68, 31); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(40, 13); - this.label4.TabIndex = 9; - this.label4.Text = "Power:"; + this.lblPower.AutoSize = true; + this.lblPower.Location = new System.Drawing.Point(12, 31); + this.lblPower.Name = "lblPower"; + this.lblPower.Size = new System.Drawing.Size(40, 13); + this.lblPower.TabIndex = 9; + this.lblPower.Text = "Power:"; // // zPower // this.zPower.LargeChange = 400; - this.zPower.Location = new System.Drawing.Point(74, 47); + this.zPower.Location = new System.Drawing.Point(18, 47); this.zPower.Maximum = 4095; this.zPower.Minimum = 1500; this.zPower.Name = "zPower"; @@ -336,12 +330,23 @@ private void InitializeComponent() this.cbxSolderEmulsion.Size = new System.Drawing.Size(67, 21); this.cbxSolderEmulsion.TabIndex = 19; // + // btnMotors + // + this.btnMotors.Location = new System.Drawing.Point(738, 440); + this.btnMotors.Name = "btnMotors"; + this.btnMotors.Size = new System.Drawing.Size(75, 23); + this.btnMotors.TabIndex = 21; + this.btnMotors.Text = "Motors off"; + this.btnMotors.UseVisualStyleBackColor = true; + this.btnMotors.Visible = false; + // // UserUI // this.AllowDrop = true; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(826, 476); + this.Controls.Add(this.btnMotors); this.Controls.Add(this.label6); this.Controls.Add(this.cbxSolderEmulsion); this.Controls.Add(this.label5); @@ -364,7 +369,7 @@ private void InitializeComponent() this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip; this.Name = "UserUI"; - this.Text = "PCB Laser"; + this.Text = "PCB Exposer"; ((System.ComponentModel.ISupportInitialize)(this.pcb)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.zFocus)).EndInit(); this.grpBox.ResumeLayout(false); @@ -387,18 +392,17 @@ private void InitializeComponent() private System.Windows.Forms.Label label2; private System.Windows.Forms.Button btnStart; private System.Windows.Forms.TrackBar zFocus; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label lblFocus; private System.Windows.Forms.TextBox txtStatus; private System.Windows.Forms.Label dropInfo; private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.GroupBox grpBox; - private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label lblPower; private System.Windows.Forms.TrackBar zPower; private System.Windows.Forms.CheckBox zOn; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.CheckBox chkMirror; private System.Windows.Forms.CheckBox chkInvert; - private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Button btnHome; private System.Windows.Forms.MenuStrip menuStrip; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; @@ -408,6 +412,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label6; private System.Windows.Forms.ComboBox cbxSolderEmulsion; + private System.Windows.Forms.Button btnMotors; } } diff --git a/PCB Laser/UserUI.cs b/PCB Laser/UserUI.cs index 29b83c1..4dfb620 100644 --- a/PCB Laser/UserUI.cs +++ b/PCB Laser/UserUI.cs @@ -1,13 +1,13 @@ /* * UserUI.cs - PCB Laser Printer * - * v1.04 / 2018-01-19 / Io Engineering (Terje Io) + * v1.06 / 2019-04-21 / Io Engineering (Terje Io) * */ /* -Copyright (c) 2015-2017, Io Engineering (Terje Io) +Copyright (c) 2015-2019, Io Engineering (Terje Io) All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -71,13 +71,13 @@ enum EmulsionType { Positive } - private string PortParams = "com15:38400,N,8,1,P"; - private int PollInterval = 50, y = 0, z = 50, Xoffset = 0, XBacklashComp = -1; + private string PortParams = "com29:38400,N,8,1,P"; + private int PollInterval = 50, y = 0, z = 50, Xoffset = 0, Yoffset = 0, XBacklashComp = -1; private bool zFocusClicked = false, mirrored = false, started = false, cancel = false, solderMask = false, uknownFileEnding = true; private byte[] rowBuffer = null; private Bitmap layout = null, board = null; private Graphics gr = null; - private System.Timers.Timer pollTimer = null; + private System.Timers.Timer pollTimer = null, motorTimer = null; private StringBuilder input = new StringBuilder(100); private Rectangle rect; private EmulsionType emulsionEtchMask = EmulsionType.Negative; @@ -90,15 +90,16 @@ enum EmulsionType { private SerialPort SerialPort; #endif - private delegate void SetTextCallback(string text); + private delegate void SetTextCallback(string text); - public UserUI() + public UserUI(string[] args) { InitializeComponent(); this.FormClosed += new FormClosedEventHandler(OnExit); this.btnStart.Click += new EventHandler(btnStart_Click); this.btnCancel.Click += new EventHandler(btnCancel_Click); + this.btnMotors.Click += new EventHandler(btnMotors_Click); this.DragEnter += new DragEventHandler(UserUI_DragEnter); this.DragDrop += new DragEventHandler(UserUI_DragDrop); this.zFocus.Scroll += new EventHandler(zFocus_Scrolled); @@ -113,17 +114,26 @@ public UserUI() this.aboutMenuItem.Click += new EventHandler(aboutMenuItem_Click); this.exitMenuItem.Click += new EventHandler(exitMenuItem_Click); - // default to KiCad file name endings - this.fileEnding.topCopper = "F.Cu"; - this.fileEnding.bottomCopper = "B.Cu"; - this.fileEnding.topMask = "F.Mask"; - this.fileEnding.bottomMask = "B.Mask"; + // default to KiCad v5 file name endings + this.fileEnding.topCopper = "F_Cu"; + this.fileEnding.bottomCopper = "B_Cu"; + this.fileEnding.topMask = "F_Mask"; + this.fileEnding.bottomMask = "B_Mask"; + + int p = 0; + string ininame = "PCBLaser.config"; + while (p < args.GetLength(0)) switch (args[p++]) + { + case "-inifile": + ininame = GetArg(args, p++); + break; + } try { XmlDocument config = new XmlDocument(); - config.Load(Application.StartupPath + "\\PCBLaser.config"); + config.Load(Application.StartupPath + "\\" + ininame); foreach (XmlNode N in config.SelectNodes("PCBConfig/*")) { @@ -143,6 +153,10 @@ public UserUI() this.Xoffset = int.Parse(N.InnerText); break; + case "YOffset": + this.Yoffset = int.Parse(N.InnerText); + break; + case "EtchMaskEmulsion": this.emulsionEtchMask = this.parseEmulsionType(N.InnerText); break; @@ -154,9 +168,7 @@ public UserUI() case "BacklashCompensation": this.XBacklashComp = int.Parse(N.InnerText); break; - } - } foreach (XmlNode N in config.SelectNodes("PCBConfig/FileNameEnding/*")) @@ -180,11 +192,10 @@ public UserUI() break; } } - } catch { - MessageBox.Show("Config file not found or invalid.", this.Text); + MessageBox.Show("Config file not found or invalid.", ininame); System.Environment.Exit(1); } @@ -229,7 +240,13 @@ public UserUI() this.SerialPort.NewLine = "\r\n"; this.SerialPort.WriteBufferSize = TXBUFFERSIZE; this.SerialPort.DataReceived += new SerialDataReceivedEventHandler(SerialPort_DataReceived); - this.SerialPort.Open(); + try + { + this.SerialPort.Open(); + } + catch + { + } #endif if (this.SerialOpen) @@ -242,7 +259,13 @@ public UserUI() this.pollTimer.Elapsed += new System.Timers.ElapsedEventHandler(RenderRow); this.pollTimer.SynchronizingObject = this; + this.motorTimer = new System.Timers.Timer(); + this.motorTimer.Interval = 60 * 1000; // 1 minute + this.motorTimer.Elapsed += new System.Timers.ElapsedEventHandler(MotorOff); + this.motorTimer.SynchronizingObject = this; + this.SerialOut("XHome:" + this.Xoffset.ToString()); + this.SerialOut("YHome:" + this.Yoffset.ToString()); this.setLaserPower(false); } else { @@ -277,6 +300,11 @@ void SerialOut(string s) bool SerialOpen { get { return this.SerialPort.IsOpen; } } int SerialOutCount { get { return this.SerialPort.BytesToWrite; } } + private string GetArg(string[] args, int i) + { + return i < args.GetLength(0) ? args[i] : null; + } + void SerialOut(string s) { this.SerialPort.WriteLine(s); @@ -326,6 +354,7 @@ void disableUI () { this.btnHome.Enabled = false; this.btnStart.Enabled = false; this.btnCancel.Enabled = true; + this.btnMotors.Enabled = false; this.zFocus.Enabled = false; this.zOn.Enabled = false; this.zPower.Enabled = false; @@ -340,6 +369,7 @@ void enableUI () { this.AllowDrop = true; this.btnHome.Enabled = true; this.btnCancel.Enabled = false; + this.btnMotors.Enabled = true; this.btnStart.Enabled = this.layout != null; this.zFocus.Enabled = true; this.zOn.Enabled = true; @@ -380,20 +410,21 @@ void setLaserPower(bool laserOn) LaserPower(true); } */ - this.textBox1.Text = this.zPower.Value.ToString(); this.SerialOut("Power:" + this.zPower.Value.ToString()); } #region UIevents - void OnExit (object sender, FormClosedEventArgs e) { - + void OnExit (object sender, FormClosedEventArgs e) + { if (this.pollTimer != null) this.pollTimer.Stop(); + if (this.motorTimer != null) + this.motorTimer.Stop(); + if (this.SerialOpen) this.SerialPort.Close(); - } void chkMirror_CheckedChanged(object sender, EventArgs e) @@ -419,6 +450,7 @@ void cbxEtchEmulsion_SelectedIndexChanged(object sender, EventArgs e) void btnHome_Click(object sender, EventArgs e) { this.SerialOut("HomeXY"); + this.motorTimer.Start(); } void zOn_Click(object sender, EventArgs e) @@ -465,6 +497,8 @@ void btnStart_Click(object sender, EventArgs e) this.zOn.Checked = true; + this.motorTimer.Stop(); + if(this.XBacklashComp >= 0) this.SerialOut("XBComp:" + this.XBacklashComp.ToString()); @@ -480,6 +514,12 @@ void btnStart_Click(object sender, EventArgs e) disableUI(); } + void btnMotors_Click(object sender, EventArgs e) + { + this.motorTimer.Stop(); + this.SerialOut("Motors:0"); + } + void btnCancel_Click (object sender, EventArgs e) { this.cancel = true; this.zOn.Checked = false; @@ -566,6 +606,12 @@ void UserUI_DragDrop (object sender, DragEventArgs e) { #endregion + private void MotorOff(object sender, System.Timers.ElapsedEventArgs e) + { + this.SerialOut("Motors:0"); + this.motorTimer.Stop(); + } + private bool getPixel(int x, int y) { x -= 150; @@ -644,9 +690,10 @@ private void RenderRow (object sender, System.Timers.ElapsedEventArgs e) { if (++this.y != this.layout.Height) { this.pollTimer.Interval = this.PollInterval; this.pollTimer.Start(); - } else { + } else { // Done! this.zOn.Checked = false; enableUI(); + this.motorTimer.Start(); } pcb.Invalidate(); @@ -665,6 +712,7 @@ private void RenderRow (object sender, System.Timers.ElapsedEventArgs e) { this.SerialPort.Write(this.rowBuffer, 0, 1); // trigger fill buffer #endif this.enableUI(); + this.motorTimer.Start(); } } @@ -747,8 +795,15 @@ private void SetStatus (string s) { if (this.txtStatus.InvokeRequired) this.Invoke(new SetTextCallback(SetStatus), new object[] { s }); else + { + if(s.StartsWith("OPT:")) + { + this.btnMotors.Visible = s.Contains('M'); + this.lblPower.Visible = this.zPower.Visible = s.Contains('D'); + this.lblFocus.Visible = this.zFocus.Visible = s.Contains('Z'); + } this.txtStatus.Text = s; - + } } #if USEELTIMA diff --git a/PCB Laser/app.config b/PCB Laser/app.config new file mode 100644 index 0000000..e59af44 --- /dev/null +++ b/PCB Laser/app.config @@ -0,0 +1,3 @@ + + + diff --git a/README.md b/README.md index 624e412..14b1593 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,20 @@ It is possible to have a drill-ready PCB with solder mask in just two hours from Related projects are for [schematics, PCB](https://github.com/terjeio/PCBLaserSchematics) and [firmware](https://github.com/terjeio/PCBLaserFirmvare) for the controller. A [new design](https://github.com/terjeio/PCBLaserMkII) is in development which will make it simpler and cheaper to build. --- + +1.06 - 2019-04-21: + +Added motor off timeout (after idle for 1 minute motors will be disabled), configurable Y offset and optional command line parameter for ini-file to use. +Default file endings are changed to match KiCad v5. + +--- + Release notes: 1.04 - 2018-01-19: Added configuration settings in PCBLaser.config for default emulsion types used \(Negative or Positive\) and file endings for autodetecting image inversion and mirroring. File endings defaults to those used by KiCad. Emulsion type can also be selected from the UI - note that the "Invert" checkbox will toggle on emulsion type change if a PCB image is loaded! + --- Further information and some images can be found over at [43oh.com](http://forum.43oh.com/topic/9645-pcb-laser-exposerprinter/#comment-72756)