:::: MENU ::::
Browsing posts in: 3D Printer

Slic3r 빌드 하기

3D 프린팅을 위한 슬라이서 프로그램인 Slic3r는 오픈소스로 github에 코드가 공개되어 있다. 물론 각 OS에 맞는 실행파일을 다운로드해서 사용이 가능하지만 github에 공개된 코드를 빌드해서 사용이 가능하다. Windows, Mac, Linux 등 3가지 OS에서 빌드가 가능하며, Mac OS X에서 빌드하는 방법은 https://github.com/alexrj/Slic3r/wiki/Running-Slic3r-from-git-on-OS-X에 정리되어 있다.

Slic3r는 C++ 과 Perl로 작성이 되어 있다.

The core geometric algorithms and data structures are written in C++, and Perl is used for high-level flow abstraction, GUI and testing.

그리고 다음과 같은 기능이 있다.

Key features are:

  • multi-platform (Linux/Mac/Win) and packaged as standalone-app with no dependencies required
  • complete command-line interface to use it with no GUI
  • multi-material (multiple extruders) object printing
  • multiple G-code flavors supported (RepRap, Makerbot, Mach3, Machinekit etc.)
  • ability to plate multiple objects having distinct print settings
  • multithread processing
  • STL auto-repair (tolerance for broken models)
  • wide automated unit testing

Other major features are:

  • combine infill every ‘n’ perimeters layer to speed up printing
  • 3D preview (including multi-material files)
  • multiple layer heights in a single print
  • spiral vase mode for bumpless vases
  • fine-grained configuration of speed, acceleration, extrusion width
  • several infill patterns including honeycomb, spirals, Hilbert curves
  • support material, raft, brim, skirt
  • standby temperature and automatic wiping for multi-extruder printing
  • customizable G-code macros and output filename with variable placeholders
  • support for post-processing scripts
  • cooling logic controlling fan speed and dynamic print speed

이중 auto-repair기능에 대한 설명은 메뉴얼에 나와있는데, 홀이 있거나 앞뒤가 뒤바뀐 경우 자동으로 repair한다. 이 기능을 off하는 방법은 없다. 이외 추가적으로 Netfabb이나 FreeCAD도 추천을 하고 있다.

If the 3D mesh described in the model contains holes, or edges are misaligned (known as being non-manifold), then Slic3r may have problems working on it.


AstroPrint 분석

원격 3D프린팅을 지원하는 기기인 AstroPrint 분석

1. 가격

  • AstroPrint에서 파는 기기 – $149
  • Raspberry Pi 세트: $65
  • 지원하는 카메라: $30 ~ $68 (라즈베리용 카메라는 지원하지 않음)
  • 따라서 카메라 포함 가격은 $95 ~ $217 정도

2. 카메라

  • 카메라는 리눅스를 지원하는 USB카메라(Video for Linux v2)이어야 하며 웹에서 카메라 스트리밍을 보는 형태라서(WebRTC) FireFox, Chrome and Opera에서만 영상을 볼 수 있음
  • pcDuino 기반의 AstroPrint는 스트리밍 지원 안됨. 즉 Raspberry Pi기반만 웹 스트리밍 지원.
  • WebRTC의 한계: 브라우저 지원

참고 자료: https://blog.astroprint.com/live-video-streaming-is-now-available-on-astroprint/


PID 튜닝

Reprap 기반의 코드에 적용되어 있는 PID 를 튜닝하는 방법은 다음과 같이 PID Auto-tune을 사용해서 상수값 Kp, Ki, Kd값을 정하고 Configuration.h에 설정을 한다.

M303 E0 S210 C8

위 코드의 의미는 타겟온도 210도로 하고 8번의 사이클을 거쳐서 값을 정하는것. 그러면 다음과 같이 값이 나온다.

bias: 92 d: 92 min: 196.56 max: 203.75
Ku: 32.59 Tu: 54.92
Clasic PID
Kp: 19.56
Ki: 0.71
Kd: 134.26
PID Autotune finished ! Place the Kp, Ki and Kd constants in the configuration.h

Configuration.h 파일에 설정후 컴파일을 하는 대신에 다음과 같이 M301커멘드로 테스트가 가능하다.

M301 P19.56 I0.71 D134.26

