• Welcome to The Forum for Gauge 3 Model Trains.
 
The Gauge 3 Society       2.1/2 inch Gauge Association       Cookies and privacy HOW TO JOIN: to request forum membership please click here

Gauge 3 Society members must be logged in to view the Society section
  G3 Clubroom

Welcome to the G3 Clubroom. This is the friendly online forum where members share ideas and inspiration, suggestions and advice, modelling tips, pictures and drawings, and general chat about our fine hobby of Gauge 3 railway modelling. A warm welcome, and enjoy your visit here today.

Doddys HaupWerkstatte - My build thread

Started by Doddy, Mar 02 2018 10:42

« previous - next »

0 Members and 1 Guest are viewing this topic.

IanT

Obviously showing my age here but I used to use a vero-pin prototyping system that was very similar to the hand-wired backplanes used on computers not so many years ago (well OK - about 40!). Then I moved to 'Veroboard' (a tradename I guess) but these days use a form of prototype board which is quite useful. I've not heard of your "ink" system Ralph, which sounds interesting, as soldering small jumper wires can get a bit annoying. Perhaps you could give a link to a good source?

With regards PCB production, I intend to take a lead from my MERG friends who use various PCB layout software systems and then send the 'Gerbers' (??) off to China for production. I was concerned that some of this software would just be another mountain to climb (together with 2D-CAD, 3D-CAD, Templot, IDEs - MPLab X, MMB etc) - which involves more time invested in side activities before getting back to the actual end project. However, they have suggested that a "part-timer" (like me) would find an open source product called 'Fritzing' very easy to learn and use - and that is what I will eventually do. Basically - it lets you draw a prototype board with connections, converts that to a circuit diagram and PCB layout - and most importantly generates a gerber file that the Chinese can use. So once you have a working prototype, hopefully it will be fairly easy to transform it into a more realiable and smaller end product. As I've mentioned, I have several things I'm working on and as the minimum PCB order is Qty 10 - will have some left over if others here wish to experiment.

Regards,

IanT 
Nothing's ever Easy - At least the first time around.


John Candy

In the days when car heated rear screens had a kind of printed/"transfer" surface element on the glass, you were able to buy a conductive silver repair pen in Halfords and similar car part shops. They were used to bridge any "burn outs" in the element. Presumably this the same stuff? Do Halfords still sell it?

John.
My fellow Members, ask not what your Society can do for you, ask what you can do for your Society.

IanT

Was just re-reading this thread and it occurred to me that the Micromite Plus (which runs on the mid-range PIC32 chips - 64 & 100 pin versions) can already play WAV files directly from an SD card. I've not tried this on my E64, so I don't know exactly what sound quality is possible - but on the very fast PIC32 MZ chip (which runs a very powerful version of MMBasic called 'eXtreme') - I found the following note:

"Extended WAV File Playback: The Micromite eXtreme can play WAV files (like the Micromite Plus) however, if the eXtreme is configured to run at 252 Mhz it is also capable of playing WAV files recorded with sampling rates of 24 KHz and 48 KHz." This sounds quite impressive but in truth I've no real idea what is required in practice for our applications...

My 'on-board' thoughts have thus far been directed at the simple 'Micromite' using the simplest/slowest 28 pin device that runs MM Basic. The larger chips are (x5) faster, have a lot more memory and a lot more I/O. They also run enhanced versions of MMB (Plus & eXtreme) which are backwards compatible with the 'basic' MMB version - so anything written for the simpler chip will run on the faster ones but not vice versa where the enhanced features have been used.

My main reason for using the 28pin DIP was for ease of soldering but now I'm beginning to solder-flow SMD devices, some of that logic is starting to fade away it seems...

One thing at a time though... my H-Bridge has finally arrived.

Regards,

IanT


P.S.   Thank you Ralph - I'll order one to try.
Nothing's ever Easy - At least the first time around.

Doddy

As we get the sound project(s) underway, I think we will find all sorts of cards at all sorts of prices to suit everybodies pockets. Nice work identifying another source of bits though Ian.
As far as the sampling rate is concerned, I record at 24bit 88.2Khz, and load my projects at 16bit 44.1Khz (CD quality) purely because the sound format I use allows a greater dynamic range to be recorded than lower sampling formats.
Almost all but the MiTroniks card (16bit 44.1Khz) are low bitrate cards 8bits through to 11bits although there is some conjecture as to what Dallee, PhoenixZIMO and Loksound are using these days, they certainly don't sound like 16bit samples being played from my last listening review.
I was working with the designer of the MiTroniks card and played a Class 56 file through his three way Hi-Fi speaker system, and from three feet away you could feel the engine vibrations trying to punch a hole your ribs.
There are techniques that easily dispel the fallacy that good quality sound cannot be played through small speakers- even down to OO gauge!, it is the sound chip (processor) that determines the poor quality.

