Posts

Showing posts from May, 2009

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…

Trouble is not only on the digital side

Image
My old analog camera is also giving me trouble. The symptom was that many pictures had just a small fraction of the total field. This can happen when shooting with flash if the sync speed is not correct (flash fires when shutter is half-open only). However this time I was shooting outdoors without a flash.

After a few iterations with Google led my to a photo on Wikipedia with exactly the same type of residue I've found on my camera. A few more searches led me this article that explains the causes of the problem and a possible fix.

Aging and heat turn a piece of foam inside the camera guts into an oily tar that ruins the shutter operation. Did you think you can keep on using your old camera, maybe not if it as a twenty years old Canon EOS.

Digital pollen allergy

Image
One of the bad things about DSLR (aka Digital Reflex) cameras is the tendency to get dust in the image sensor (as these cameras use removable lenses). Whether it is just dust or pollen it may eventually be shown in your photos (like the spot I show on the right: it is just blue sky).

For not so big spots, they may go easily undetected. If you want to check for dust in the sensor the simplest way seems to take a photo of the blue sky with the smallest aperture possible on your lens (F22 in my case).

Detecting the problem only serves to make you nervous, but fear not, it can be fixed. There are different ideas and people who would talk for or against any of them. I do not feel comfortable risking my camera sensor without reading quite a lot before doing one thing or another. Apparently there are several ideas that can help:
Air blower.Dry dust removers.Wet dust removers.Send the camera to the manufacturer for a professional cleaning of the sensor.The first three is something you can do if …