Bloodshed Dev-C++

Programming in C or C++ on a Linux system is fairly straightforward. Enter the code in the editor of your choice, compile with gcc and enjoy. Programming is usually an integral part of the operating system.

C or C++ programming isn’t installed on Windows right out of the box, though, which raises the question of how to find a good C/C++ programming environment for Windows? Having tried (and not really liked) Visual Studio, I was looking for an alternative. As powerful and easy-to-use as FreeBASIC is — especially using the FBIDE environment — some things (like linked lists and similar structures) are more easily done in C-like languages.

Recently, I’ve come across Bloodshed/Dev-C++. Although I can’t say I like the name much, the IDE is easy to install, and provides an easy way to write a quick console-based program in C. Best of all, it’s free / open-source.

The download link can be a bit tricky to find, since the site design is somewhat unintuitive (at least to me). Here’s a direct link to the installer download page.

 

Posted in C, Coding, Internet | Leave a comment

Robotic Jellyfish

Engineers at Virginia Tech have made a hydrogen-powered jellyfish robot that theoretically will never run out of energy.

It’s cool to live in the future.

 

Posted in Current Events, Robotics | Leave a comment

Syntonization

My new word for the day (okay, actually this week) is syntonization. I’d heard of synchronization, of course, but hadn’t heard of syntonization (setting two clocks or oscillators to the same frequency) until reading a usage guide for the Efratom LPro-101 Rubidium frequency standard units I’ve been working with.

Rubidium frequency standards work by tracking the natural frequency of an energy-level transition of Rubidium with a quartz PLL oscillator. This produces a very precise, accurate reference frequency — but one that can nonetheless be affected slightly by variations in the ambient magnetic field. For this reason, Rubidium standards typically are adjustable to some extent, and can be syntonized to other, similarly precise frequency standards.

Normally, syntonization of a Rubidium frequency standard is done in comparison with either a primary Cesium standard (too expensive for me, unfortunately) or with a precision GPS receiver (which appears a bit more affordable but which I don’t yet own.) Since the LPro units allow temporary adjustment via an input pin, though, it’s possible to syntonize one of them to another without having a primary standard available. This doesn’t guarantee absolute frequency accuracy, of course — but rather just taking Unit 1 at its word as to what the “real” value of 10MHz is, and tweaking Unit 3 to match that. For many experiments, it doesn’t really matter. Both are within a couple of parts per billion of the absolute frequency anyway, whether corrected or not.

The frequency adjustment pin on the LPro operates via a voltage-divider scheme: the pin can nominally be driven to any value between 0V and 5V, with higher voltage increasing the frequency by about 1PPB or so. This results in a rather coarse adjustment (relatively speaking), though. Instead of driving the pin directly, I decided to drive it via a 100k series resistor, effectively diluting the adjustment voltage. (The pin is internally held at 2.5V via a voltage divider with a nominal impedance of perhaps 100k ohms.)

By watching the oscilloscope and phase measurement meter, I initially guessed that a drive voltage of about 2.084V seemed to cancel out the observed phase drift (the magenta line in the graph). I then let the oscillators run overnight. It nearly worked: whereas the units would drift in and out of phase every ten to eleven minutes with no correction, they now took about nine hours to do so. (This is the blue line in the graph below.)

After a bit more experimenting, I increased the drive voltage slightly to 2.090V. This, so far, has almost exactly cancelled out the phase drift. Although a few degrees of short-term phase jitter is present, along with perhaps 70 to 90 degrees of longer-term phase noise, the overall phase drift seems to be on the order of 1.8 degrees per hour. At this rate, it would take over a week for the two units to drift in and out of phase by one cycle. Running at 10MHz, it would take over two hundred thousand years for them to disagree by one second.

Phase difference in Units 1 and 3 (Unit 3 corrected with 2.090V via a 100k resistor). (Click for larger.)

0.005 degrees phase per second is 2000 seconds per degree.

Multiplying this by 360 degrees (I never really did like radians) gives 720,000 seconds per phase.

Multiplying this by 10,000,000 (since the units run at 10MHz) gives 7,200,000,000,000 seconds per one second of difference. This is one part in 7.2 trillion, or about 138 parts per quadrillion (PPQ). This is relative accuracy, of course, since I don’t have an absolute 10MHz reference standard that’s anywhere near this accurate.

…and to think, I used to consider 100PPM TTL oscillators to be precise…!

 

Posted in Electronics, Science | 3 Comments

Project Euler

Working with electronics design requires math — and acquiring skill at math requires practice. Too often, though, practice math problems are dry and uninteresting, and there is still often a tendency among some mathematicians (and many math instructors) to distrust computers. For many practical problems, though, the use of numerical methods (I.E. the efficient use of high-speed computers) can provide easier ways of finding a solution. The problem is that, compared to the availability of resources (like textbooks) available for traditional mathematical methods, it can be difficult to find good ways to gain experience with mathematical programming.

Project Euler aims to help change that. The site presents a series of mathematical problems ranging in difficulty from the almost-trivial (Problem 1 asks for the number of numbers between 1 and 1000 divisible by either 3 or 5) to much more difficult problems, often involving computations of interesting concepts like totients.

The problems are designed to be readily solvable with a modern computer — although restating the problem in a form that can be efficiently solved is often quite tricky. Some of the earlier problems, while challenging to solve in the most efficient manner, can be handled in a few minutes of computing time through “brute force and ignorance” methods such as exhaustive search. Often, though, later Project Euler problems will be these very same problems, only with the search space expanded, say, a millionfold — a not-so-subtle hint that sometimes, efficiency does indeed matter.

Posted in Internet, Math | Leave a comment