Showing posts from April, 2013

Moving code from ESP8266 to ESP32

A while ago I made a mashup of Dan Royer's code CNC 2 Axis Demo with my own code for trapezoidal motion stepper and servo control for ESP8266.

I assumed porting the code to the ESP32 would be trivial, and that was true for the most part: changes like library name being Wifi.h instead of Wifi8266.h were not a problem. UDP now does not like multicharacter writes but you can use print instead. So far so good.

However, when it came to the interrupt code I was stuck with the stepper interrupt causing an exception sometimes. And to make things weirder, the servo interrupt worked flawlessly (both of them had the IRAM_ATTR directive if you ask me).

Going little by little, I could narrow down the culprit to a floating point operation during the interrupt, that would cause problems sometimes but not always. Browsing around I found this post. Where the solution was simple: do not use floats within the interrupt routines but doubles. The reason was the float calculation would be performed by…

LEDs getting smarter

Sometime ago, I used for a project a set of RGB LEDs that were networked and responded to a few commands sent through a shared bus. It was a lot of work but it was fun. A while ago, at a RepRap meeting, user fungus showed me how he was using new controllers for doing exactly that, controlling RGB leds through a shared bus (daisy-chain would be the exact term though). They are available either as a small PCB with the chip so you can solder your own LED, or with a built-in LED or in a long stripe of LEDs.

Other manufacturers just included the chip together with their RGB leds, so you can get a three pin RGB led that includes internal memory to be set at any desired color from a single-pin output of your favorite micro-controller. And my favorite during the last few years has been Arduino so I just downloaded the FastSPI library and try to make sense of it. Unfortunately it never is so easy, so this time I was forced to upgrade my Arduino to 1.0.4 (I was avoiding that and keeping the 02…

Running in circles with the extruders

While my Wade-type extruder works nicely in my old Prusa, I planned to use a smaller geared stepper motor for my new Prusa i3 3D printer. But the road to a reliable extruder that is lighter and smaller is paved with many different trouble.

The first problem was to source PG35L-048 motors that Josef Prusa was using for his compact extruder and shown in different youtube videos. Sourcing it in Europe was not easy but I was lucky buying some units from an Austrian supplier called Neuhold Elektronik. But my joy was brief, once I could not easily extract the gear of the motor and I ended up sawing it off, because the shaft of my motor was shorter than the version used by Prusa, so I had to adapt the 3D design of the extruder to fit my motor. I got that extruder eventually working, but in order to get consistent extrusion the motor needed a bit more current than its specs so it was overheating. An aluminium piece, part of a heat-sink of an Intel processor took care of the extra heat. Still,…