As to how to integrate with Radio Control etc
Ralph and Tim introduced me to a Radio Transmitter and Receiver which has multiple push buttons and outouts which can be routed to the inputs of the audio cards to select and play relevant sounds.
"You don't know what you don't know"

IanT

Sound is not a real priority for me at the moment - but I found this post on (what is effectively) the Micromite Forum. To be honest, I'd never heard of 'FLAC' before but others seem to think it's better than WAV and it's now an integral part of the MMB (Plus & eXtreme) language.

https://www.thebackshed.com/forum/forum_posts.asp?TID=9395&KW=FLAC

The supported 'FLAC' sampling rates are given below and they seem to be within Doddys' performance criteria.

44.1KHz 16-bit (CD quality) and 24-bit
48.0KHz 16-bit and 24-bit
88.2KHz 16-bit and 24-bit
96.0KHz 24-bit
192.0KHz 24-bit (252MHz CPU only)

As one of the I2S DAC devices (that the FLAC s/w uses) is listed at £2.62 - an E64 system (plus a 32Gb SD card) with this device would be an interesting sound solution and still have enough processor/memory bandwidth to handle a radio control link and any other engine I/O required. You could look at this as an on-board engine controller with an optional sound device that costs about £2-£3 - or a dedicated 32Gb engine sound system (for about £40). You also need the sound files too of course.

As you say Doddy - there are probably many ways to do these things but as I already use the MM system for other stuff, it's nice to have these options available if I need them.

Regards,

IanT
Nothing's ever Easy - At least the first time around.

Doddy

Nice research Ian!  :D

.FLAC files use a lossless codec to compress audio files, unlike .MP3 files which loose audio data.

In that guise the compact nature of the files would be useful for applications where onboard storage memory is at a premium. The .FLAC format is also very good for audio archiving.

The downside for us, is that for Diesel, Electric and maybe some Steam projects, the use of .FLAC files will increase the usage of the processor chip as the .FLAC files will need to be decoded (unpacked) before they can be played.

For continual streaming and one-shot sounds that should not present a problem, however when you are stitching samples together . . ?

If the onboard processor chip has to fetch and carry .FLAC sound samples, then decode them, there is an inherrent risk that latency maybe introduced in between different sound samples thus leading to a potentially unsatisfactory audio scenario producing gaps in the audio output stream where as close to zero latency is really required.

The MiTroniks sound card I mentioned in earlier postings, has the ability to have the sound files stored on a swappable Micro-SD card, thus allowing a different sound project to be loaded by the user but retain the original hardware.

