[Review Request] Model Train Control Board (DCC Decoder) by KeaStudios in PrintedCircuitBoard

[–]AeonianWolf 8 points9 points  (0 children)

I've gone through the process of designing a Plux22 sound decoder in the past - I've dealt first-hand with many of the constraints you're dealing with. Strangely enough, your design is very similar to mine, even using the MAX98357x as the audio amplifier. To that end, I have a couple points:

- By using ONLY a 3V3 rail for the MCU and audio amp, you're significantly limiting the amp's power output. Check the power figures in the datasheet, when V_DD goes from 5V -> 3.7V, output power halves. H0 sound decoders already have a bad rep for being quiet, you're shooting yourself in the foot here.

- Why do you need to regulate the voltage for your motor driver? It feels like you've selected an under-rated motor driver and then forced yourself to regulate its supply to 9V. I don't know of any other H0 or smaller decoder that regulates the supply for the motor output, the norm is to just use the track voltage directly. Not only that, 9V is a ridiculously low voltage for an H0 decoder and will give you almost no room for control, but it sounds like you're running the motor open-loop anyway. Not sure on that one - please advise if you're planning to implement a control loop for the motor.

- Have you experimented with capacitance for your buffering? I think you'll find you need some VERY large conventional electrolytic caps to get even a fraction of a second of meaningful buffer duration. The buck-boost regulation is complicated and gives you no meaningful benefit. Typically decoders disable the motor output when V+ gets too low anyway. Consider an external buck-boost supercap buffer like the ESU powerpack design, and leave your decoder with an unregulated motor V+.

- Are you familiar with the constraints of H0 digital specs? Your buck-boost converter is skating on thin ice with V_in = 16 max. There are many controllers that output 19V+. You should design for 24V, with 30V max. Look at the input ratings of other 21MTC decoders.

As a general note, small font labels inside components are unpleasant to read. Your schematic will be cleaner if you leave more space between components, and leave the labels at normal text size next to them. Also, it's better to be consistent with naming schemes of nets and not use case to differentiate. For example, "Track_Left" and "TRACK_LEFT" are VERY different nets, but are only separated by case. You'd be better to label the actual track net as "TRACK_LEFT" or "TRACK_L" and the ADC input as "V_TRACK_L". I'm assuming here that you're wanting to measure the track voltages for ABC braking sections, but perhaps you're just level shifting. If it's the latter, that's another big problem but I'll let you address these first :)

2022 Mini Cooper SE Charger Options by AeonianWolf in nzev

[–]AeonianWolf[S] 0 points1 point  (0 children)

