**ENGR 052: Computer-Aided Manufacturing and Procedural Design** **Fall 2022** **[Matt Zucker](../index.html)** | Lecture: | Tue/Thu 11:20AM-12:35PM, Singer 221 | |---------------|----------------------------------------------| | Lab: | Mon 1:15-4:00PM, Singer 222 (beginning 9/12) | | Office Hours: | Mon 10:30-11:30AM, Tue 3:00-4:00PM, Singer 235| This class is about both the practice and the inner workings of Computer-Numerical-Controlled (CNC) Machining. Similar to my other electives of Mobile Robotics and Computer Vision, this class will reveal how combining mathematical programming with hardware in the real world can lead to both useful and beautiful results. The class will address three broad themes that we will encounter more or less in sequence: * *Basics of CAD, CAM, and machining*, encompassing 2D and 3D computer-aided design, operations for computer-aided manufacturing, and fundamentals of machining such as feeds and speeds, along with a smattering of mechanical design principles. * *Fundamentals of computational geometry*, including representations of points, lines, and polygons, and operations such as polygon offsetting. These foundational algorithms will allow us to implement many of the basic operations that expensive CAM software packages provide. * *An introduction to procedural and generative design*, in which the role of the human designer is augmented or replaced by a computer, allowing the evolution of complex forms that would be difficult or impossible to produce through traditional methods. By the end of this course, you will not just understand how to *use* state-of-the-art CAD/CAM software -- you will begin to have a working understanding of how to *write* your own. # Goals This course will develop the following skills and abilities: **Coding** * Fluency in writing, reading, and debugging code * Solving mathematical and geometric problems in code * Understanding how to program and debug computers to operate with real-world physical systems **General design and fabrication** * Developing comfort working with your hands * Precisely measuring parts using calipers and other tools * Understanding iterative refinement and the proper use of test parts and prototypes **CNC design and fabrication** * Using basic CAD in 2D and 3D for design of simple parts * Selecting and configuring the appropriate CAM toolpaths to machine simple parts * Correctly selecting appropriate tools, feeds, and speeds, and depths of cut for a given machining operation * Safely operating CNC milling machines **Computer-Aided Machining and Computational Geometry** * Implementing standard 2D CAM toolpaths in software: * Facing * Tracing * Profiling * Pocketing of simple convex shapes **Procedural design** * Developing 2D and 3D forms using a variety of programming techniques: * Random distribution of design elements * Cell decompositions of spaces * Simulation of dynamical systems * Optimization and energy minimization approaches # Requirements **Prerequisites:** Either ENGR 15 or ENGR 19, or permission of the instructor. MATH 27 or 28 is strongly recommended. **Skills:** In practice, I expect you to understand elementary programming concepts, including basic loops, functions, and array processing. I also expect you to be comfortable with [linear algebra concepts](../linalg-reintroduction.pdf), especially the ideas of representing points as vectors, and operations on points as matrices. **Time:** From the [Swarthmore College Catalog](https://catalog.swarthmore.edu/content.php?catoid=7&navoid=192): > We advise students to plan to spend two to three hours of work for > every hour of class attended. Our research shows that Swarthmore > College students typically work at least two hours outside of class > preparing for every hour of class attended. The typical student > attends class or seminar for 12 or more hours per week, and prepares > for class or seminar at least 24 hours per week. Although these figures will vary from individual to individual and week to week, you should plan to commit several hours outside of class to homework, reading, and projects each week. # Resources **Discussion forum**: We will use [this edstem.org forum](https://edstem.org/us/courses/26586/discussion/) throughout the semester to communicate course announcements and answer questions. Please use the online forum (instead of just emailing me) for all course-related communications -- this allows students to see common problems and to engage in discussions about course material. **References**: As the course progresses, I will continue to update this section with useful references. * G-Code: * [G-Code reference on Wikipedia](https://en.wikipedia.org/wiki/G-code) * [LinuxCNC Documentation (see G Code Programming)](http://linuxcnc.org/docs/html/) * Hardware: * [Carbide 3D Nomad 883 Pro](https://carbide3d.com/nomad/) * [Carbide 3D speeds and feeds reference](https://docs.carbide3d.com/support/supportfiles/Nomad883_feeds_125.jpg) * [Safe operating instructions for this class](carbide_safe_operation.pdf) * [Tool information spreadsheet](https://docs.google.com/spreadsheets/d/1A7A4ad7Qhkqc9WTOMMu3NmHZirH3NiJScrk4mw1Erjw/edit?usp=sharing) * [Tool library for Fusion 360](e52_nomad_basswood_v0.tools) * [Tool library for Camotics](e52_nomad_tools.json) * [HAAS Minimill](https://www.haascnc.com/machines/vertical-mills/mini-mills/models/minimill.html) * [Mill operator's manual](https://www.haascnc.com/content/dam/haascnc/en/service/manual/operator/english---mill-ngc---operator%27s-manual---2019.pdf) * [Safe operating instructions for this class](https://docs.google.com/document/d/13dhhIp84QCLVwaUzfrfi6Nq4vJsL1CcWx7B5G3yHs6Q/edit?usp=sharing) * [Tool library for Fusion 360](e52_haas_aluminum_v0.tools) * General feeds and speeds: * [FSWizard](https://app.fswizard.com/) * Python/numpy/matplotlib: * [Python 3 documentation](https://docs.python.org/3/) * [Numpy documentation](https://numpy.org/doc/stable/) * [Matplotlib documentation](https://matplotlib.org/stable/index.html) * [Scipy documentation](https://docs.scipy.org/doc/scipy/) **Software installers**: * [Autodesk Fusion 360 educational license sign-up](https://www.autodesk.com/education/edu-software/overview?sorting=featured&filters=individual) (click "Get started", then "Create account") * [Carbide Motion 5 installer](https://carbide3d.com/downloads/) * [Camotics installer](https://camotics.org/download.html) * [Anaconda Python distribution](https://www.anaconda.com/products/distribution) **Misc. links**: * [Guerrilla guide to CNC machining, mold making, and resin casting](http://lcamtuf.coredump.cx/gcnc/) * [Nervous System Design Studio - projects](https://n-e-r-v-o-u-s.com/projects/) # Expectations Short design and programming exercises will be assigned weekly. There will be three projects which are more hands-on, more open-ended, and more programming intensive than the weekly assignments. We will have two in-class quizzes on operation and safety procedures for the CNC mills we will be using. Weekly lab meetings will begin on Monday, September 12. It is possible that we will not need to use all of the lab meeting times, and also possible that many labs will not require attendance for the full lab time; regardless, please reserve Monday afternoons for lab attendance! **I am willing to negotiate my lab attendance policy with students who have conflicts with other upper-level ENGR courses (e.g. E59, E41). If you anticipate time conflicts, please come see me during office hours ASAP!** The most important lab sessions will be the project introductions on 9/12, 10/3, and 11/7. It would be ideal for all students to be present on those dates. There are no exams for this class. We may use the final exam period for project presentations. Expect an announcement about this towards the end of the semester. I am happy to give advice about homework and projects during office hours, and I can also meet with students or pairs outside of office hours by appointment. Grading will follow approximately the divisions shown below: * Homework: 40% * Quizzes: 10% * Projects/labs: 45% * Participation: 5% ## Collaboration and attribution * Feel free to collaborate with your classmates on homework; however, you must submit your own work. Duplicating others’ assignments verbatim (especially code!) is prohibited. * If you do discuss homework with your classmates, I expect you to disclose any such collaboration clearly in your submitted work. Err on the side of caution – it’s the best way to avoid awkward conversations about suspicious similarities between assignments. * Cite any external sources used, including the textbook, internet, discussions with other professors, etc. * Aside from raising technical and procedural questions on the course discussion forum, do not collaborate on projects with others outside your group. * Do not post homework or project solutions online. Questions or answers that discuss solutions too closely will be deleted. Aside from the course-specific policies above, you are expected to understand and abide by the college's [policy on academic misconduct](https://www.swarthmore.edu/student-handbook/academic-policies#academic_misconduct). ## Late policy Homework will generally be assigned soon after class on Thursday, and due at the start of class the following Thursday. Homework assignments may be turned in up to a week late for half credit. Students get one free late homework turn-in without penalty. Late projects which have not been excused in advance may be penalized. I will try to accommodate you in extraordinary circumstances, *especially if you contact me ahead of time*. # Accommodations If you believe you need accommodations for a disability or a chronic medical condition, please email Student Disability Services at studentdisabilityservices@swarthmore.edu to arrange an appointment to discuss your needs. As appropriate, the office will issue students with documented disabilities or medical conditions a formal Accommodations Letter. Since accommodations require early planning and are not retroactive, please contact Student Disability Services as soon as possible. For details about the accommodations process, [visit the Student Disability Services website](http://www.swarthmore.edu/academic-advising-support/welcome-to-student-disability-service). You are also welcome to contact me the faculty member privately to discuss your academic needs. However, all disability-related accommodations must be arranged, in advance, through Student Disability Services. # Schedule The topics below are subject to change. Please check this page regularly for updates. August 30, 2022: Introduction Topics: * Course overview, show & tell * CAD & CAM demos * CNC demo on Nomad 883 Pro September 1, 2022: Computer-Aided Design Topics: * CAD tutorial in Fusion 360 Assignments: * [Homework 1](homework1.html) September 6, 2022: Computational Geometry Topics: * Introduction to computational geometry * Geometric primitives: points, lines Resources: * [Whiteboard from today](notes/2022-09-06.pdf) * [Code example from today](code/numpy_points_lines.py) September 8, 2022: Computer-Aided Manufacturing Topics: * Numpy for geometry programming * Point inside polygon problem * Convex hull problem in 2D * CAM tutorial in Fusion 3D Resources: * [Whiteboard from today](notes/2022-09-08.pdf) * [Numpy indexing example code](code/numpy_indexing.py) * [Polygon display code](code/polygon_starter.py) Assignments: * [Homework 2](homework2.html) September 12, 2022: Project 1 practicum Topics: * Safety and operation procedures for Nomad 883 Pro Resources: * [Nomad Pro safe operating instructions](carbide_safe_operation.pdf) * [Whiteboard from today](notes/2022-09-13.pdf) Assignments: * [Project 1](project1.html) September 13, 2022: G-Code programming Topics: * G-Code programming model * Important G-Code commands * Emitting G-Code from Python * Facing toolpaths * Tracing toolpaths * Texture toolpaths Resources: * [Spirograph example](code/spirograph.py) * [Nested polar curves example](code/nested_polar.py) * [VCarve Pro texture toolpath docs](https://docs.vectric.com/docs/V9.0/VCarvePro/ENU/Help/Toolpaths/Texture%20Toolpath/Texture%20Toolpath.html) September 15, 2022: Feeds and speeds Topics: * Machining feeds & speeds * CAM tutorial Resources: * [Fusion 360 file for in-class tutorial](simple_cam_exercise.f3d) * [Slides from today](https://docs.google.com/presentation/d/1Y3ugBFFcS-pA6eNSAaVVUjS3ZjatUkf_hRiDfrNBsrU/edit?usp=sharing) September 19, 2022: Lathe demos / Work on project 1 (September 20, 2022): Quiz 1 in-class September 20, 2022: Offsetting convex polygons Topics: * Tangents and normals of lines * Offsetting convex polygons * Quiz 1 in-class Resources: * [Whiteboard for polygon offsetting](notes/2022-09-22.pdf) September 22, 2022: Metalworking Topics: * Identifying metals * Cutting tool geometry * Machining materials: aluminum Resources: * [Whiteboard for polygon offsetting](notes/2022-09-22.pdf) * [Slides from today](https://docs.google.com/presentation/d/1tEWCRNV-Z9YNAno9BziDckrl8y4PaGM-OWFzqqlUDPg/edit?usp=sharing) Assignments: * [Homework 3](homework3.html) September 26: 2022: Haas CNC demo / Work on project 1 September 27, 2022: Profile toolpaths Topics: * Profiles/contours * Ramps Resources: * See next lecture for whiteboard/code September 29: 2022: Profile toolpaths, cont'd. Topics: * Profiles/contours * Ramps Resources: * [Whiteboard](notes/2022-09-29.pdf) * [`contour_example.py`](code/contour_example.py) October 3, 2022: No lab today October 4, 2022: Sketches and constraints Topics: * Sketches * Degrees of freedom * Specifying constraints as equations Resources: * [Whiteboard](notes/2022-10-04.pdf) October 6, 2022: Solving constraints Topics: * Methods: numerical vs symbolic * Sympy * Lead-ins, lead-outs and vertical arcs Resources: * [Whiteboard](notes/2022-10-06.pdf) * [Sympy introductory tutorial](https://docs.sympy.org/latest/tutorials/intro-tutorial/index.html) * [My Sympy blog series, post 1](https://mzucker.github.io/2018/04/06/why-every-gfx-cv-robotics-programmer-should-love-sympy.html) * [Code from class](code/sympy_triangle_inclass.py) Assignments: * [Homework 4](homework4.html) (October 10, 2022): Fall break October 17, 2022: Work on project 1/Safe operation of Haas * Haas safe operating instructions October 18, 2022: Voronoi diagrams Topics: * Computation * Applications * Cellular patterns Resources: * [Whiteboard](notes/2022-10-18.pdf) * [Code from class](code/voronoi.zip) October 20, 2022: Mechanical design basics Topics: * Fits and tolerances * Fasteners Resources: * [Slides from class](https://docs.google.com/presentation/d/19oHJSmHevw4-pNHTQc02P4ucBXcllcALNLAUtU0m9AM/edit?usp=sharing) October 24, 2022: Work on project 1 October 25, 2022: Project 1 presentations October 27, 2022: Molds and casting Topics: * Mold making * Casting * Injection molding October 31, 2022: Project 2 practicum Topics: * Project 2 introduction * Haas safe operating instructions Resources: * [Project 2](project2.html) November 1, 2022: Dynamical systems Topics: * Lorenz attractor * Reaction-diffusion Resources: * [Karl Sims](https://www.karlsims.com/rd.html) and [Robert Mufano's](http://mrob.com/pub/comp/xmorphia/index.html) reaction-difusion pages. * [Nervous system coral cup blog entry](https://n-e-r-v-o-u-s.com/blog/?p=8222) * [Whiteboard](notes/2022-11-01.pdf) * [Lorenz demo code](code/lorenz_inclass.py) * [Reaction diffusion demo code](code/reaction_diffusion.py) November 3, 2022: Physics-based modeling Topics: * Energy minimization Resources: * [Whiteboard](notes/2022-11-03.pdf) * [Code from class](code/growth_anim.py) * Note: will not work unless you have [jax](https://github.com/google/jax) installed. November 7, 2022: Work on project 2 November 8, 2022: 3D modeling Topics: * Triangle meshes * STL file format Resources: * [Whiteboard](notes/2022-11-08.pdf) * [Code from class](code/make_tetrahedron.py) November 10, 2022: TBA November 14, 2022: Project 3 practicum Resources: * [Project 3](project3.html) November 15, 2022: Project 2 presentations Resources: * [Whiteboard (mostly Homework 5 notes)](notes/2022-11-15.pdf) November 17, 2022: 3D workflows Topics: * 3D machining strategies * Two-sided machining * Fusion 360 CAM demos Resources: * Moai head model by Thingiverse user ET-Huang * [STL file](moai-new.stl) * Original on [Thingiverse](https://www.thingiverse.com/thing:144668) * [Finished CAD/CAM Fusion 360 file](moai_two_sided.f3d) Assignments: * [Homework 5](homework5.html) November 21, 2022: Work on project 3 November 22, 2022: Design for manufacturability (November 24, 2022): Thanksgiving break November 28, 2022: Work on project 3 November 29, 2022: 3D Parallel Toolpaths Topics: * Ball end mills * Computing and sampling offset surfaces * Parallel toolpaths Resources: * [Whiteboard](notes/2022-11-29.pdf) December 1, 2022: Additive manufacturing Topics: * 3D printing technologies * FDM * SLA * SLS * Slicing, infill, supports Resources: * [Whiteboard](notes/2022-12-01.pdf) December 5, 2022: Work on project 3 December 6, 2022: Components, Parameters, Joints Topics: * Components * Parameters * Joints * Motion links Resources: * [STEP files for import](components_tutorial.zip)