Why Electric Trains Sound The Way They Do

If you’re a seasoned international rail traveler you will no doubt have become used to the various sounds of electric locomotives and multiple units as they start up. If you know anything about electronics you’ll probably have made the connection between the sounds and their associated motor control schemes, but unless you’re a railway engineer the chances are you’ll still be in the dark about just what’s going on. To throw light on the matter, [Z&F Railways] have a video explaining the various control schemes and the technologies behind them.

It’s made in Scotland, so the featured trains are largely British or in particular Scottish ones, but since the same systems can be found internationally it’s the sounds which matter rather than the trains themselves. Particularly interesting is the explanation of PWM versus pattern mode, the latter being a series of symmetrical pulses at different frequencies to create the same effect as PWM, but without relying on a single switching frequency as PWM does. This allows the controller to more efficiently match its drive to the AC frequency demanded by the motor at a particular speed, and is responsible for the “gear change” sound of many electric trains. We’re particularly taken by the sound of some German and Austrian locomotives (made by our corporate overlords Siemens, by coincidence) that step through the patterns in a musical scale.

Not for the first time we’re left wondering why electric vehicle manufacturers have considered fake internal combustion noises to make their cars sound sporty, when the sound of true electrical power is right there. The video is below the break.

Continue reading “Why Electric Trains Sound The Way They Do”

Tiny Tapeout 4: A PWM Clone Of Covox Speech Thing

Tiny Tapout is an interesting project, leveraging the power of cloud computing and collaborative purchasing to make the mysterious art of IC design more accessible for hardware hackers. [Yeo Kheng Meng] is one such hacker, and they have produced their very first custom IC for use with their retrocomputing efforts. As they lament, they left it a little late for the shuttle run submission deadline, so they came up with a very simple project with the equivalent behaviour of the Covox Speech Thing, which is just a basic R-2R ladder DAC hanging from a PC parallel port.

The computed gate-level routing of the ASIC layout

The plan was to capture an 8-bit input bus and compare it against a free-running counter. If the input value is larger than the counter, the output goes high; otherwise, it goes low. This produces a PWM waveform representing the input value. Following the digital output with an RC low-pass filter will generate an analogue representation. It’s all very simple stuff. A few details to contend with are specific to Tiny Tapout, such as taking note of the enable and global resets. These are passed down from the chip-level wrapper to indicate when your design has control of the physical IOs and is selected for operation. [Yeo] noticed that the GitHub post-synthesis simulation failed due to not taking note of the reset condition and initialising those pesky flip-flops.

After throwing the design down onto a Mimas A7 Artix 7 FPGA board for a quick test, data sent from a parallel port-connected PC popped out as a PWM waveform as expected, and some test audio could be played. Whilst it may be true that you don’t have to prototype on an FPGA, and some would argue that it’s a lot of extra effort for many cases, without a good quality graphical simulation and robust testbench, you’re practically working blind. And that’s not how working chips get made.

If you want to read into Tiny Tapeout some more, then we’ve a quick guide for that. Or, perhaps hear it direct from the team instead?

Continue reading “Tiny Tapeout 4: A PWM Clone Of Covox Speech Thing”

Homebrew Reader Brings Paper Tape Programs Back To Life

We may be a bit biased, but the storage media of yesteryear has so much more personality than that of today. Yes, it’s a blessing to have terabyte SD cards smaller than your pinky nail and be able to access its data with mind-boggling speed. But there’s a certain charm to a mass storage device that can potentially slice off your finger.

We’re overstating the dangers of the venerable paper tape reader, of course, a mass storage device that [David Hansel] recreated a few years back but we only just became aware of. That seems a bit strange since we’ve featured his Arduino-based Altair 8800 simulator, which is what this tape reader is connected to. Mechanically, the reader is pretty simple — just a wooden frame to hold the LEGO Technic wheels used as tape reels, and some rollers to guide the tape through a read head. That bit is custom-made and uses a pair of PCBs, one for LEDs and one for phototransistors. There are nine of each — eight data bits plus the index hole — and the boards are sandwiched together to guide the paper tape.

The main board has an ATmega328 which reads the parallel input from the read head and controls the tape motor. That part is important thanks to Altair Basic’s requirement for a 100- to 200-ms delay at the end of each typed line. The tape reader, which is just being used as sort of a keyboard wedge, can “type” a lot faster than that, so the motor speed is varied using PWM control as line length changes.

Continue reading “Homebrew Reader Brings Paper Tape Programs Back To Life”

Keep Tabs On PC Use With Custom Analog Voltmeter

With the demands of modern computing, from video editing, streaming, and gaming, many of us will turn to a monitoring system of some point to keep tabs on CPU usage, temperatures, memory, and other physical states of our machines. Most are going to simply display on the screen but this data can be sent to external CPU monitors as well. This retro-styled monitor built on analog voltmeters does a great job of this and adds some flair to a modern workstation as well.

