Dumpcar series 31-638 [WIP]
The prototype
Here is a video of the real thing in action:
It shows complicated kinematics where the bed tips to both sides (tipping to each side uses its own axis of rotation), the side boards open when the tipping on their side happens. The complexity of kinematics is what mae the model interesting.
The model
The goal is to make the model in 1/87 scale that has motorized function of bed tipping to both left and right, and has moveable sideboards with linkages like on a real one.
The project is still in-progress, so here are some short videos of it.
Actuation
I’ve considered several different ways to motorize the bed tipping function. For arrangement, I was initially considering placing the motor in the frame of the wagon, and some kinematic linkages to connect the motor to the bed. This way some larger motors could be accommodated. To complicate things, the bed needs tipping to both sides (with each side having its own rotational axis), this means either 2 motors or complicated linkage that actuates both movements with one motor. Another option was to use very small motors and put them where the pneumatic actuators are in the real wagon. This way space in the frame can be given to electronics, and each motor is doing tipping on it’s own side. However, choosing the micro motor that fits into small pneumatic cylinder is more challenging.
So, I tested several different motors, each with their own pros and cons:
-
RC Servo. Pros: has positional control built-in. Cons: even the smallest one (1.7g) is way too big to fit.
-
Linear RC microservo. Same pros and cons as above, might be easier to design the linkages around (or not).
-
Micro DC motor from smartphone vibrators. Pros: tiny. Cons: too long (including shaft), too little torque and too high RPM. Needs gearbox that will be larger than the motor itself. Also precise position control is problematic.
-
Stepper motor with built-in gearbox and linear screw drive. Cons: same as with linear servo: size and complex linkages.
-
Stepper motor with integrated screw. Would be perfect for the job (when unneeded parts are sawed off), but the screw has a 2-start custom thread and comes with no matching nut, so it’s basically unusable for me and for anyone who won’t manufacture custom nuts.
-
Micro stepper motor plus home-made everything. Pros: tiny and kinematics is rather simple. Cons: attaching anything to a tiny motor shaft is difficult.
My initial idea was to use a linear servo in the moddle of the frame. I couldn’t invent linkage to use it though, and it felf that it was too big anyway. After ordering and looking at the obtiobs outlined above, I settled on a micro stepper motor inside the pneumatic cylinder model, with a screw manually attached directly to its shaft.
| Fun fact: the stepper motors with linear drive that are currently available on aliexpress come from smartphones with retractable cameras (e.g. Xiaomi Mi 9T). There are some photos of disassembled camera modules, where such stepper motor assemblies are visible. This means that when these smartphones go out of fachion, the steppers will disappear from market. |
To attach a screw drive to the stepper motor, I first tried to glue an M1 screw to the shaft with superglue. This approach can be seen on the last 2 photos above. This proved to be too fragile, as contact surface was too small, so I invented a way to solder the screw to the shaft, using steel-capable flux. To keep screw and the motor aligned, I made a resin-printed alignment jig where both the motor and the screw could be secured.
Current pickup
For current pickup I wanted to experiment with ways to increase number of contact points to a maximum, i.e. make each wheel (not wheelset) a pickup. For this, I used "AC" wheelsets, where "AC" means "for 3 rail Marklin system". In these wheelsets both wheel are electrically connected to the axle, compaed to DC wheelsets where one wheel is isolated with rubber/plastic bushing. I cut the axle in half, 3D printed a joiner and connected the halves, so that pickup can happen on axle from both sides of the joiner. The pickups themselves are makde from phosphor copper bronze wire of 0.4mm. (I want to try phosphor bronze sheet later).
Note to self: leaving the joiner to dry for a week after printing will make it stiff and hard to fit, it’s better to attach half-axles to it soon after printing.
The electronics (custom DCC decoder)
To control the model with established model railroader standards and tools, a DCC decoder is needed. All of the considered actuation options, including the one I settled on, require additional electronics to control with a DCC decoder, because they are either low voltage (DC motor) or need special drivers/interface (steppers, servos), as I haven’t heard of ready-made decoders for stepper motors. One option to work around this was to make an add-on module and interface it with the off-the shelf decoder, e.g. by SUSI. However off-the-shelf decoders are made to specific geometrical standards, and are too large to fit into the space I intended for electronics, that is inside of the wagon frame, which is only 6mm wide.
So I decided to develop my own DCC decoder, with the following requirements:
-
Independent control of tipping on 2 sides (2 stepper motors or 4 motors as 2 groups)
-
With minimal possible footprint (smaller than existing decoders).
-
Powered from tracks (preferrably within DCC standard voltages)
-
Commands from DCC signal
-
Acknowledgements over DCC
-
No sound needed
-
No Railcom needed
With this in mind, the following design was created.
The functionality of this circuit has not been fully tested yet!
Components selection
MCU: PY32F030 in QFN20 3x3mm package.
I was considering STM32C0 or STM32L0 in the same package, but they had less features (C0) or were more difficult to work with (L0), so I decided to use PY32 that I already had available. I had PY32F003, but PY32F030 is a drop-in replacement with same amount of flash/RAM (and available at JLCPCB at the moment). Originally I was also considering 5V supply (which would make STM32’s impossible), but then went to a more widespread 3.3V.
No special requirements for MCU, only ability to work crystalless, GPIO interrupts and some timers. UART is used for debug output.
Motor drivers
Initial idea was to use a generic dual H-bridge IC (e.g. DRV8835, which I used before for DC motors), but to use miniature 5V steppers on ~15V track voltages, some current limiting would be needed to avoid burning up the motors. While it’s probably possible to limit current for this application using resistors, I decided to use dedicated stepper controllers, DRV8428 in particular, to benefit from its built-in current control and microstepping. It comes in a slightly larger 3x3mm package (DRV8835 comes in 3x2mm package). To fit the components into PCB, most of extra features were dropped, e.g. control of microstepping from MCU, or control of current from MCU.
Other
I’ve summarized my search for miniaturized components in this post.
Bridge rectifier is made of TECH PUBLIC B5819WT SOD-323 Shottky diodes, which are rated at 40V, 1A (and 0.6V drop at 1A).
Voltage regulator is a <24V input, 3.3V, 50mA output LDO TPS71533DCKR-TP in SOT-363 package. It’s also from TECH PUBLIC. I used TECH PUBLIC components quite a lot in this design.
DCC reading is done via one diode (also B5819WT) and one resistor, a simplest possible circuit that is still safe and delivers correct logic HI and LOW levels on all possible track voltages. I picked the circuit from this article. 2 is lowest number of components that can be used here, except direct connection with a large-value resistor. This is somewhat unsafe as track voltage can leak into 3.3V line via MCU’s internal clamping diodes. The chosen circuit won’t work to sense analog voltage or detect ABD/CDB voltage changes, but since the decoder is not for locomotive, it’s not needed anyway. No RailCom circuitry is implemented too (to keep PCB small and to not overcomplicate my first decoder design).
Input buffer capacitors are 0603 22uF 25V capacitors from muRata. I couldn’t find any comparable energy storage in this package from other manufacturers. The PCB was manufactured with 0603 capacitors, but for next version I changed it to 0805. While 0805 package has the same limit of 22uF/25V (at least that’s maximum on LCSC), there are more manufacturers that provide the densest devices, so it’d be easier to source in general.
While ordering PCBA, I made a mistake, so the PCB was manufactured with 6.3V capacitors instead of 25V, which I had to replace to be able to run on 15V tracks. However, no smoke came out when I tried to supplied full track voltage for a brief period of time.
Thoughts on electronics after testing
On input capacitors
Due to DC bias effect in ceramic capacitors, only a small fraction of capacitance is left in them at rated voltage (like maybe 5%). For next design, use something else like a tantalum capacitors. 25V 22uF are possible in case B / 1411 imperial / 3528 metric (3.5x2.8mm, similar to 1206/1210 ceramics).
On stepper motors connection The current PCB is designed to have 4 stepper motors, 2 on each side. Motors on 1 side are wired in parallel, which causes the current from the driver to share between them. This seems to be suboptimal, as the motors have different load, and seem to share the current asymmetricaly; as a result, one motor looses steps compared to other. And because the actuators are assembled manually, there is a lot of inequalities and imperfections in their construction, so the skew happens a lot.
To share the current equally, a series connection shall be considered when next PCB is designed. In series connection, current for each motor is equal to whatever the driver is configured for, and voltage is divided between them. Since motors are rated at something like 5V, running 2 of them in parallel on track voltage of around 15V should not create problems.
I took parallel connection from 3D printer PCBs, where this is how it’s historically done. However, even in 3D printer boards, series connection is also used, and the best performance is achieved when each motor is controlled by a dedicated driver.
For now I plan to use only 1 stepper on each side with this PCB. This doubles the current through one stepper, so it overheats faster, but seems ok if movement is not abused.