Showing posts from July, 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…

What worked and what didn't.

I know I have been not posting anything for a long time but the workshop preparation first and the fact that we scheduled a second edition just finishing the first one prevented me to do much besides that and my daily work.

Certain things did not work quite right in the 3D printing workshop, like having to solder motor wires. Most people are not familiar with soldering and a soldering iron is a risk too. I ended up doing half of the soldering as another workshop attendant helped me out.

On top of that, three printers have trouble with RAMPS cards, two of them with a non working motor and a third one with hotend thermistor input. Luckily all these failures were tracked down to soldering shorts that were easy to fix once diagnosed. Even better was the fact that nothing broke in the process.

However, I failed miserably to stick to my own schedule and the software part of the workshop was much smaller that I have planned and wanted to cover. I felt a bit like a firefighter trying to help…