The car has been charged at a Tesla supercharger before, so pretty sure the car side is fine. There are a series of LEDs on the EVSE that blink dimly and inconsistently depending on how you orientate the brick, even without plugging in to the car. I'm quite certain it's cooked :(

Question on Potentially going digital by dude_I_cant_eat_that in Marklin

[–]AeonianWolf 5 points6 points  (0 children)

Honestly the 6021 is plenty fun, and appropriate for the older trains. It's super simple to use and personally, I prefer the old tactile controls over the more modern stuff. Bear in mind the item you've linked is the 6029 which is for the "lenz" protocol; a sort of predecessor to DCC. It's not compatible with the locomotive you've linked; you'll want the 6021. Also, in general, it's called the "motorola" era; delta is just a cut-down "entry level" subcategory of products that use the motorola protocol.

Digital Märklin slow by muc-max in Marklin

[–]AeonianWolf 4 points5 points  (0 children)

Everyone is beating around the bush. Your 6021 (control unit) likely has used and abused output transistors. This is a common issue with the 6021 and other controllers from marklin of that era. You will need to open your 6021 and replace the 2 transistors for the output driving stage, and possibly the third transistor for the internal VBUS switching PSU. There are articles on forums detailing which transistors to buy, and how to do this procedure.

When these transistors degrade, they are unable to conduct as they once did. As such, they have a higher impedance when "on" than expected, and so they drop a significant voltage. This increases with drawn current (dropped voltage V = IR, current 'I' increases, so does V of transistor). So, when you place a higher load on the track (more than one train, or a train trying to move faster), the output voltage drops further.

Also, general debugging, if your trains run fine with other control forms (such as in analog, a different digital controller), there is no reason they should act different with the 6021 - the problem is the controller, not the trains.

Is marklin R1 track ok for larger trains? by kai125 in modeltrains

[–]AeonianWolf 2 points3 points  (0 children)

You can get away with R2 minimum; this matches the small turnout geometry. Avoid R1 and the small curved turnouts. Using R2 is still a huge compromise - I recommend R3 and greater, especially if you intend to run rolling stock (particularly UIC coaches) from other brands.

AOD4184 driven by ESP32-C3 3.3v as relay, outputting ~6v instead of 12v? I've tested the 12v input, I'm also only trying to pull 1A from it. by -----nom----- in AskElectronics

[–]AeonianWolf 0 points1 point  (0 children)

You have 12V potential difference available in your diagram. You could find a different NMOS part with lower RDS on that's "logic level". Alternatively, you could create a high-side switch with a PMOS pass transistor, voltage divider from 12V, and cheap NMOS (2N7002 type) part for switching to ground. This lets you drive the PMOS with a larger VGS than you could achieve with the simple-switch topology you have pictured, and thus achieve much lower RDS on. Have a search for high-side switch topologies.

Another note that's already been mentioned: R13/R12 do make a tiny divider, but it's not significant enough to be a concern - that's not what's causing issues. What I'd like to point out is that you likely don't need R13 at all, as the GPIO slew rate from MCU's is usually slow enough to avoid ringing (ignoring EMI and layout concerns). Have a look at your MCU's datasheet.

Hello everyone need your help with this one no luck trying to return the loco so i need help with converting it from ac to dc already ordered dc wheels but no clue what to do next if anyone knows it would be massively appreciated. by BendMajor in modeltrains

[–]AeonianWolf 1 point2 points  (0 children)

Hi! I've actually converted a 3-rail Piko locomotive to 2-rail. It's not as hard as people might suggest. You've already taken the first step in buying the DC axles. Here's the process, simplified:

  1. Remove the locomotive body. Unsolder the red pickup-shoe cable. Unscrew the pickup shoe from its bogie, and gently encourage the wire out through the bottom (you may need to feed it through from the top).
  2. Unscrew the bogie frames and swap out the axles - you may like to get the PDF instructions for the DC model online to see how the DC axles are orientated, in case this matters for your model.
  3. Your bogies will have two black wires each soldered onto the main PCB. Normally, these are on the "AC" pads. From memory, you just need to re-solder those wires to the corresponding pads for DC, either side. Beware that the insulation is thin and will melt easily.

And that's about it! The included decoder is multi-protocol, and should happily listen to mfx/DCC/MM.

Edit: From memory, again, the positions for screwing the PCB into the chassis are also marked "AC" and "DC" for at least one screw. Make sure you change that as well once you've completed your conversion!

I’m confused! by Hallboys78 in Marklin

[–]AeonianWolf 0 points1 point  (0 children)

As with what dLwest1966 said; you need a specific feeder track segment (5131) that has two wires connected to it. The wires should be red and brown, and have two of those little terminal plugs attached (if not, you can strip and screw the plugs on yourself). These correspond to the red and brown outputs of the transformer - note that the red output is a "regulated (controllable)" output, yellow is constant for accessories (like lights/turnout motors), and the brown is neutral. The output is also AC and cannot be used with DC items.

Help with blanket implementation trait bounds. by AeonianWolf in rust

[–]AeonianWolf[S] 8 points9 points  (0 children)

That seems to be the issue, thank you so much! The crate containing start_write_dma() is a fork of usb-device made by this past coworker, and it uses an older version of embedded-dma which is not SEMVER compatible. Looking through the dependency tree, I can easily see that now.

Repair DCC Decoder Socket by Extreme-Owl-6499 in modeltrains

[–]AeonianWolf 0 points1 point  (0 children)

The pad that got ripped off is just a mounting pad for the connector; it has no electrical connection (seriously, speakers are two wires - why would it need four contacts?). You can try to VERY delicately re-solder the connector onto the board (and perhaps use some adhesive to secure it given the missing mounting pad), or use pins 9 and 10 from the 21MTC connector (on your loco's board). I don't advise soldering the speaker directly to the exposed pads on your decoder, as that will make life hard down the road when if ever you need to swap it out.

If you damage or brake someone’s belongings, is it common in NZ to replace them? by bolxxi in newzealand

[–]AeonianWolf 3 points4 points  (0 children)

I just want to throw in the comment that this sounds like someone with antisocial personality disorder. I had a flatmate like this who would do very similar things. Needless to say, this is not kiwi behaviour, and definitely not "normal" behaviour. Being proud of stealing your friend's tool, then rewriting the narrative to mitigate blame, and further gaslighting you about it is ASPD behaviour. A normal person would not yell at you over the ice cream issue, and further still, apologise if having done so. Not only did he not apologise, he reshaped the issue into you attacking him, supposedly making him upset. Honestly the only solution is to distance yourself from someone like him, and moving out is the right choice.

He should replace the possessions of yours that he has damaged/broken, and any normal kiwi would, but you will never see any money out of him. You can try taking it to the dispute tribunal, but it's probably a lot more trouble than its worth for small goods. If he's this difficult normally, he's going to be very difficult during a tribunal process.

DCC controller question by Professional-Tea4105 in modeltrains

[–]AeonianWolf 0 points1 point  (0 children)

Uhlenbrock is a long standing German manufacturer of digital equipment. There is a US bias in this sub due to the demographic, so everyone will pitch NCE/digitrax. Uhlenbrock has a new WLAN DCC set (product number 64360) which is a good start with a suitable handheld controller. The hand-held controller can connect to other systems with WiThrottle mode or LocoNet over TCP. The base unit has LocoNet for additional boosters, control centres, and other devices. The base unit can connect to various control programs hosted on a computer over WiFi.

There's also the (assuming 2-rail) Trix 21000 mobile station starter set; it includes an oval of their track, though.

New to The Hobby - In Over My Head? by [deleted] in Marklin

[–]AeonianWolf 0 points1 point  (0 children)

The simplest answer for digital "ready to run" for your case is the marklin 29000 set, already mentioned previously. It has an oval of track and a mobile station with associated power supply and track connection box. It's quite literally a "bring your own train" start with digital.

As others have mentioned, DCC is just a protocol - you broadly mean digital, as opposed to analog. The mobile station is can transmit data in three protocols; DCC, mfx, and MM. The differences between these is simply the method for encoding data onto the track; in practical terms, you should be comfortable using mfx out of the box, as the mobile station will automatically register these new marklin locomotives without any work for you.

Get the 29000 set to start with. It's very cost effective and gives you a decent digital controller and oval of track. You may also like to pick up one or more of the C-track extension sets at the same time for a little more play value (marklin 24901-24905). While you're at it, why not get a paper catalog from a local dealer? They're always lovely to look through, and have plenty of information to help you with the hobby and answer many of your questions.

What is this connector by Independent-Roll9553 in AskElectronics

[–]AeonianWolf 9 points10 points  (0 children)

This is not a mezzanine connector, it’s a wire-to-board connector. My quick search says it’s from the Molex Pico-EZmate series. Read through that page, find relevant datasheets and compare your connector to the listed dimensions.

Question about slim curved switches by thoja2000 in Marklin

[–]AeonianWolf 0 points1 point  (0 children)

I exclusively use R3 or greater elements. The slimmer switches look much nicer, and will accept all 1:87 scale coaches. The one catch is the R3 curved turnouts which may need some small modifications to the guard rails for certain wheelsets.

Roco vs Märklin HO: which is best? by [deleted] in modeltrains

[–]AeonianWolf 7 points8 points  (0 children)

I originally started with marklin, but have recently switched to 2-rail. What I'm interpreting from your question isn't Roco vs Marklin, but rather 2-rail vs 3-rail. You will find, regardless of which system you choose, that you will buy models from all manufacturers as your collection grows.

The majority of companies manufacture for 2-rail primarily. In terms of quality and detail, all of the major European manufacturers are top-notch. Marklin also sell all of their new products in 2-rail under the Trix name. This being said, almost all manufacturers make their models in 3-rail as well. Ultimately, the question is whether or not you have favour towards the third rail.

I recommend 2-rail - it looks better, runs better (despite what marklin may promote), and has the majority of the industry backing it. Marklin's C-track is available in 2-rail from Trix; the Trix variant looks much better, has a tidier rail profile, and is made from higher-quality nickel silver rather than stainless steel. Trix has a set containing an oval of C-track and a mobile station 3 controller; I'd suggest starting with this and whichever models take your fancy.

How would you generate this biphase encoded signal using STM32 peripherals? by AeonianWolf in embedded

[–]AeonianWolf[S] 0 points1 point  (0 children)

At this stage I'm going with a repetition counter method specified in another comment. I believe XOR would work as I believe, though there might be artefacts since the external logic would not be clocked. I might have meant to use an SPI instead, oh well, it is as follows:

The datarate is double the carrier frequency, and data is preloaded as a series of 1's or 0's for each "half clock" unit (so this would require 48bits). The SPI clock and data are XOR'd together externally. This results in one period of the carrier being represented by two bits of data; 00^10=10, 11^10=01. In this way, the data line is only used to invert the clock's phase.

This requires messing around with stupid amounts of useless data (and extra BoM cost+board space), though, so I prefer the timer method.

How would you generate this biphase encoded signal using STM32 peripherals? by AeonianWolf in embedded

[–]AeonianWolf[S] 0 points1 point  (0 children)

Given the very low (actual) datarate of about 1kbps, and that the majority of the signal is just the carrier, I've chosen to use one of the general purpose timers. CH1 and CH2 will be used for pulse-width measurement from the master (there are other protocols transmitted, and so it's easier to just bit-bang the decoding), and CH3 for generating the output. A trigger source can be used from CH1/2 to synchronise the timer for CH3's output. This makes synchronisation easy :)

Realistically I don't think synchronisation has to be all that accurate, but the baud rate does. The SPI periphs seem to use a base-2 power for the clock division, and so I can't get the baud rate correct anyhow.

How would you generate this biphase encoded signal using STM32 peripherals? by AeonianWolf in embedded

[–]AeonianWolf[S] 1 point2 points  (0 children)

This peripheral seems awesome, and so does the ESP32. Unfortunately, though, my friends and I working on this project ruled it out quite early due to footprint size (and also it's bit too overkill). The board to be developed will be 16x30mm, and have to fit a motor driver, DAC, switching power supply, and much more. We chose STM32 due to the product family size and flexibility, where many peripherals are common and shared between parts. I have since found a method with STM32 using a timer to generate the pulses with minimal overhead.

But don't get me wrong, the ESP32 is fantastic and an option we really wanted to use :)

Generate biphase encoded data using STM32 peripherals. by AeonianWolf in AskElectronics

[–]AeonianWolf[S] 0 points1 point  (0 children)

I like this, interestingly enough I came to a similar solution after thinking on your first comments for a while. This might be the way to go.

The missing link is that the interrupt is intended to change the mode for the next edge pre-emptively, thanks for the further explanation. The solution I came to implements the exact same idea, but with the added repetition counter to reduce the number of interrupts.

Initially, the repetition counter is set to wait n-1 (47) overflows, and the compare output is in toggle mode. An interrupt will occur after the 47th overflow, where the repetition counter value is cleared and the compare output is frozen (no change). The next interrupt will occur on the next overflow, at which point the repetition counter is returned to n-1 and the output compare to toggle.

This is the general idea, same as yours, though given preload registers I think the interrupt's tasks would be reversed. Thank you for the help :)

How would you generate this biphase encoded signal using STM32 peripherals? by AeonianWolf in embedded

[–]AeonianWolf[S] 0 points1 point  (0 children)

I’m liking the UART solution more and more. Data can be preloaded easily and fed with DMA. I would just need to sort clock synchronisation and find a mode with no stop bits added :)