The code below will heat the hot end nozzle up to 185 and then set the e-steps to 147.19, and then slowly extrude 100mm of filament.
To use it, mark a line 120mm from your extruder on your filament. Run this gcode as if Cura spit it out. Measure the line. You want to be at 20mm when it’s done.
100 / ( 120 – measurement_after_extruding ) * current Esteps = New_Esteps.
The measurement_after_extruding is the distance from your extruder to your line after extruding. You are shooting for 20mm
M82 ;absolute extrusion mode
;*** Start Preheating ***
M104 S185 T0 ; start preheating hotend
G28 ; home
M109 S185 T0 ; heat hotend to 185
;*** End Preheating ***
M220 S100 ;Reset Feedrate
M221 S100 ;Reset Flowrate
G28 ;Home
G92 E0 ;Reset Extruder
G1 Z20.0 F3000 ;Move Z Axis up
G92 E0 ;Reset Extruder
G1 Z10.0 F3000 ;Move Z Axis up
M92 E147.19; set e-steps to 141
G92 E0
G1 E100 F100 ; Extrude 100mm
M82 ;absolute extrusion mode
M104 S0
In this episode, I rant about teardowns, products vs projects, LCSC, and the ESP32 microcontroller.
Here’s a stripped down example of Khoi Hoang’s ESP32TimerInterrupt library. The library claims to run up to 16 compares (or alarms) on one, single timer. It seems to work well although I’ve only tested 3 timers thus far. I plan to use it on my Idiot Christmas Light Controller controlling triacs.
include <Arduino.h>
/
TimerInterruptTest.ino
For ESP32 boards
Written by Khoi Hoang
Built by Khoi Hoang https://github.com/khoih-prog/ESP32TimerInterrupt
Licensed under MIT license
This is the most basic example using Khoi Hoang's ESP32TimerInterrupt library.
The library works well, but I found myself wanting an ultra basic version to understand the functionality
*/
define TIMER_INTERRUPT_DEBUG 0
define TIMERINTERRUPT_LOGLEVEL 0
include "ESP32TimerInterrupt.h"
// Change these to whatever GPIO you'd like to toggle
define LED0 25 // GPIO 25
define LED1 27 // GPIO 27
define LED2 33 // GPIO 33
// The lenght of each timer in milliseconds
define TIMER0_INTERVAL_MS 100
define TIMER1_INTERVAL_MS 3000
define TIMER2_INTERVAL_MS 400
void IRAM_ATTR TimerHandler0(void)
{
static bool toggle0 = false;
//timer interrupt toggles pin LED0
digitalWrite(LED0, toggle0);
toggle0 = !toggle0;
}
void IRAM_ATTR TimerHandler1(void)
{
static bool toggle1 = false;
//timer interrupt toggles LED1
digitalWrite(LED1, toggle1);
toggle1 = !toggle1;
}
void IRAM_ATTR TimerHandler2(void)
{
static bool toggle2 = false;
//timer interrupt toggles LED2
digitalWrite(LED2, toggle2);
toggle2 = !toggle2;
}
// Init ESP32 timer 0,1, and 2
ESP32Timer ITimer0(0);
ESP32Timer ITimer1(1);
ESP32Timer ITimer2(2);
void setup()
{
pinMode(LED0, OUTPUT);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
Serial.begin(115200);
while (!Serial)
;
delay(100);
Serial.print(F("\nStarting TimerInterruptTest on "));
Serial.println(ARDUINO_BOARD);
Serial.println(ESP32_TIMER_INTERRUPT_VERSION);
Serial.print(F("CPU Frequency = "));
Serial.print(F_CPU / 1000000);
Serial.println(F(" MHz"));
// Using ESP32 => 80 / 160 / 240MHz CPU clock ,
// For 64-bit timer counter
// For 16-bit timer prescaler up to 1024
// Setup Timer0
// Interval in microsecs
if (ITimer0.attachInterruptInterval(TIMER0_INTERVAL_MS * 1000, TimerHandler0))
{
Serial.print(F("Starting ITimer0 OK, millis() = "));
Serial.println(millis());
}
else
Serial.println(F("Can't set ITimer0. Select another freq. or timer"));
// Setup Timer1
// Interval in microsecs
if (ITimer1.attachInterruptInterval(TIMER1_INTERVAL_MS * 1000, TimerHandler1))
{
Serial.print(F("Starting ITimer1 OK, millis() = "));
Serial.println(millis());
}
else
Serial.println(F("Can't set ITimer1. Select another freq. or timer"));
// Setup Timer2
// Interval in microsecs
if (ITimer2.attachInterruptInterval(TIMER2_INTERVAL_MS * 1000, TimerHandler2))
{
Serial.print(F("Starting ITimer2 OK, millis() = "));
Serial.println(millis());
}
else
Serial.println(F("Can't set ITimer1. Select another freq. or timer"));
Serial.flush();
}
void loop()
{
}
It was a strange week. I have my first “real” job since 2003. (I’m talking full-time job.) It was a struggle to get this podcast out. I’m feeling my grip on my my reality from just 5 days ago slip away. Regardless, I was able to maintain my usual, low standards. I had plenty to talk about. I spent about a day finding a switch on LCSC. I learned a ton about the JLCPCB Assembly process, and it turns out that school may have been onto something in Python.

Pocast 007 : Incredible Synth Filter, SMD MIDI Optcouplers, and Woes of Production
Last week’s video:
LTspice Potentiometer Download and Install
— Filters
—– Scowering the web
——- found interesting schematic
——- built it up. It acted weird.
——- I simulated it in LT Spice
——–I It was still weird. It wasn’t a LPF at all, but some kind of goofy resonant peak thing.
——–Later on, I re-read the description and it said, “Fake LPF”. Sigh.
— No forum schematics? Fake news?
— Incredible video on synth design
——-DIY Synth Design Tutorial Series – 003: Analog Filter and Power Supply
——-https://www.youtube.com/watch?v=efnBC_zZduA
———- This guy knows his stuff. He gets into the real design. the.room.dis.connect
—— Introduces LM13700 transconductance amplifier
———- We all know what an RC filter is?
————– The R is little more than current control.
————– The cap is a bucket and the “current” is the flow of water to fill up that bucket.
————— What if we wanted to control R on the fly?….potentiometer
—————— What if we wanted to control a stereo 4-pole filter. We’d need an 8-gang potentiometer.
———- This led the search for a VCR (voltage controlled resistor)
—————I knew a MOSFET’s Rds does this, at least to a certain degree.
—————This would require some real chops
———- Enter the LM13700 transconductance amplifier.
—————— Essentially a VCR… voltage in controls current out.
Filter conclusion: Transconductance amplifiers allow us to control filter frequency.
———— allows creative options as CV
Back to LM13700
— About $1 in quantity
— Plenty of them on Digikey and LCSC
— A mono, four pole filter needs 2.
—- The datasheets “Application Information” is sensational.
SMD Optocoupler For MIDI TLP2361
https://calcium3000.wordpress.com/projects/teensy-midi-interface/
This guy made a super helpful blog post showing how he made his Teensy MIDI board using TLP2361 opto coupler