PID Auto-tune

  • The PID test doesn’t use a PID control loop to control the temperature! It shouldn’t matter what values you have stored when you run the autotune. Instead, the autotune function runs the heater in “bang-bang” mode, leaving the heater on for an extended period of time, and then off for an extended period of time, and simply observing the thermal behavior in response to heating and cooling.
  • Each cycle in the autotune run is a test where the controller cycles the heater, intentionally overshooting the target value for 5 seconds and observing how far up it goes, and how long it takes to coast back down to the target temperature. Once below the target temperature for 5 seconds, it observes how far the temp fell, and then cycles the heater on for another run at the target.
  • The first three cycles calculate a “bias” to dial in the level of maximum power that will be used for the remainder of the cycle/tests. You will get to see those bias numbers, but there’s not much you can do with them. You will not get PID parameters from these initial cycles.
  • The fourth and subsequent tests still overshoot by 5 seconds and undershoot by 5 seconds, but this time the observed duration of the heat cycle, and the min and max temperatures reached, are put through the mathematical formulas described in the Ziegler–Nichols PID tuning method. This is a mathematical way to determine PID constants that perform acceptably in many systems. Values for the three parameters Kp, Ki, and Kd will be displayed for the cycle, and a new cycle will begin.
  • After all the test cycles are finished, you can average the values you get from each of these cycles and use those as your baseline parameters.

Kp, Ki, Kd의 의미

  • The proportional (P) constant Kp is in counts/C, representing the change in the softPWM output per each degree of error.
  • The integral (I) constant Ki in counts/(C*s) represents the change per each unit of time-integrated error.
  • The derivative (D) constant Kd in counts/(C/s) represents the change in output expected due to the current rate of change of the temperature.
  • Kp is the “proportional” term. The further off target you are, the more power this term contributes.
  • Ki is the “integral” term. This term contributes more control input as the accumulated offset over time between measured and target temperatures increases. In other words the longer you’ve been off target, the more input this term will contribute in the direction of the target (could be more or less heater power).
  • Kd is the “derivative” term. This term allows the controller to “predict” or look ahead of the current temperature to slow the rate of change down and let the measured temperature creep up on the target. Mathematically speaking it attempts to minimize the slope of the temperature curve with respect to the target.

수동으로 조정

  • if it overshoots a lot and oscillates, either the integral gain needs to be increased or all gains should be reduced
  • Too much overshoot? Increase D, decrease P.
  • Response too damped? Increase P.
  • Ramps up quickly to a value below target temperature (0-160 fast) and then slows down as it approaches target (160-170 slow, 170-180 really slow, etc) temperature? Try increasing the I constant.
  • if the temperature is getting too hot before settling down, increase Kd and decrease Kp (more creeping up on the temperature and less muscling it around)
  • if the temperature tapers off just under the target and never quite reaches it, decrease Kd and increase Ki (less creeping up alongside the target, and more correction for cumulative offset) Increasing Ki means that cruising just a hair under the target for a long time will cause Ki to gradually put more power into the heater until it reaches the target. A higher Kd would fight this process by decreasing power to get the measured temperature curve parallel to the target temperature line.
  • if the temperatures are taking a long time to settle, oscillating or hunting indefinitely, decrease Ki and increase Kd (less agitation from cumulative error, and more gliding into alignment with the target); alternatively try decreasing all three terms… the PID equivalent of taking some deep breaths and relaxing the amount of control you’re exerting

참고


Delta 3D Printer – Delta segmentation

Notice the chart shows the worst possible cases on a line in XY plane from a tower base to the opposite side of the build area. The chart looks so funny because the maximum speeds are defined for the carriage movement (not for the platform movement). About 10 cm from the tower base the speed limiting tower is switched.
The errors happen because firmware uses linear approximation for function sqrt(R^2-x^2). The tower position errors will result in errors in cartesian X, Y, Z coordinates. The nearer you are to a tower the more the tower error will contribute to the cartesian Z error. The more far away you are from a tower the more the error will contribute to the cartesian X/Y error. You see the worst case is about 10 cm from tower, and this will result to about 0.05 mm Z-error and 0.025 mm X/Y error. Add stepper errors of about 0.006 mm, slack in the system, and dynamic errors because of acceleration <-> flexibility.