The build, known as bbMonitor, is based on the ESP32 platform which controls an array of voltmeters via PWM. The voltmeters have been modified with a percentage display to show things like CPU use percentage. Software running on the computers sends this data in real time to the ESP32 so the computer’s behavior can be viewed at a glance. Each voltmeter is also augmented with RGB LEDs that change color from green to red as use increases as well. The project’s creator, [Corebb], also notes that the gauges will bounce around if the computer is under heavy load but act more linearly when under constant load, also helping to keep an eye on computer status.

While the build does seem to rely on a Windows machine to run the software for export to the monitor, all of the code is open-sourced and available on the project’s GitHub page and could potentially be adapted for other operating systems. And, as far as the voltmeters themselves go, there have been similar projects in the past that use stepper motors as a CPU usage monitor instead.

Continue reading “Keep Tabs On PC Use With Custom Analog Voltmeter”

Playing Audio On The Pi Pico With No DAC To Speak Of

Normally, if you want to play music or other audio on a microcontroller, you need to get yourself a DAC. Or at least, that’s the easiest way to go about it and the one most likely to get you good, intelligible audio. You don’t have to go that way, though, as [antirez] demonstrates.

[antirez] decided to do this with a Pi Pico, but it’s applicable to other microcontrollers too. It’s all done with a single pin and a PWM output. The PWM output is set to a very high frequency beyond human hearing. In this case, it was 100 KHz. Then, the duty cycle of the PWM is changed to essentially output various average voltage levels at the pin. Vary the output voltage as per your desired sound file by using each sample to vary the duty cycle of the PWM. Voila! You can output whatever sound you want on that pin! [antirez] steps through the basics of doing this, including processing simple WAV files into a raw format that can be dumped into MicroPython code.

There’s no sound sample on the project page, and we’d have to assume it sounds pretty crunchy when hooked up to a speaker. And yet, it could prove a useful technique if you’re designing your own audio greeting cards or something, so keep that in mind!

Sketchy Logg Dogg Logging Robot Remote Control Hacking

When we last left [Wes] amidst the torn-open guts of his Logg Dogg logging robot, he had managed to revitalize the engine and dug into the hydraulics, but one big obstacle remained: the lack of the remote control unit. In today’s installment of the Logg Dogg series, [Wes] summarizes weeks of agony over creating a custom circuit based around a microcontroller, a joystick and a lot of relays and other bits and pieces to drive the solenoids inside the logging machine that control the hydraulics.

Giving the remote controller a bench test before connecting to the logging robot (Credit: Watch Wes Work)

Most of the struggle was actually with the firmware, as it had to not only control the usual on/off solenoids, but also a number of proportional solenoid valves which control things like the track speed by varying the hydraulic flow to the final drives.

This requires a PWM signal, which [Wes] generated using two MOSFETs in a closed-feedback system, probably because open loop controls with multi-ton hydraulic machinery are not the kind of excitement most people look forward to.

Ultimately he did get it sorted, and was able to take the Logg Dogg for its first walk since being rescued from a barn, which both parties seemed to rather enjoy. The background details of this machine and the project can be found in our first coverage.

We’re looking anxiously forward to the next episode, where the controller goes wireless and the sketchiness gets dialed down some more.

Continue reading “Sketchy Logg Dogg Logging Robot Remote Control Hacking”

Pico-Sized Ham Radio

There are plenty of hobbies around with huge price tags, and ham radio can certainly be one of them. Experienced hams might have radios that cost thousands of dollars, with huge, steerable antennas on masts that can be similarly priced. But there’s also a side to the hobby that throws all of this out of the window in favor of the simplest, lowest-cost radios and antennas that still can get the job done. Software-defined radio (SDR) turned this practice up to 11 as well, and this radio module uses almost nothing more than a microcontroller to get on the air.

The design uses the capabilities of the Raspberry Pi Pico to handle almost all of the radio’s capabilities. The RF oscillator is driven by one of the Pico’s programmable I/O (PIO) pins, which takes some load off of the processor. For AM and SSB, where amplitude needs to be controlled as well, a PWM signal is generated on another PIO which is then mixed with the RF oscillator using an analog multiplexer. The design also includes a microphone with a preamplifier which can be fed into a third PIO; alternatively it can receive audio from a computer via the USB interface. More processor resources are needed when generating phase-modulated signals like RF, but the Pico is still quite capable of doing all of these tasks without jitter larger than a clock cycle.

Of course this only outputs a signal with a few milliwatts of power, so for making any useful radio contacts with this circuit an amplifier is almost certainly needed. With the heavy lifting done by the Pico, though, the amplifier doesn’t need to be complicated or expensive. While the design is simple and low-cost, it’s not the simplest radio possible. This transmitter sends out radio waves using only a single transistor but you will be limited to Morse code only.

Continue reading “Pico-Sized Ham Radio”