NB: If an original MiTroniks sound project like a Class 20 locomotive is required to be changed to a Class 66 then you just purchase a new Micro-SD card for £29. (https://www.mtroniks.net/cat/Sound-Systems-For-Scale-Models) Although I am very sure MiTroniks would like you to purchase an entirely new Controller/Sound Unit for £300+

Within the powerup cycle of the MiTroniks sound card the contents of the Micro-SD card are loaded into the processors memory thus minimising the considerable latency issues presented by trying to read files from external memory cards.

For the Diesel Horn, Klaxon and Steam Whistle projects that John and Ralph have described where short,  single-shot audio files are played, I have no doubt that .FLAC configured devices will present no issues.It maybe, that an entire Steam project could be configured this way. Diesels and Electric projects - Nah I am really not convinced on that one.

The next question is to how many internal audio channels are available with such cards and how the relative internal audio streams volumes are adjusted and mixed down together to Stereo or Mono audio outputs?



"You don't know what you don't know"

IanT

Yes, as I understand it the system is streaming data off the SD card directly into the I2S channel - and once set-up there is very little processor overhead. At that level the programming required comprises a few lines. "Stitching" these files together would require a lot more intervention I imagine. Since sound volume is controlled down-stream (in the DAC system) - I wonder if it would be possible to 'mix' several analogue signals to achieve the same result?

I have no idea what is possible with the larger (MZ) chips, as I've never needed the performance but they might support two channels that could be mixed under program control. It is possible to throw a dedicated processor at a problem with MMB - as it supports both Master & Slave I2C modes - which means you can control 'secondary' MMB systems from the main one (an example is given in the manual).

Back to the "Now" - started to look at driving the DRV8871 (H-Bridge) chip from my little (28 pin) MM - and it looks fairly straightforward - hope my confidence isn't misplaced!

Regards,

IanT
Nothing's ever Easy - At least the first time around.

cabbage

I have sneaked out... The time slicing problem is a valid one. Stereo could be produced by sending alternate sound pulses to the two speakers in much the same way FM stereo or CD-4 worked.

A simple "switch case" loop could detect buttons and feed that to the selected speaker. I personally would decompress the FLAC file to save on cpu time and store it as a serial file. Given the fact that 16gB SDs are now sold at the local co-op - file sizes are no longer a problem!!!

The FM stereo timing frequency is 19kHz the CD-4 was over 30kHz. If we stick to a nice number of 20kHz then this gives us a nice mathematical number to work with!

I have to gey back to work...

Regards

Ralph

Doddy

Ralph,

What I should have described to you is a Stereo pair, both Left and Right channels operating as seperate Mono outputs.


All you need is Left channel, Right channel or Left+Right channel. You are entirely correct on the .FLAC unpacking and latency timing issues though.

My plan for the Peak Diesel and other projects, was to use two or maybe three Stereo sound cards and produce a distributed sound system throughout the model.



That way, the Air Compressor and Vacuum exhauster can sound in the relevant nose, Brake Noises and track squeal from the relevant bogie, Air Horns from the relevant driving Cab, and engine sounds centrally in the bodyshell.

Radio Control from the Deltang Rx Receivers trigger Outputs wired to the Soundcards trigger Inputs for user operated Air Horns, Start-up and Shutdown sequences . . . Guards Whistle . . . etc


Of course, all of this is possible on one soundcard with a single speaker like most commerical products.  8) As long as you have multiple internal audio channels and an onboard mixer, otherwise the sampled sounds will play over each other. Yes Ian, you can edit the files to cover two (or more) sounds at the same time, but you loose all flexibility of dynamically changing the audio output - the result sounds terrible.


"You don't know what you don't know"

cabbage

Robert,
From what you have described it looks like you are going to have to build a "truth table" of actions.
Viz:
Loco decellerates, brake sounds = yes.

The table gets boiled down to a set of rules from which the "switch case" loops can be built. The entire thing will have to be a set of loops within loops, each loop operating on one parameter to decide what to do.

I know it sounds complex but it is actually quite simple. The problem is more your end Robert! Two distinct sound channels are easy, how you blend and mix them into a "dual mono" system to produce a sound to your liking I have to leave to you....

Regards

Ralph

Doddy

Quote from: cabbage on Dec 30 2018 11:56
Robert,
From what you have described it looks like you are going to have to build a "truth table" of actions.
Viz:

Loco decellerates, brake sounds = yes.

I know it sounds complex but it is actually quite simple.

Yes, I know I have been doing this for myself and various major toy manufacturers since 2007
"You don't know what you don't know"

Doddy

Found this on Gavin's youtube channel this morning . . .

https://youtu.be/8TOpFqgL4C0

The epitome of G3 in the Garden? It's got to be very close for me.

I just love the colours of the trains and having standard and narrow gauge running together- sublime!  8) 8) 8)

Doddy

PS: Nice garden too!
"You don't know what you don't know"

John Candy

Here is Warton Road, as seen at National Garden Railway Show (Peterborough), last Saturday.

https://www.youtube.com/watch?v=KtmflWnBnNM

Worthy of note is the model of the 100HP Sentinel (in grey primer) which is the first of the "production" models arising from the "Plantagenet" project. The model was being test-run, having recently been completed).

There is an initial batch of four which will soon available for sale (through the G3S) and a second batch is at the planning stage.
My fellow Members, ask not what your Society can do for you, ask what you can do for your Society.

John Branch

Quote from: John Candy on Mar 03 2018 09:23
You'll have to build it with air-operated doors (or at least simulated air operation)!
To be realistic they will have to open and shut several times before the starting signal bell will "ping".......memories of the Northern Line commute from Morden in the 1960's!

John.
Strange as it may seem, I have (after a year or so of frustrating R&D), got the doors to work on my G class (later Q23) District line motor car.  When I have the rest of it together, I'll share how it was done, this will prevent anyone else going down the same series of blind alleys as me!

John Branch