Posts

Showing posts from October, 2012

Moving code from ESP8266 to ESP32

Image
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…

The credit card trick

Image
I have just finished a ShapeOko but because I did some mods: I've got some leftovers: some MXL belting and two 5mm MXL pulleys. What best thing to do than to start a project so they get some use. So I planned on building a new Prusa i3 3D printer. Not that I need yet another printer but a new model to try it out.

I built a Printrbot earlier this year to get a smaller model than the Prusa for home use. At the time the printer dimensions were not very clear and much guess work was done on my side. Besides, I used a direct drive that worked but I was never happy with.

This time I am, again, doing some guess work for Prusa i3, like figuring out that z-axis rods are M5 threaded rods or taking the overall dimensions out of the DXF of the aluminium frame off the Prusa i3 github, while learning that some changes have been done and are not yet into the master branch.

As I was planning on using MXL belts instead of what apparently it is used in Prusa i3, which my guess work suggest is HTD 3M …