A4988 Step motor driver

3D프린터에 많이 사용되는 스텝모터 드라이버인 Allegro사의 A4988칩. 모터드라이버에서 가장 중요한 것은 전류인데, 이것을 설정하는 방법은 칩의 17번 핀 REF에 걸리는 전압에 의해 결정이 된다.

Current Limit = VREF × 2.5

즉 만약 Vref가 0.3이면 Current limit는 0.75A. 그런데 full step mode일때의 전류는 Current limit의 70%로 제한이 되므로 만약 1A의 전류제한으로 설정을 하려면 1/0.7 = 1.4A로 가정을 하고 계산을 한다. 따라서 Vref = 1.4 / 2.5 = 0.56V 가 되게 설정을 한다.

또한가지 모터에 흐르는 전류를 결정짓는 것은 SENSE1, SENSE2에 연결된 Rs 저항이다. 데이터 시트에 보면 공식은 다음과 같다.

I = Vref / (8 x Rs)



Cura 2.1 open beta 버전 빌드

Ultimaker에서 기존 Cura와 다른 GUI를 가진 Cura를 개발해서 베타버전을 내놓았다. 이유는

This is the new, shiny frontend for Cura. daid/Cura is the old legacy Cura that everyone knows and loves/hates.
We re-worked the whole GUI code at Ultimaker, because the old code started to become a unmaintainable

사실 daid의 Cura의 경우 맥에서의 빌드는 본인도 hell이라고 표현을 하는데, 이번 베타버전의 큐라를 빌드해 보니 스무스하게 빌드가 된다. 단 빌드 시간은 엄청나게 오래 걸린다.

Mac에서의 빌드 방법

필요한 파일들 설치

  • xcode 설치
  • cmake 설치 – brew install cmake
  • openssl 설치 – brew install openssl
  • brew link openssl –force
  • gcc 설치 – brew install gcc

빌드

  • git clone [email protected]:Ultimaker/cura-build.git
  • cd cura-build
  • mkdir build
  • cd build
  • cmake ..
  • make

추가적인 머신 설정 방법

Json 파일을 만들어야 하는데, 맥에서의 파일 위치는 /Users/AteamRnd/Downloads/Cura.app/Contents/Resources/cura/resources/machines

베타버전의 메뉴얼

다른 OS에서의 빌드는 링크를 참고.

관련 내용: https://ultimaker.com/en/resources/20511-change-machine-settings


3D 프린터 – 다이렉트 & 보우덴 방식

3D 프린터 – 다이렉트 & 보우덴 방식의 비교

다이렉트 방식

  • 피더의 구동부와 노즐사이의 간격이 짧아서 응답성이 좋다. 따라서 stringing, oozing이 덜 생기고 피더 모터의 토크가 좀 작아도 된다. 플랙시블 필라멘트사용이 쉽다.
  • 하지만 헤드가 무거워져서 “backlash, overshoot, and frame wobble” 등이 생기기 쉽다.

보우덴 방식

  • 헤드가 가벼워져서 모든 조건이 같을때 빨리움직일 수 있다.
  • 필라멘트 리트렉션, strining, oozing, 필라멘트 마찰등의 단점

참고로 응답성은 시스템의 hysteresis, lag와 관련이 있다. 

관련 문서: http://www.matterhackers.com/articles/extruders-101:-a-crash-course-on-an-essential-component-of-your-3d-printer



MOD-t에서 Cura 사용하기

Indiegogo에서 얼리버드로 $239에 구매한 MOD-t

MOD-t뿐만 아니라 Cura에 기본적으로 설정이 되어 있지 않은  3D 프린터는 이와 같은 방법으로 기기를 추가하고, 프로파일을 추가할 수 있다.

  • 메뉴에서 Machine > Add new machine…을 선택
  • Next버튼을 누르고 맨 밑에 있는 Other를 선택후 다시 Next를 선택
  • 기기의 이름, 빌드 사이즈, 노즐 사이즈, 베드의 센터를 기입하고 Finish를 한다.

  • File > Open profile…을 클릭후 첨부된 profile을 로드한다.
  • 프린팅을 할때는 desktop app에서 “Advanced Mode”를 선택하고, 좀 전에 설정한 큐라에서 슬라이싱한 Gcode를 선택한다.