Posts

=================================

How to setup Pronterface (Printrun) for 3D printing | DzQ39 |

This is a quick example on how to setup Pronterface (Printrun) for 3D printing. The printer is a DIY Prusa i3 style printer with 30cm x 30cm x 30cm printing envelop (see below photo).



Below are the parameters that I use for printing PETG.


Below are the gcodes for the 5 buttons in the bottom of the photo above:

Extend Z Probe: M280 P0 S95
Retract Z Probe: M280 P0 S20
ABL Home: G28
ABL Probe: G29
Fan 50% Speed: M106 S127

Note:
- ABL stands for Automatic Bed Leveling;
- To use ABL, first click on "ABL Home" to move the print head to the Home position. After that, click on "ABL Probe" to activate the automatic bed leveling process. After the bed is probed, click on "Print" to start the printing process;
- IMPORTANT: after the bed is probed with "ABL Probe", DO NOT issue any command that moves the bed or the print head; otherwise it will invalid the bed leveling parameters and you will have to execute "ABL Home" and "ABL Probe" again to re-acquire the parameters.

The photo below shows the parameters relevant to printer setting.


Using eagleUp to export Eagle PCB to Sketchup | DzQ39 |

This post contains a quick summary of how to export board design done by Eagle PCB to Sketchup using eagleUp and tips on solving the followign problems that I encountered during the process.

1. Where to put the eagleUp\ sub folder.
2. How to use eagleUp;
3. How to import the exported 3D board model in Sketchup.

Installation

Follow the instruction at https://eagleup.wordpress.com/installation-and-setup/ to download and install the required files.


Be sure to enable "Install legacy utilities (e.g. convert).


Reference:
[Resolved] convert.exe missing from 7.0.1-Q16? 
https://www.imagemagick.org/discourse-server/viewtopic.php?t=29582

Running eagleUp

Launch Eagle PCB, load the demo file, then click on RUN ULP. In the pop up window, locate and select "eagleUp_export.ulp" then click Open.


Configuration

The first time "eagleUp_export.ulp" is executed, a configuration window like below will appear. Be sure to point the folders / files to the right location.


The general setting window can be brought up by left click on the "Edit general settings" when launching "eagleUp_export.ulp".


Importing the board 3D model to Sketchup

Note, the exported 3D board file is stored in the eagleUp folder under the folder where the *.brd file is stored.

Be sure to enable Ruby console before executing "Import eagleUp" under Plugins. This could help spot error. See http://developer.sketchup.com/en/content/ruby-sketchup on how to enable Ruby console.


For instance, I couldn't figure out why Sketchup fails to import the "demo3d.eup" file. After seeing the error message, I realized that it's caused by the file being on C drive and special privilege is required to access it.


The location of "demo3d.eup" is under C:\Program Files (x86)\EAGLE-6.6.0\demo files\eagleUp.


By copy the directory and its contents to D drive (where special privilege is not required), Sketchup is able to import and display demo3d.eup without problem.


References:

Welcome to eagleUp
https://eagleup.wordpress.com/

Download and installation of eagleUp
https://eagleup.wordpress.com/installation-and-setup/

Exporting PCB to Google Sketchup - Anyone Know How?
https://circuitmaker.com/forum/posts/214945/

Working with switching regulator - LM2596 | DzQ39 |

This is a quick summary of how to work with LM2596 and how to reduce its ripple.

Original Schematic


Source: http://www.ti.com/lit/ds/symlink/lm2596.pdf



Output (based on the original schematic)


Updated Schematic (with the optional ripple filter)


Source: http://www.hobbyelectronics.net/review_dctodcmodule.html

Output (based on the updated schematic)


Note, For the circuit that I use, the values for the optional output ripple filter are L2 = 33uH, C1 = 100uF, 35V.

Below is the waveform of a cheap LM2596 module that supports adjustable output.


The above waveform is taken from the module below.


Reference:

Review of DC to DC buck converter based on LM2596
http://www.hobbyelectronics.net/review_dctodcmodule.html

How to turn on/off servo power | DzQ39 |

This post is about how to turn on / off the power to servo motor using MOSFET or TIP120. According to the article at the end of this post, MOSFET is the better choice due to less power consumption. However, I've observed that it takes less voltage to turn on TIP120 than IRF530 or 2N7000. So for low power devices such as RPi that outputs 3.3V and control a servo that runs on DC 6V, it may be a good idea to use TIP120 (or, there needs to be a way to level-shift the 3.3V to 5V).

Using MOSFET



Using TIP120


Sample Code

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
Adafruit Arduino - Lesson 14. Sweep
*/

#include <Servo.h>

int servoPin = 9;

Servo servo;

int angle = 0; // servo position in degrees

void setup()
{
servo.attach(servoPin);
}


void loop()
{
// scan from 0 to 180 degrees
for(angle = 0; angle < 180; angle++)
{
servo.write(angle);
delay(15);
}
// now scan back from 180 to 0 degrees
for(angle = 180; angle > 0; angle--)
{
servo.write(angle);
delay(15);
}
}

--------------------------------------------------------------------------------------------------------------------------

Below is the schematic for turning on/off a servo motor using 2N7000 and a 3.3V control signal.


--------------------------------------------------------------------------------------------------------------------------

The code below adds power control to the above example using interrupt. The power control pin is connected to pin 2 of the Arduino. When pin 2 is low, the servo will sweep from 0 to 180 and back. When pin 2 goes from low to high (RISING), the power to the servo motor is cut and the counting stops.


 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <Servo.h> 

int servoPin = 9;
int powerCutDetectionPin = 2;

Servo servo;

int angle = 0; // servo position in degrees

void setup()
{
servo.attach(servoPin);
pinMode(powerCutDetectionPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(powerCutDetectionPin), empty_loop, RISING);
}

void empty_loop() {
}

void loop()
{
// scan from 0 to 180 degrees
for(angle = 0; angle < 180; angle++)
{
servo.write(angle);
delay(15);
}
// now scan back from 180 to 0 degrees
for(angle = 180; angle > 0; angle--)
{
servo.write(angle);
delay(15);
}
}

Reference:

http://sensitiveresearch.com/elec/DoNotTIP/index.html

TAKING IT TO ANOTHER LEVEL: MAKING 3.3V SPEAK WITH 5V
http://hackaday.com/2016/12/05/taking-it-to-another-level-making-3-3v-and-5v-logic-communicate-with-level-shifters/