Jump to content
 

Ray H

RMweb Premium
  • Posts

    4,283
  • Joined

  • Last visited

Everything posted by Ray H

  1. More Arduino fun (?) today. I was having difficulty with the lasers that I'm using to detect the approach to and departure from the diamond crossing behind the traverser. In the end I wrote a small (Arduino) sketch to do what I wanted the lasers to do and gradually refined it as I realised I had overlooked elements of the process. With said sketch (i.e. program) working as I wished I decided to incorporate it into the sketch that works the levers, switches, servos, points and signals only for things not to turn out the way I thought they should. Its OK when all the sketch has to do is check the use of the lasers but its a different story when the sketch has to check for lever movements in between checking for use of the lasers. The replacement 5v relay shields arrived today so I'll be ready to swap one for the 24v version that I erroneously previously installed on the upper level if only I can sort out the laser problem tomorrow.
  2. The problem with the serial monitor looks to have been the result of some of my dodgy coding with the sketch going into a loop awaiting for something to happen although I still haven't worked out why adding command to output something cleared it. The low level points and relays are now generally responding as they should - I still need to address a problem with the frog polarity switching on the diamond crossing. It is a good job that the upper level baseboard is currently off the layout because I found a defect in the track between the diamond crossing and the new pointwork. The diamond crossing was raised by a couple of centimetres in order to ease the grade at the bottom of the incline up to the upper level baseboard. The consequent drop back down to base level for the continuous run section wasn't a problem previously because it was just plain and largely straight track for about four feet. The new pointwork is a lot closer to the diamond crossing so the grade down to (or up from) the first of the new points is a tad steeper than it was so 0-6-0Ts leaving the diamond found the track disappearing beneath the leading axle and as the link track is curved the locos were derailing. I think that I've sorted that now but I will run a few trains around the continuous run tomorrow to make sure before I put the upper baseboard back.
  3. Ray H

    Little Muddle

    Could you fold adhesive labels to avoid the glue ridge Kevin?
  4. Things are progressing although at times it feels a bit like two steps forward and one back. The lower three points/servos now respond to their levers but I still have to get their frog polarity switching relays to switch appropriately. The afternoon ended with me trying to get the Arduino to recognise the laser's state - whether they were detecting a train or not. This is because the lasers are connected directly to the Arduino and not through another circuit/PCB. The easiest way to check the lasers was to use the serial monitor to display what the Arduino was detecting on the screen. Unfortunately, the serial monitor didn't want to play ball reliably for some reason. Guess what I'll be searching for tomorrow?
  5. Perhaps next time you should limit yourself to just 70 star jumps 😃
  6. Ray H

    Little Muddle

    Is that bar the only thing that moves on LM, at least until Kevin builds the windmill and fits a dcc decoder into it?
  7. Glad you sorted it Rod. I can't remember if your layout is a dc or dcc layout. You may need to uprate the decoder if you restore the second motor if it is dcc.
  8. It was time to put everything back together - or so I thought 😒 The Arduino, the PCA9685 (for the three servos) plus the 8 relay shield (for the frog polarity switching instead of the juicers) are all on the lower lever with a separate 8 relay shield and the original PCA9685 (for the previously existing servos) on the upper level. The wires from the lever frame are corrected direct to the Arduino with the said frame on its own support midway between the two levels. I needed to find the best/simplest way to drive the relay shields and found another PCB (PCF8574) that could be used to link the shields to the Arduino via I2C bus through the PCA9685s. It was time to check various things out with the baseboards back in place. First, there was a mysterious short circuit that I managed to trace to somewhere on the low level board but I had to remove the middle of the three upper level boards to track it down - a PCB sleeper on the new pointwork that hadn't had the copper track cut. Back to the bench and some Arduino base experimentation with the PCF8574s. These boards effectively provide some extra pins for the Arduino, needing just four wires to link PCB and Arduino. That may not seem much of a gain, but up to seven PCF8574s can be connected in serial thereby creating up to 56 extra pins. I managed to get a couple of LEDs doing what I wanted them to on the bench and even managed to get a relay energising/de-energising. There was no such luck when I connected the same ancillary wiring to the layout mounted Arduino. A bit more "trying this, trying that" didn't seem to do anything meaningful so I gave up for the day. I wonder what tomorrow will bring?
  9. I believe Gaugemaster had a delivery of some spares relatively recently so they might be worth a punt as well.
  10. Presumably, as a Heljan loco, it had two motors initially. Can you not swap the relevant gear axle with the one from the other end or have you already tried that?
  11. Some Zimo decoders use F27 & F28 to adjust volume up and down. Might it be possible that this decoder has had the sound turned down to zero or turned up too high that it damaged the decoder as happened to one of our club members.
  12. Ray H

    Little Muddle

    As a kid I did a milk round circa 1960s. We had red - homogenised - and blue - TB tested - as well as silver top. I vaguely remember green top but can't recall what it was. There was also special milk for customers of at least one religion.
  13. Catch points are usually (always?) sprung. Their purpose is to divert runaways off the running line which, in the correct direction of travel, is on an uphill gradient. The runaways could occur when a coupling broke somewhere in the train or if the loco was unable to keep climbing the gradient and slipped to a standstill and started to slide back down the hill.
  14. Towel rail successfully fitted 🙂 I'd forgotten that I'd taken the picture below a few days ago to demonstrate the narrowness of the gap between the two tracks where the laser transmitter needs to go - the hole in the cork layer was cut to provide a secure base for any mount needed to lift the laser transmitter up. The frogs on the diamond crossing will be polarised in favour of the BR track when the relays are de-energised. This will avoid the need to energise said relays if I'm using the continuous run facility provided on the BR track. The laser will thus only need to detect any train on the Light Railway track. The above is very much a worst case scenario because I now have some 4-wheeled coaches for the Light Railway so the railcars shouldn't shouldn't need to visit the LR again. That is unless someone organises a rail tour! The wiring of the upper level was completed yesterday (or was it?). I need to cut and re-join a couple of the servo extension leads where they bridge the gap between the two long baseboards out of picture and to the right in the following image. This will facilitate board separation if/when required. I've yet to update the Arduino's sketch (a.k.a. program) to reflect the introduction of the three points on the lower level, the use of the laser detectors and, finally, the use of relays for frog polarity switching to complete the changes on this side of the layout. It is just possible to see the edge of one of the upper level's point operating servos in the extreme bottom left corner of the above image. There are six more of these in a similar position relative to the edge of the two long baseboards. These will require a removable covering from a scenery point of view. That's why I wasn't too concerned about adding the above electronics on top of the baseboard. However, seeing it all in place and noting the height of some of the wires I'm beginning to have second thoughts. The platform structure could be narrowed - I have already thought that it may be too wide (and possibly unnecessarily long as well). Reducing one or both could allow me to move the electronics away from the baseboard edge. Having done that I could then cut sufficient of the top surface of the baseboard away - a bit like I've done for the lever frame - for the electronics to be lowered by around 20mm leaving the top of the wiring at around the same height as the top of the servos (I think). Whilst the lever frame is self supporting and requiring the layout to be lowered over the lever tops, the other long board has the two signal servos protruding slightly below the outside face of the lower baseboard skin. I could possibly cut any new hole through both plywood skins of the above board and fix another piece of ply to the outside face of the lower skin thus providing an even lower mounting surface for the electronics. Decision, decisions.
  15. I wonder if having three speakers might be the problem as the wrong impedance mix could cause problems.
  16. The final upper board was released once I found the single screw holding it in place and had cut and secured the consequent loose ends of the one remaining uncut track leaving/joining the board. There's a gap of no more than about ½ inch between the two (tightly) curved tracks approaching the now uncovered end of the diamond crossing. Several tests with mock-up arrangements for the receiver - the transmitters/lasers are arranged to point towards the garage wall for safety reasons - revealed that the conventional arrangement of a beam parallel to the baseboard surface was asking for trouble especially if/when a inevitable derailment occurs in the immediate vicinity. In the end I mounted the receiving LED just above the baseboard surface angled upwards in the "6ft" and the laser aimed downwards from about 65mm on the inside of the curve. In the true sense of the word(s) "its a bit of a lash up". We'll have to see how long it lasts. At least I can remove the upper baseboard more easily now should I need to reconfigure things. By the end of yesterday I'd completed the low level wiring and had the longer two upper level boards temporarily back in place - there's a hope that the backscenes might be added over the weekend. This should be easier with the upper level baseboards temporarily removed again. The upper level frog polarity relays were also in place and wired up. This just left the upper level servo leads to be connected to the PCA9685 on the lower level and the (upper level) I2C PCB connected to both the upper level relay board and the lower level's I2C circuitry. And then I started thinking . . . . I currently need to have two 5v supply wires and the four I2C wires running between the two levels as well as the nine servo leads from the upper level board. I could cut the number of servo leads down if I moved most of the electronics from the lower to the upper level as there's only three servos on the lower level. Mind you, I'd then need to add a pair of 12v supply wires to the mix. On the other hand, having a second PCA9685 board - the board that the servos plug into - on the upper level would only require the two 5v wires plus the four I2C bus wires between the two levels, all of which can have plug/socket connectors in-line making removal of the upper level a simple matter of disconnecting said plugs & sockets at the expense of accommodating the second PCA9685 board on the upper level. That's today's plan (although domestic management want me fit a towel rail above the radiator in the downstairs cloakroom [and I hate drilling holes in "solid" walls as the drill always wanders]).
  17. Is there a loose wire that should go to the speaker? Can you test the decoder in another vehicle and/or with a different speaker?
  18. The low level's wiring is largely complete save for finding somewhere suitable to position the laser circuitry to detect trains approaching and leaving the diamond crossing behind the traverser in order to switch the crossing's frog polarity. The laser that is at this end of the crossing is in situ as there's enough space between tracks for the "transmitter" - i.e. the laser itself. The receiver is located between the track and the garage wall at top right in the first of the two images above. The laser transmitter & receiver are situated diagonally opposite each other so that the gap between vehicles isn't detected. This will allow me to code the initial appearance of a "train" as the moment to energise the relays that switch the polarity and also detect once the rear of the "train" has passed the other detector to de-energise the relays. I need to remove the still in situ upper baseboard in order to locate the most practical position for the other detector circuit and, once in place, everything can go back together again and I can run some trains to try everything out (once I've worked out the best routing for the upper level's servo cables down to the lower level PCA9685 PCB). I still got to replace the juicers with another Arduino on the other side of the layout but that's all on one level so shouldn't take so long (I hope).
  19. Here's the new track arrangement. Basically, the track access to the two sidings at bottom right in the picture has moved from top right (which leads to the traverser) to the BR track from the diamond crossing (top left) effectively making what was a combined set of hidden sidings into two separate locations with totally independent access. This adds yet another element to the shunting puzzle given that moving vehicles between the two locations by hand is possible (as is doing a lap of the layout with a loco as haulage). Here's a close up of the electronics which will control the area and are just visible towards the top right in the upper picture. There is an 8 relay shield across the top of the lower picture. This takes care of frog polarity switching - the existing frog juicers don't seem to have settled too well on this layout so are being phased out. Just below the relays is a PCF8574 PCB. The pins (on yellow bases) across the top of this PCB link to a similar range of pins (on black bases) on the adjacent edge of the relay shield. From left to right at the bottom of the image is the Arduino UNO which is the brains behind the operation. To its right is a small so called buck converter that drops the layout's 12v dc supply down to around 9 volts which the Arduino is reputedly a little happier about. Finally, at bottom right is a PCA9685 PCB. This one will be used to provide a connection to and between the servos on both upper & lower levels on this side of the layout. The PCA9685 connects to the UNO using 4 wire I2C which is also how the PCF8574 is connected. The levers that can just be seen in the distance at the extreme top right and the two switches for the low level points have been wired into the above (and the various devices connected to each other) since the pictures were taken, leaving just the frog switching wiring to be added to the relay shield. I can then test out the new pointwork !
  20. Could you have inadvertently put the decoder plug in the wrong way round?
  21. I've managed to separate two of the upper boards that need to be removed to allow me access to the lower level. I've printed of the Templot plan of the area and stuck same together and am glad to see that everything seems to fit. It took a bit longer than I had expected because there were a couple of securing screws buried under the cork sheet which, luckily, is only held in place by the track pins holding the track down. However, I had to spend time hunting for those screws as there were no marks on the cork 😗 The lever frame has also been recovered as has the Arduino and its associated peripherals. These will go back on the layout although I do want to improve access to them for the future. I've printed a second lot of the relevant Templot sheets which I'll use for building the pointwork. I have plenty of (PCB) sleepering but I'm slightly concerned that I may not have enough rail. I don't think I can re-use the three points currently in use so I may have to strip them down to top up the rail supply.
  22. I was originally just going to remove two of the upper level boards to enable me to make the above mentioned track alterations. However, making the most of the opportunity, I'm going to look at putting some form of train presence/detection in the diamond crossing area behind the traverser. Currently the layout relies of operators talking to each other to prevent "accidents". I'll need to remove all three upper boards (instead of just two if I go ahead with this). I'm also minded to reposition the upper level's Arduino and associated technology. It is currently all crammed into a tight space and mounted on the far side of the vertical support visible top right in the image in my previous post. This makes changes to anything associated therewith messy. For example, it will all need to be dismantled to remove the upper board to make the planned track changes. I'll need to operate the three new points on the lower level so I'm thinking of removing the MERG Servo4 and using the Arduino above instead. This gives me the option to replace the frog juicers with relays operated through the Arduino if I choose to go that way.
  23. Here's an idea of what I mean. The point on the right will become plain line (passing under the ruler). The ruler shows the proposed alignment of the track to create what in effect becomes an outside single slip. The Derby Lightweight Railcar is on the inside most traverser track in the distance. The following might also give an idea of what's planned. Rotating the plan clockwise by about 110º might further help.
×
×
  • Create New...