Showing posts from July, 2012

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…

Amazon: Yes, yes, yes!

When one of my kids told me his Kindle had stopped working I thought it was his fault. On closer inspection I could not see any damage to the screen. None of the suggestions of the troubleshooting guide worked so things did not look good.

After some reading on Amazon forums it was clear I was not alone and other customers had experience a similar problem that required a replacement of their unit.

I was very happy to learn my unit was less than a year old, so I contacted customer service to see what to do next. I had bought the unit while being in the states but I was now living in Europe, so I was uncertain about my choices.

Once I explained the problem I was having with the unit, to a very nice representative named Stacey, I was told unit had to be replaced. I was told a replacement unit has been sent to my address in Europe and paid with a gift voucher. I was told that using that same box I should return the defective unit once I've got the replacement.

I was even provided with…

Slicing and nesting working together

The initial idea was to slice 3D models into a sequence of thin slices. Once that was working it was suggested that thicker slices may reduce the total machining time.

The problem is that vertical cuts for the slices will create an ugly rendering of the desired surface that will later need to be fixed by an artist.

The next idea was to put together the milling action for each slice sides and the nesting algorithm that will distribute the slices into the available stock sheets.

As usual it is easier to say than to do, and though it seems Aspire and Rhinoceros allow you to do a similar process, my code is now performing both tasks without user intervention. Blue or green color on the outline represent whether the slice has to be flipped or not (each slice has to be machined from top to bottom).