Тёмный

Using an Arduino for Model Railroad Speed Matching 

DIY and Digital Railroad
Подписаться 63 тыс.
Просмотров 12 тыс.
50% 1

Хобби

Опубликовано:

 

11 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 61   
@gravesclay
@gravesclay Год назад
Hi Jimmy! Great Video! One minor tweak / upgrade for a later version. If you tape the sensors to a ruler (fixed distance every time), you can throw a tiny bit of math on the Arduino and output the speed the loco is traveling in scale MPH!
@ptolbert
@ptolbert Год назад
Great idea!
@robbhalverson7725
@robbhalverson7725 Год назад
I would really like to see that done I think it would impress our friends more Seen a scale speed instead of random millisecond times
@robertmyers5269
@robertmyers5269 Год назад
@@robbhalverson7725 Hold on, I ought to be able to publish a sketch shortly.
@dspencer43
@dspencer43 Год назад
@@robertmyers5269 Hey Rob were you able to come up with something to show MPH?
@dspencer43
@dspencer43 Год назад
@robertmyers5269 thanks for the reply. Not sure why I cant find it here but your sketch worked great.
@MrZantius
@MrZantius Год назад
Hi Jimmy Just finished watching all your vids 3yrs of them IT TOOK ME DAYS good job I’m retired, I've learened so much Thankyou, Rog from Wales in the UK
@rwissbaum9849
@rwissbaum9849 Год назад
Fantastic video, Jimmy. If I had seen this a couple years ago, I wouldn't have had to buy my scale speedometer. Grr... (Needless to say, I LOVE gravesclay's suggestion...) One suggestion (which will fix two minor issues): at the end of countdone, if you set countState back to ST_OFF, that will report the elapsed time ONCE, then return the Arduino to its original state (waiting for the first IR sensor). This eliminates the annoying flicker you mentioned (allowing you to remove the delay() statement), and it frees you from having to reset the Arduino to be ready for a second speed check.
@jimhyslop
@jimhyslop Год назад
This suggestion would also allow you to take readings over several runs, and average them.
@benbedothu
@benbedothu Год назад
This is a great tool and it's greatly customizable. My DCC system works in a way that you don't have to do speedmatching, it requires you to measure the time it takes to travel a given distance on a few different speedsteps and then just enter them in a table for each locomotive. Once you're done you can match any of your locomotives together they are going to be automatically moving with the same speed!
@holimanrobert
@holimanrobert Год назад
This is great! Thanks for taking the time to make the video! I've been trying to figure out how to speed match my various locos and this is the answer!
@tonyl7418
@tonyl7418 Год назад
Jimmy, I built this circuit, works a charm..however I wanted to put this on a bones PCB (bare bones Arduino, v2 by Chris Rye 2013, available from Oshpark) but has no reset. So, I used a reset function. At the very beginning of the sketch put in void(* resetFunc) (void) = 0; and at the end after delay (10000); put in resetFunc(); Works great. Sketch resets after 10 seconds. Enough time to record results.
@donmartin9567
@donmartin9567 Год назад
I also do a lot of speed matching, for my locos and for other folks. I have a "test track" and I've done a permanent install of "speedometers" on my test layout. I use photoresistors rather than IR sensors as they are smaller and easier (at least for me) to imbed in the track. For speed matching I have two separate loops and each loop has two speedometers on it (yes, that is way overkill but was fun doing). I did find that the speed of the locos changes by a few scale mph between two speedometers on the same loop - due to not level track or where the speedometer is in relationship to the corner. Plus, I have both an LED to show "speed" and then a 5 line LCD where I show the previous speeds. I also spent a lot of time programming so that I can capture speed even if the engines are only about 6 inches apart and regardless of which direction they are going. Also, by sampling light levels during start up, the sensors work well in both bright light and low light situations. I found that the IR sensors were sometimes a bit faulty when getting direct light from the newer LED light bulbs. Anyway, this lets me set up my locos so that they all have the same top end end speed, mid speed and 20% speed. BUT, to finalize they speed, I put the two locos on (I use advanced consisting) and run them and using "Programming on the main" (POM), I do fine tune them as they chase each other around with the one that runs "slightly slower" in the rear.
@gunfighterzero
@gunfighterzero Год назад
Thats really cool, I could see building that into a programming track permanently
@bobainsworth5057
@bobainsworth5057 Год назад
You need a portable test track. It comes in handy for many things you want to do away from layout. It should have the ability to be extended for speed testing.
@bernardc2553
@bernardc2553 Год назад
Jimmy this is SOoo kool sure Admire you R-Dino Knowledge, sure looking forward to this next segment, applying & Matching .
@tonyvink961
@tonyvink961 Год назад
Hi Jimmy, If you don't mind one more suggestion, it would be really cool if when you run the second engine through the unit would calculate an adder for each of the three CVS to make it's speed match. For example if the 2nd engine were too fast, tell the user to subtract "X" from the CV. The user would have to run the engines thru three times, once slow, once mid pace, and once at a fast pace. Then the user would adjust the start voltage, mid voltage, or max speed. Just a thought. I was drinking "Bad Ass Coffee of Hawaii, Breakfast blend. And keeping with my theme I was using my "Big Ass Fans" coffee mug. (A promotional mug from the Big ass Fan Co ) Tony
@DIYDigitalRailroad
@DIYDigitalRailroad Год назад
This is a really good idea! I will have to work on it!
@jimhyslop
@jimhyslop Год назад
@@DIYDigitalRailroad of course, if you add in the Arduino DCC library, you can then write the program that will do everything: prompt for the address of loco 1, prompt for the address of loco 2, run each loco past the sensors multiple times at various speeds, take the average of each loco's speeds, calculate the CVs and upload them to the locos.
@danzo5521
@danzo5521 Год назад
Thanks Jimmy! Gonna save this so I can watch it later when I run some consists
@jimrice8167
@jimrice8167 Год назад
Great video Jimmy, I’ve just ordered the lcd screen, I have all the other pieces. I’m hoping this will work with the nano!
@acrranscaleandlifejourney4330
That’s awesome Jimmy. Thanks for sharing.
@kennethoriel7463
@kennethoriel7463 Год назад
Very nice Video, I plan on putting into practice as I have many locos to speed match! One thing that would be very helpful is to mount the sensors to something that will maintain the distance (like @gravesclay says below), since any movement of the sensors between locos will throw it all off.
@melkitson
@melkitson Год назад
You are such a versatile person and always come up with some great ideas.
@HumancityJunction
@HumancityJunction Год назад
Is there a way to connect this to JMRI to automatically adjust the speedtables?
@paparoysworkshop
@paparoysworkshop Год назад
This same setup could be configured to make a scale speed indicator. Change the math a bit and the time it takes to pass both sensors would indicate scale speed in MPH or KPH. Nice video.
@BriansModelTrains
@BriansModelTrains Год назад
Brilliant video. I love your ideas and implementation of various projects.
@kimberleemodel7182
@kimberleemodel7182 Год назад
Suggestion for your code. Rather than using delay to avoid flickering, how about going back to ST_OFF. It won't be update the display, and you'll get new readings without clicking the reset.
@michaelwalpow5261
@michaelwalpow5261 Год назад
Really enjoyed this one! Great Video
@n-scaleunionpacificevansto6569
Jimmy, how do you know where to plug the wires into the breadboard? All I see is a bunch of unmarked holes in the breadboard. ...Roy
@rwissbaum9849
@rwissbaum9849 Год назад
The breadboard is divided into four sections: left to right, they are (1) two columns of + and GND. All holes in these two columns are connected to each other (but not to the other column), giving you a positive bus and a ground bus. (2) A field of holes which is five rows wide and thirty rows tall. Each of the five holes in the thirty rows are connected to the other holes in that row, but no other. (3) A second field of 5x30 connected in the same fashion. And (4) a second set of two columns for positive and ground buses. So hole a1 connects to holes b1, c1, d1 and e1, but no others. a1 does not connect (for example) to hole f1 or to hole a2. Once you understand this, it is easy to connect pin D3 on the Arduino to, say, hole a1. Then, you can connect any device you want to pin D3 by running a wire from that device to hole b1 (or c1 or d1 or e1).
@donaldkormos5529
@donaldkormos5529 Год назад
Nice project ... good explanation of millis() function.
@BillMastersMRR
@BillMastersMRR 6 месяцев назад
With a little more calculation one could use this setup to display loco speen in MPH just to use as a speedometer.
@jimbarrett1975
@jimbarrett1975 Год назад
Jimmy, this looks great. I've never used Arduino and only know about it through your channel. Using your parts list and instructions would this be suitable as a beginner project? I know less than nothing about code, and barely any more about electronics. Thanks for all your hard work!
@jimhyslop
@jimhyslop Год назад
I'm not Jimmy from @DIY and DIgital Railroad, but I think this would be an excellent beginner project if you're the kind of person who likes to just dive right into things. If you want a more gentle introduction, you can buy the Arduino Starter Kit which contains a variety of electronic components and other parts (including a breadboard and hookup wires), and several tutorial projects to get you familiar with the basics of the Arduino and the basics of the electronic components it uses. After you've gone through some of the tutorials, you'll find that building Jimmy's project will be a breeze. Either way, you are almost certainly going to have questions about compiling and uploading the program, and there are lots of very helpful Arduino forums out there to turn to. Be warned, though, that once you start with an Arduino you will find it very addictive!🤣
@jimbarrett1975
@jimbarrett1975 Год назад
@@jimhyslop that's brilliant, thank you for the advice. I'll look into a starter set as it looks like there are a lot of other potential projects. It's amazing where this hobby takes you sometimes. Thanks again, Jim
@gregorydraghici8955
@gregorydraghici8955 Год назад
Thanks, Jimmy for this tutorial! I needed this as I needed to figure out how to speed match my locomotives and I am planning on using an Arduino to build a speedometer. Is there a way to connect the Arduino to JMRI to automate the speed matching? I am planning on building a separate test track just for this purpose.
@stuartaaron613
@stuartaaron613 Год назад
Jimmy, basically what you've done is build a speedometer with an Arduino. Another way to do this is to buy a speedometer system, such as the Accutrak II, or Train Control Systems. The nice thing about these is that they are already calibrated in scale miles per hour.
@rwissbaum9849
@rwissbaum9849 Год назад
You are exactly correct. I own an Accutrak II; they are currently retailing for about $70. The Arduino plus LCD screen plus IR sensors total about $38 (you don't need a breadboard if you're willing to do a little soldering) and you'll have 8 IR detectors left over. Add a $1 wooden ruler to mount the IR sensors (see gravesclay's coment) and you can report both milliseconds and scale speed.
@stuartaaron613
@stuartaaron613 Год назад
@@rwissbaum9849 Exactly. The biggest advantage to Jimmy's video is the cost.
@Christiane069
@Christiane069 Год назад
Thank you for this tutorial. Very helpful.
@greeneyedggirl
@greeneyedggirl Год назад
Excellent! Thank you so much!
@rizalardiansyah4486
@rizalardiansyah4486 Год назад
Does it works for all speed once the loco is calibrated? Or do i have to do this for multiple speed setting? And this is only for DCC systems, right?
@robertmyers5269
@robertmyers5269 Год назад
I've done a Raspberry Pi based speedometer. Great for public shows, but rather expensive -- Pi 2, 7" screen. Seeing this I felt that I could use this as a basis for a smaller cheaper speedo. However one question/observation; the sensor you are using is digital not analog. Testing, I saw that it swings between an analog value of ~20 (low) and ~1020 (high). I tested it a digital and it works fine registering high to low transitions. Why set it as analog?
@guifre6162
@guifre6162 Год назад
Très bonne idée !
@mikeseba7817
@mikeseba7817 Год назад
One big LIKE!
@kenshores9900
@kenshores9900 Год назад
The code reminds me of old machine code used on Wang computers.
@charlesmcclure5994
@charlesmcclure5994 Год назад
You know Jimmy I think I'll just stick with one locomotive and short trains I really don't think my Chromebook could handle that
@gwennie-dk9rl
@gwennie-dk9rl Год назад
Good job. Great video. But don't you need a power supply?
@DIYDigitalRailroad
@DIYDigitalRailroad Год назад
Yes you do!
@joelbutler7501
@joelbutler7501 Год назад
9V battery would work'
@gwennie-dk9rl
@gwennie-dk9rl Год назад
@@joelbutler7501 Thanks, from an Arduino no-nothing!
@andrewlaverghetta715
@andrewlaverghetta715 Год назад
As my eyes glaze over… (I definitely have no idea what any of this means) “I’m not an expert coder…” he says.
@ronaldrondeau7870
@ronaldrondeau7870 Год назад
Very intersecting but not for me Im not a programmer
@cllines604
@cllines604 Год назад
wow to fast for me
@tonyl7418
@tonyl7418 Год назад
Chat GPT
Далее
Hurricane Milton Extreme Surge Wind Slams Sarasota, FL
03:59
Secrets to Speed Matching Locomotives
14:11
Просмотров 17 тыс.
Hill construction and ground cover
3:28
Просмотров 14 тыс.
Cheap and Amazing!  DCC-EX 2 Years Later
10:46
Просмотров 25 тыс.
Hacking a weird TV censoring device
20:59
Просмотров 3,1 млн
Собака нырнула в болото🤪
1:01
30 сентября 2024 г.
0:29
Просмотров 5 млн
Идеальные 😍 инст britanka_new)
0:25
Просмотров 4,7 млн