This project has occasionally appeared in this blog, and has been so for a long time. There were complications and distractions along the way that kept me from getting it done. I am happy to report that it is complete, working and installed in the station. There's a welcome check mark on my lengthy to-do list.
Before going further I'll mention that there are many features present in commercial controllers that I have not implemented. I'll get to some of those eventually. Since they're mostly software, upgrades can be made with the controller in service. What I judge to be the important functionality gaps will be listed at the end of this article.
My requirements for the controller are simple enough:
- No larger than a commercial controller, suitable for desktop use
- Support for 2 prop pitch motor rotators
- Potentiometer for the direction indicators
- Software for ease of modification and expansion
- Remote 24 VDC power supply for the motor
There are commercial products that will do all of this and much more. But it's more educational and interesting to build my own. It is a project that is within the abilities of many hams, although for some, I must admit, it may be daunting. I always seem to struggle with circuit design, while software is one of my areas of expertise.
The downside of this project was the time and effort expended. I didn't do it to save money! I did it for the learning and personal satisfaction. There is no shame in buying a controller if you'd prefer to apply your energies elsewhere.
Let's begin at the back of the controller. Although an unconventional place to start, it can be illuminating to first look at the interconnections. The USB port is on the Arduino Uno board. It is only needed for uploading and testing software. All power comes from the 13.8 VDC connector on the lower right. A barrier strip provides ±15 VDC for the two direction pots and the two pot wipers.
The DE9 connector connects to the power supply unit. 6 pins are for low side switching of relays: 2 to control AC and 4 for the CCW and CW DC relays of the two motors. Switching is low side, requiring one pin supplying +12 VDC to the relays and external circuitry. Ground is via the connector shell, which therefore requires a shielded 9-pin cable.
One unfortunate lesson was that the DE9 connector doesn't project out far enough to seat the male cable. The ABS panel is too thick. After the picture was taken I had to carefully extract it and place the flange on the outside of the panel. Although it isn't as pretty it is only rarely seen. Thankfully the wires were terminated by Dupont connectors rather than soldered so it didn't take long to make the change.
At the moment only one of the AC pins is used since there is one power supply that only has enough current capacity for a single motor. That means only one motor can be turned at a time. That is enforced by the software so there is no risk of blowing a fuse. With a second power supply and software update both motors could be turned at the same time.
The 2 remaining pins are for monitoring the DC current and voltage. Those functions are not present at the moment even though I have the modules. The quantities will be displayed when a motor is powered, and also used to detect and respond to system faults. I have been bedevilled in the past by wiring and component failures that required opening up the controller to attach current and voltage meters. The built-in voltage and current monitors will make problems easier to diagnose.
There is very little heat produced by the controller. I tried to place most of the heat generating circuits near the back vent. Voltage regulators are the main culprits.
This is a view of the interior before the display and circuitry and their respective cables were installed. The 5 VDC regulator is up against the vent. A chain of diodes reduce the 13.8 supply to the 12 VDC maximum that the onboard Arduino regulator can handle. On the left wall is a buck-boost power supply that produces ±15 VDC for the direction indicator circuitry. They can be found online and they are cheap. There's no point providing a link since these products come and go quickly.
The buck-boost power supply is one source of heat. Because the minimum output is 30 ma for both the positive and negative supplies, unless the connected circuits draw at least that much it is necessary to install 470 Ω resistors to bleed the minimum current. Otherwise the output voltage can soar to over 50 volts. The power supply module is cheap but it requires care in how it is used.
Since it is not usual to disconnect the direction pot wires or even the internal cable harness to the op amp circuit, a higher value resistor that draws less than 30 ma and produces less heat entails risk. Each resistor dissipates about ½ watt at 30 ma. There is one for the positive and negative supplies. They get very warm, too warm to touch comfortably. I may replace them with higher power resistors on the back wall of the enclosure to be near the vent.
Various versions of the Arduino Uno can have different dimensions. That could be a problem for locating the USB connector on the rear wall and PCB mounting holes. I suggest buying the board first and measuring it before picking up a drill and saw. Having at least one spare of the same type can avoid future grief. The Uno was the smallest Arduino with the GPIO complement to support this project.
The display is a 1602 2×16 LCD. As I described in an earlier article I had difficulty finding a template that worked well for 3D printing a bezel that wasn't too large and that secured the display to the front panel. I abandonned the search and carefully cut a rectangular opening in the front panel that is a press fit for the display. Some fussing with a file helped to make it as snug as possible. Hams with 3D printer skills could do better. Nevertheless it doesn't look too bad from a meter away.
The small holes below the LCD are for adjusting the zeroing pots. The gain pots are on the central PCB. The gain pots should not require adjusting after initial setup. I also included software gain controls to fine tune the gain more conveniently. With one chain drive motor with a 1:1 turn ratio and an outboard pot on the direct drive motor with about a 2.5:1 turn ratio, hardware gain is preferred to keep to the op amp circuit's linear range. If the hardware gain is too low the resolution of the bearing may suffer due to the 10-bit ADC on the Arduino boards (1024 discrete values).
In this picture most of the components are installed. The major additions are the support for the zeroing pots and the PCB with the circuitry. The circuit includes connectors for the DE9, power, GPIO pins, LCD and zeroing pots, trim pots for the LCD contrast and two for the direction indicator gain, and op amps for the direction indicators. There are RFC and bypass capacitors for external connections.
These are the completed units. The controller has evolved with the addition of the 4 buttons to operate the rotators and a small Arduino shield (plug in) with a ULN2003A NPN Darlington array to switch the 6 relays. To conserve analogue GPIO pins (I use all 6 on the Uno) only 2 are used for the buttons. The pins are pulled high when idle, grounded for CCW and half-Vdd (2.5 VDC) for CW. The direction control buttons are debounced in software.
There are a lot of wires and connectors inside the controller. A better designer than I'll ever be may have been able to clean it up. The circuitry is simple but it appears complicated due to all the wiring harnesses. Working on the controller is not as bad as it looks. Documentation is vital.
The power supply is an ugly unit that came with one of the prop pitch motors I acquired. That's fine since it is located out of sight under the operating desk. The chassis was stripped of most components since they were for the discarded manual control system.
A large electrolytic capacitor was replaced by a new and much smaller 2200 μF 50 WVDC unit. The barrier strip is for the CCW and CW 24VDC connections to the motors. Ground (motor common) is a chassis stud where the black DMM lead is attached. The DE9 connector is supported by small aluminum angles that I made.
A fuse holder (5 A) was placed on the side in an already present chassis hole. Not quite visible is the AC power switch on the front (bottom left). It can be left on since AC only flows when the rotators are turned; it can be turned off for software testing. I am using this power supply rather than the old one since this one is stiffer. Under load it produces 24 to 25 VDC. It is reduced by a couple of volts at the motors due to wire resistance. The motor on the 15 and 20 meter upper yagis is starting and turning faster with this supply, and I expect more reliably in the winter cold.
Automotive 30A SPDT relays are mounted on the power supply chassis, 4 switch DC to the two motors and one under the chassis switches AC to the power transformer. I was remiss in not ordering relays with an internal protection diode so I included them on a small PCB along with bypass capacitors for the control lines. More components will be added to the PCB for new features. There are a lot of wires just because there are many relays but the circuit itself is uncomplicated.
To avoid switching high current DC the relays are sequenced by the software. When a button is pressed, the corresponding DC relay is energized, followed a fraction of a second later by the AC relay. The sequence is reversed when the button is released. Although the relays are rated for 30 A, their lifetime will be shorter when switching high current. Typically the motor starting current is limited to less than 20 A due to the resistance of the long wires to the tops of the towers.
With each component tested it was time to connect the controller to the prop pitch motors. Or, if you like, integration testing.
To avoid overly disturbing the existing controller and its fragile direction indicator circuitry, I started by moving the motor wires to the new controller but not the direction pot wires. The new controller was set to power the motor while the old analogue prototype continued to indicate direction.
The only hiccup was that I'd reversed the CW and CCW wires. It's an easy mistake to make with these motors and my labels were not the best. All was well and even better since the motor for the 20/15 meter stacks started and turned faster with the new motor, just as I'd anticipated. For some reason it is particularly sensitive to low voltage.
For the next step, the direction pot leads were transferred to the new controller. Of the 6 wires, 4 go to the ±15 VDC terminals and the other two are the pot wipers.
Tranferring the wires was a lot trickier than for the motor. Since the direction pots don't have the same turning ratio to the mast (as described earlier) it is vital to connect them to the correct circuits. I pre-calibrated both circuits manually with a directly connected pot -- both hardware and software gain controls -- so that the yagis wouldn't have to be turned too much for the live calibration. Zeroing was easily accomplished by turning both rotators north before moving the wires.
I did a poor job of documenting the transfer and documenting the internal cables in the new controller. After several false starts I finally got the mess figured out and retested the calibration using a local pot. Finally I got it working. This took several days because I needed time away from the project due to excess frustration. It was easy to find other projects to play with in the interim.
When I had another go at it I discovered the problem. The controller was fine. It was one of those absurd coincidences that the direction pot on the 20/15 prop pitch motor was slipping. That's one more item added to my to-do list. I have a new bracket already made that I was negligent about installing. I guess this is an opportune time.
Rather than light the LED inside the button (which is covered by your finger) I use blinking arrows next to the bearing indicator. It's rudimentary but effective.
Among the problems I've encountered with the controller is electrical noise. The diodes on the relay coils are mandatory, as I discovered, since when they disengaged the LCD or the Arduino would often fault. Even with the diodes there are problems. Switching of the AC supply line occasionally scrambles the LCD but not the Arduino. It can also cause the needle on one of the Hy-Gain rotator controller to momentarily jump.
I am working to resolve these issues. Digital circuitry is very sensitive. A metal enclosure might have helped. All I can do is add more bypass capacitors, shielding and RF chokes to manage the intermittent faults. Until I get it fully under control I occasionally reset the controller. The easiest way is to pull the power connector (there's no on-off switch).
I should briefly mention the software I wrote for the controller. The direction indicator and motor control function independently. I've already discussed the direction indicator circuits in some depth so I won't say more about it here.
The motor controls feed a finite state machine (FSM) that determines the state of the motor controller based on button input and timers. There is just one FSM since it is disallowed to turn both motors at the same time with the one power supply.
An early draft is on the right. It's to give a taste of what an FSM is for those unfamiliar with it. So don't worry about it being somewhat cryptic!
There are pending states to ensure solid button presses and releases, which act as button debouncers. It is highly undesirable to have the relays snapping in and out due to intermittent button operation, whether by the operator or button contact issues. Therefore there is a brief delay between the button press and motor operation.
Sequencing of AC and DC relays is driven by FSM states and timers. Once the motor is turning all the other buttons are ignored. Only when the active button is released are other buttons inspected. To prevent operator errors the controller waits for all buttons to be released if one of the others is pressed when turning stops.
Since the direction pots are independent there is no protection against over-rotation. It was more important to get the controller usable rather than first address every edge case. That will be corrected in time.
That leads to future feature implementation. The first version is rudimentary but perfectly functional. It may be enough for me to use but not for guest operators. Additional protections and displayed information would be beneficial. Planned features include:
- Over-rotation protection. A small amount of over-rotation is desirable and I've made the rotation loops tolerant of it. Perhaps 20° but no more.
- Edit direction pot glitches. Pots are imperfect devices when out in the weather. The wiper does not always solid contact the wire coils as it moves. These glitches can be identified and dealt with in software if they are not long duration. Inertia of the meter needle on legacy controllers similarly smooths the bearing indication.
- Current and voltage monitors. Once the modules (very inexpensive to purchase) are added to the power supply it will be convenient to monitor these key indicators of motor operation. No more pulling out the DMM for testing. The data can be used to automatically stop operation if the motor does not start or turn properly, or to warn of a broken connection.
- Two power supplies. I'd like to be able to turn both motors at the same time. This would be most helpful for multi-op contests. I prefer to mount both on a single chassis, including the control circuits. This feature is mainly a software change.
- Wireless PC connection and control. This will allow rotator control from the PC, either by a separate application or integration with contest logging software. It is also needed should I ever implement remote operation of the station.
- Over-rotation protection, as described earlier in the text.
In the end, was this a worthwhile project? I am undecided. Of course I learned a lot and there is satisfaction from having done it, but the usability is perhaps not as good as I'd like. The box looks cheap, feels flimsy and it is so light that the cables at the back can lift the front feet. Although it is working fine there are transient issues to track down and further software development is needed to add the missing (and desired) features.
With all the projects I undertake this was perhaps not the best use of my time and effort. I started it more than a year ago and even though I spent only a fraction of my time on it, it's been annoying to constantly see the unfinished controller sitting there.
I will put this project aside for now since it works. My focus for the rest of the year will turn to other projects. I have no regrets but building is not always superior to buying. Especially so as one grows older.
The old controller with the prototype direction indicators is now officially retired. I'll salvage the 24 VDC power supply and send the rest to my junk box.
No comments:
Post a Comment
All comments are moderated, and should appear within one day of submission.