MajorAlvega Posted March 19, 2015 Posted March 19, 2015 Hello. This is about trains but I think it's more appropriate to post it here under Mindstorms theme. My LUG (PLUG, from Portugal) train fellows have been developing their own modular standard (MFL) for our exihibitions. Since it defines a 6-brick height above the table surface there is plenty of space under the tracks to hide motors, gears and gadgets. That idea attracted me so I decided to try MFL. First I rebuilt a motorized track switch I was already using with WeDO and then decided to also try a turntable and then... well, you know :) At this stage, this is my setup: - a Mindstorms EV3 running ev3dev (Debian linux) to control everything - a wi-fi USB dongle (not essential but allows me to use my laptop as a console, much more easier this way) - a bluetooth 4.0 USB dongle to control the SBrick-based trains - an EV3 ultrasonic sensor to sense when the train reaches the middle of the turntable - an EV3 touch sensor to sense each time the turntable completes a 180º turn - two Power Functions lights (with a NXT-9V adapter) to signal the movement of the turntable and the control of the train - one USB RFID reader to sense/identify the trains - one LEGO WeDO to control the two track switches (one Power Functions M motor under each) Each train has: - a SBrick (will try IR later) - a RFID tag The train is brought to the RFID sensor where the EV3 recognizes the train (green lights start blinking) and tries to establish a bluetooth BLE connection to the SBrick (green lights keep ON). Then the EV3 takes control and sends the trains to the turntable, using the ultrasonic sensor to prevent collision against the end of the turntable. When the turntable starts turning, the red lights blink (and a claxon sound plays, but its not used in the video). There is also a touch sensor under the end of the track that senses when the turntable completes each 180º turn. Then the EV3 sends the train back to the starting point, using the RFID sensor to detect the train. The bluetooth connection is dropped and now the train is available for manual control. The EV3 is ready for another train. For a near future I plan to give good use to the track switches (only one is motorized but the second will follow soon). I also want to try a method I saw here at Eurobricks to separate the train engine from the wagons. This way the train engine could drop the wagons, revert direction at the turntable, move along the left path and pick the wagons again. To be honest, the turntable still needs some adjustments - sucess rate is ~1/3, sometimes the train slips when moving in, sometimes when moving out. Quote
dr_spock Posted March 19, 2015 Posted March 19, 2015 I think you might get more interest in this over in the train forum. Quote
MajorAlvega Posted March 20, 2015 Author Posted March 20, 2015 Yes, it looks like so :) If moderators decide to move it, OK for me. But since I don't consider myself a train guy and most of this setup is really Mindstorms-related I thought it should belong here. Quote
PeterF Posted March 20, 2015 Posted March 20, 2015 Great stuff! How reliable is it? I mean does it ever get stuck or derail? Not a trains guy myself, but slowly turned into one by the duplo trains of my son and trying to think of ways to make it more fun for both of us. :-) Quote
MajorAlvega Posted March 20, 2015 Author Posted March 20, 2015 Oh yes, it derails a lot :) (but never stucks, at least until I write this, but Murphy is always watching) Sucess rate is 35- 50% I used a worm gear between the motor and the Technic turntable to reduce backlash but also used wheels with tires to sustain the track... the wheels slip a bit and also let the track go up and down like a fishing rod. The sensor and some backward-and-forward at the end of each half-turn do compensate the slipping part but only half the times (I mean one half turn its almosts always perfect aligned, the other half turn fails a lot). Since I use road baseplates I think that replacing the wheels with boat studs (2654) will reduce some backlash. And adding a gear between the motor and the worm gear will increase precision of the turntable. But I'm pretty sure that I'll need a better sensor, perhaps a second touch sensor or a light barrier instead. Next weeks will tell, now I'm trying a decoupling technic. Not a trains guy myself, but slowly turned into one by the duplo trains of my son and trying to think of ways to make it more fun for both of us Exactly the same with me :D I ordered a used Duplo Train and made it work with a a PF IR (and also an SBrick, but my kids are to young to have a phone) and they got crazy so i started playing with PF motor trains and my wife got crazy, wanted a train in our Nativity Scene. Now all family want to play with «my train» and no one cares for Duplo trains anymore :( Quote
MajorAlvega Posted March 23, 2015 Author Posted March 23, 2015 (edited) Two updates: - a decoupler based on CamelBoy68's Simple Decoupler Mk III (motorized with a PF M motor but not yet automated) - better turntable (one more gear to get more precision and boat studs instead of wheels to reduce backlash - sucess rate doubled and still using just one touch sensor) The decoupler works well but I need to apply full power to the train motor (strong magnets, I'm suprised). As I don't have a sensor to know when the decoupling occurs, the train goes at full speed and will derail at the turn before the turntable, so in the EV3 code I'm sending just a small burst to the SBrick (0.4 seconds at full speed then FLOAT) and it seems to work well. But I still need to include some sensor to check for decoupling sucess/failure. Perhaps a light barrier with the EV3 color sensor. Next will automate the decoupler and the second track switch so the train can pick up the wagon again from the opposite side. Edited March 23, 2015 by MajorAlvega Quote
DrJB Posted March 23, 2015 Posted March 23, 2015 (edited) Very nicely done. How are you managing the alignment and 'continuity' of the tracks where they meet between turntable and fixed segments? I saw a train bridge on the train forums where the OP designed a collapsible bridge, and it seemed tricky to have the tracks come into alignment every time the bridge was lowered/lifted. These real-life challenges make one (us) even more appreciative of the real solutions out there, and replicating them with Lego is not easy feat. Edit: Found the link to the collapsible bridge. http://www.eurobrick...howtopic=106216 Edited March 25, 2015 by DrJB Quote
MajorAlvega Posted March 23, 2015 Author Posted March 23, 2015 I'm Very nicely done. How are you managing the alignment and 'continuity' of the tracks where they meet between turntable and fixed segments? Thanks. I'm not doing anything special... the tracks over the turntable are now slightly higher than the fixed segments but the train tolerates that. I'm also using flexy tracks to position the fixed track close enough to the turntable (there is a small gap but not enough for the train to derail if well aligned). At start I tried using an half of a flexy track at each end of the turntable (because I saw that on Fachmann's Train Turntable and Roundhouse) but gave up, it's easier to use this method. The tricky part is aligning the turntable with the fixed track. I'm using just one touch sensor so precision isn't great so I'm using a 3-step approach: - rotate the turntable (anti-clockwise) at fast speed until it activates the sensor - rotate back at slow speed until it deactivates the sensor - rotate again a fixed bit (anti-clockwise) to align the track This last fixed bit was empirically obtained. It failed a lot when using wheels under the turntable but now with boat studs (and another small gear) it's much better. But not perfect so after I finish the other parts of the system I'll return to the turntable, perhaps will add another touch sensor to increase precision. Quote
MajorAlvega Posted March 25, 2015 Author Posted March 25, 2015 Update:- both track switches automated now (first LEGO WeDo)- decoupler also automated (second LEGO WeDO)- second RFID sensor added to sense when train is leaving whole system (so it can move backwards and pick the wagon from the opposite side)Still needs:- timing adjustments- a way to sense if decoupling occurred or not (1 in 5 it fails) - probably also detecting if train is just an engine or it has at least one wagon attachedThe traintable success rate is now really good (5 in 5 today) but I really think that a better align method is needed for long run demos.I still have 1 output and 2 input ports availables at the EV3 (and one WeDo port and whatever USB ports I want) so suggestions are welcome. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.