VR Mech’s Missing Link: The Phone In Your Pocket

In the process of making a homemade Mech Combat game that features robot-like piloted tanks capable of turning the cockpit independent of the direction of movement, [Florian] realized that while the concept was intuitive to humans, implementing it in a VR game had challenges. In short, when the body perceives movement but doesn’t feel the expected acceleration and momentum, motion sickness can result. A cockpit view that changes independently of forward motion exacerbates the issue.

To address this, [Florian] wanted to use a swivel chair to represent turning the Mech’s “hips”. This would control direction of travel and help provide important physical feedback. He was considering a hardware encoder for the chair when he realized he already had one in his pocket: his iPhone.

By making an HTML page that accesses the smartphone’s Orientation API, no app install was needed to send the phone’s orientation to his game via a WebSocket in Unity. He physically swivels his chair to steer and is free to look around using the VR headset, separate from the direction of travel. Want to try it for yourself? Get it from [Florian]’s GitHub repository.

A video is embedded below, but if you’re interested in details be sure to also check out [Florian]’s summary of insights and methods for avoiding motion sickness in a VR Mech cockpit.

Continue reading “VR Mech’s Missing Link: The Phone In Your Pocket”

Say It With Me: Aliasing

Suppose you take a few measurements of a time-varying signal. Let’s say for concreteness that you have a microcontroller that reads some voltage 100 times per second. Collecting a bunch of data points together, you plot them out — this must surely have come from a sine wave at 35 Hz, you say. Just connect up the dots with a sine wave! It’s as plain as the nose on your face.

And then some spoil-sport comes along and draws in a version of your sine wave at -65 Hz, and then another at 135 Hz. And then more at -165 Hz and 235 Hz or -265 Hz and 335 Hz. And then an arbitrary number of potential sine waves that fit the very same data, all spaced apart at positive and negative integer multiples of your 100 Hz sampling frequency. Soon, your very pretty picture is looking a bit more complicated than you’d bargained for, and you have no idea which of these frequencies generated your data. It seems hopeless! You go home in tears.

But then you realize that this phenomenon gives you super powers — the power to resolve frequencies that are significantly higher than your sampling frequency. Just as the 235 Hz wave leaves an apparent 35 Hz waveform in the data when sampled at 100 Hz, a 237 Hz signal will look like 37 Hz. You can tell them apart even though they’re well beyond your ability to sample that fast. You’re pulling in information from beyond the Nyquist limit!

This essential ambiguity in sampling — that all frequencies offset by an integer multiple of the sampling frequency produce the same data — is called “aliasing”. And understanding aliasing is the first step toward really understanding sampling, and that’s the first step into the big wide world of digital signal processing.

Whether aliasing corrupts your pristine data or provides you with super powers hinges on your understanding of the effect, and maybe some judicious pre-sampling filtering, so let’s get some knowledge.

Continue reading “Say It With Me: Aliasing”

Don’t Fear The Filter: Lowpass Edition

There comes a time in every electronic designer’s life when, whether they know it or not, they need an analog filter in their design. If you’re coming from a digital background, where everything is nice and numeric, the harsh reality of continuous voltages can be a bit of a shock. But if you’re taking input from, or sending output to the big analog world out there, it pays to at least think about the frequency-domain properties of the signal, and maybe even do something about them.

Designing an analog filter to fit your needs can be a bit of a daunting task: there are many factors that you’re going to need to consider, and they all interact. It’s easy to get lost. We’re going to simplify this as much as possible by instead focusing on a few common applications and building up the simplest possible filters that work well for them.

Today, we’re going to consider the lowpass filter, and specifically a Sallen-Key filter with Butterworth characteristics and a second-order rolloff. Sound like word salad? We’ll fix that up right away, because this is probably the single most important filter to have in your analog toolbox for two very common use cases: pulse-width modulated (PWM) output and analog-to-digital conversion (ADC) input.

Continue reading “Don’t Fear The Filter: Lowpass Edition”

Tales Of A Cheap Chinese Laser Cutter

The star turn of most hackspaces and other community workshops is usually a laser cutter. An expensive and fiddly device that it makes much more sense to own collectively than to buy yourself.

This isn’t to say that laser cutters are outside the budget of the experimenter though, we’re all familiar with the inexpensive table-top machines from China. Blue and white boxes that can be yours for a few hundred dollars, and hold the promise of a real laser cutter on your table.

Owning one of these machines is not always smooth sailing though, because their construction and choice of components are often highly variable. A thorough check and often a session of fixing the non-functional parts is a must before first power-on.

[Extreme Electronics] bought one, and in a series of posts documented the process from unboxing to cutting. Starting with a full description of the machine and what to watch for out of the box, then a look at the software. A plugin for Corel Draw was supplied, along with a dubious copy of Corel Draw itself. Finally we see the machine in operation, and the process of finding the proper height for beam focus by cutting an inclined plane of acrylic.

The series rounds off with a list of useful links, and should make interesting reading for anyone, whether they are in the market for a cutter or not.

These cutters/engravers have featured here before many times. Among many others we’ve seen one working with the Mach3 CNC software, or another driven by a SmoothieBoard.

Networked Solar Birdhouses Deep In The Woods

[Oitzu] in Germany wrote in to let us know about a series of short but very informative blog posts in which he describes building a series of solar-powered, networked birdhouses with the purpose of spying on the life that goes on within them. He made just one at first, then expanded to a small network of them. They work wonderfully, and [Oitzu]’s documentation will be a big help to anyone looking to implement any of the same elements – which include a Raspberry Pi in one unit as a main gateway, multiple remote units in other birdhouses taking pictures and sending those to the Pi over an nRF24L01+ based radio network, and having the Pi manage uploading those images using access to the mobile network. All with solar power.

Continue reading “Networked Solar Birdhouses Deep In The Woods”

How-To: Web Server On A Business Card (Part 2)

This mini web server is slightly smaller than a business card. There are a lot of tiny one-board servers out there, but this is probably the smallest you can etch and solder at home. Unlike many embedded web servers, files are stored on a PC-readable SD card, not in a difficult-to-write EEPROM. Read on for the web server design, or catch up on PIC 24F basics in the previous article: Web server on a business card (part 1).

Continue reading “How-To: Web Server On A Business Card (Part 2)”