Posts

Showing posts from June, 2007

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…

Hard drive upgrade season

Image
After having passed all the subjects one of my kids was asking for a hard disk upgrade. He wanted to double his 120GB harddisk. I have written before about tools you can use to get this job done, but I am not wise enough to follow my own advice, so I decided to try new approaches to the problem. I will tell you first what did not work:

I started partitioning the drive using fdisk and formatting the new partition using FAT32. My kid's data was stored on an NTFS partition but I thought FAT32 will be ok. Well ... it wasn't: While I could copy all the data the system refused to boot. Rescue disk and FIXBOOT or FIXMBR did not fix the problem, so I ended up thinking XP is not happy booting a large (240GB) FAT32 partition, so I did a conversion to NTFS using CONVERT.EXE having the new drive as a slave one. Conversion was successful but the booting problem was not going away.

Installing Ubuntu and GRUB in a small partition did not help me getting WinXP to boot, though Ubuntu did boot wi…

AMPL: A Modeling Language for Mathematical Programming

Image
In my quest to get some calculations done, as it seems my math knowledge is less than good enough, I have had to resort to use other tools I can handle. Serendipity led me to AMPL language developed at Bell Labs (by Brian W. Kernighan et al.).

AMPL is used by Operations Research practitioners to solve Linear Programming problems. But the fact that AMPL is mostly a language to express math problems does not mean it can solve them. If you have a LP problem you can express it using AMPL but you need a solver to actually solve the problem. AMPL can work with may different solvers (some free others are commercial) and the solver you use may also depend on the nature of your problem. For example, your LP problem might have non-linear constraints that some solvers can't deal with.

You can download a free student version of AMPL. You can also obtain different solvers and I am using the free student version of LOQO solver by Princeton's Robert Vanderbei. Another possible choice, without …

Meet Processing

The sample below shows a five minutes piece of code that animates a chain made of nine particles linked with springs. Although the inner core of Processing is made in Java, it is a nice tool for people not familiar nor interested on the full glory of details of Java applets but willing to create some graphical software.

Click on the applet to shake the chain ...





To view this content, you need to install Java from java.com


Built with Processing

Joost about to leave beta

I was told about Joost some time ago at the most unexpected place by a person I just met. After having lunch with Alvy (from Microsiervos), Francisco (Mystrands' founder) and Victor Fuente. Victor showed me Joost player on his laptop. It was kind of weird because we were having a drink by the beach and it seems that pub did have an open wifi with a decent bandwidth. I was shocked: that thing really worked quite decently, so I guess the result has to be even better on a standard Internet connection.

You still will need an invite while they are in beta to try it out, but you can register your email address to be paged once the beta is over.

But, what the heck it is that Joost thing? Well ... (in case you are too lazy to click on the link above) ... Joost is a P2P TV tuner software. You can receive a good number of TV stations with a decent quality.

Reanimating a PSS120

Image
Our old Philips MP3 clock died last week. It no longer works or starts up. In the past I was able to reset the unit to get it back to life, but this time the trick didn't do it. After reading on the net I saw many customers had to return their units with a similar problem, I guess there is a not so weird condition that reset does not cure.

I managed to open the unit without breaking it and I checked the battery that seemed ok. After unplugging and plugging back the battery the unit was working again. You will need the right screwdriver for the task as it has many small screws.