Smooth RPM
The latest instrument in my switch-to-CAN-bus side project was the tachometer.
This instrument is based on Captain Bob’s tachometer from his Cessna 172 project. I redrew the scale from scratch because the green RPM range on the Piper Arrow III is different from the Cessna 172. I also reconstructed the needle to match the Piper’s design, and I wanted to add a working Hobbs meter to the instrument.
I briefly considered finding a suitable mechanical counter, or even 3D printing one myself, but in the end I went with a design using a small, inexpensive OLED display. I did at least write my own driver for it, so when the numbers change they animate like the rotating drums of a mechanical counter.
Up to now, the tachometer, like my other older instruments, was connected directly to one of two Arduino Megas that received the simulator data through Air Manager. For the OLED, I used a separate Arduino Nano running my own firmware based on the Air Manager SDK. It handled the display and, most importantly, the animation of the hour meter.
In the photo you can see the usual mess of wires, one of the main reasons I started the CAN bus side project. The four wires from the X27 stepper motor that drives the tachometer needle run to the Arduino Mega, while on the left you can see the Arduino Nano for the OLED dangling in mid-air. In the upper right corner of the tachometer, you can also see the instrument panel light, which is wired separately to its own distribution board.
A fellow builder recently suggested that instead of driving the X27 steppers directly from the Arduino pins with a software-only driver, which usually results in fairly jerky full-step movement, I should use one of the inexpensive driver chips made specifically for these motors. That makes microstepping possible and gives the gauges much smoother needle movement.
So I ordered a few of these "AX1201728SG" driver chips from AliExpress. A blog post by [Gaugette] was incredibly helpful for figuring out the correct wiring and how to control the AX1201728SG. After a successful breadboard test, I designed a simple carrier board.
The Arduino Nano, CAN transceiver module, DC-DC converter, and stepper driver chip could technically just be connected with a handful of short jumper wires, but using a small PCB makes the whole setup much cleaner and easier to manage. It also helps with the fact, that the AX1201728SG comes in an SMD package.
For simple PCBs like this, I’ve recently become a big fan of the “3D printing and copper foil” technique that became popular a few months ago thanks to a YouTube video by [QWZ Labs].
After that, I designed a new enclosure for the existing instrument that has room for the PCB as well as the two CAN connectors, turning it into a compact, self-contained unit.
Like my other CAN-based instruments and controls, it can simply be plugged into the CAN bus daisy chain. Besides driving the tachometer needle and the hour meter, it also controls the LED for the instrument panel lighting.As a result, the old tangle of wires is finally gone, at least in this part of the cockpit. Even the dashboard lighting is now wired with a short, direct, and much cleaner connection.
As promised, I’ll cover the details of the CAN infrastructure I’m using, along with the DCU controller that translates data from X-Plane to CAN, in a future post.
In the meantime, all of the software and firmware is available as open source in my GitHub repository.
That leaves just one question: did the new driver actually make the needle movement smoother? I’ll let you be the judge:
(And sorry about the weird lighting in the video.)
Comments
Post a Comment