Posts

Showing posts from January, 2008

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…

Develop with Arduino

Image
| View | Upload your own

I'm visiting a school in northern Finland next week. This is the presentation I'm giving. It's intended for first year students so you'll find it very basic, and you'll miss the fun of some demos. By putting it here I have a backup plan if I lose my pendrive :-)

Using eBay's Best Offer feature

I'm still dealing with a non-responsive eBay seller after I've got burned by a non-working 8GB compact flash. I've seen that many people do not like to talk about this type of failures that happen on eBay from time to time. I'm still trying to get my money back from PayPal so maybe not everything is lost.

But now I wanted to buy some cheap control chips for bipolar stepper motors. Nothing fancy with micro stepping or digital current control, just a simple chip that can also be used for other purposes too. I saw this video and I learned about the L293. It is an old chip that several manufacturers mark as deprecated.

Instead of going to a local shop I went online to eBay and I saw several sellers have it available. I tend to favor European sellers if the price is right as I do not particularly enjoy periods longer than two months for delivery (something I've experienced first hand from Hong Kong lately). One of the sellers had a price that seemed ok, but they also did …

On-line math calculation

Image
I know several nice Math software packages, mostly for Windows (Derive, Mathematica, MathCAD, Matlab ...). My university has licenses for some of them but I am not always on campus, using Windows, when I need some help. There are some free math programs too (Scilab, Octave, Maxima, Axiom ...).

What it is not always known is that there is an interesting set of on-line calculators and solvers that sometimes can help you get the job done without installing anything. Quite interesting when you are not even using your own computer.

For easy calculations and units conversion Google calculator is a neat tool. How do you use it? Just type your calculation on Google search box (i.e. "5/sin(32)" or "25 celsius in farenheit" ). Really worthwhile to convert between American and European fuel economy units!

But maybe you already have a calculator so this Google feature while nice does more or less the same. You may need to do something more advanced like online matrix calculation.…

Troubling iMac

Image
A few months ago I bought a shiny 20" iMac. While the initial impression was good, I was not happy after the trouble I had installing Leopard and certain incompatibilities it brought.

Just when it seemed things were settling down I've got the system just dying on me after opening a large (120MB) PDF file. The screen turned black and then the system rebooted spontaneously. Another computer was on at the same time and it did not experience any problem, so I do not think that was because of a power spike.

Today, when I started the system there was a multilingual message in a centered dark square telling me to press the power button for several seconds to shutdown the system (neither the keyboard or the mouse worked). I have never seen that image before (but I failed to take a photo), it contained the message in Japanse too. It happens to be an OS X kernel panic.

When I powered on the system again I heard the welcome sound and next two beeps and then three beeps that repeated over …

Other Hacks

While searching the net for possible uses of old hard drive voice coil actuators I've came across this video. A video is worth even more than a thousand words so I'll let it talk.