Jump to content
 

dpbagley

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by dpbagley

  1. I was planning on putting the speed calculation in the loco and not in the controller since this minimises the amount of data which needs sending over the radio link to the loco. All that needs sending is the few parameters needed to calculate the required speed (throttle, brake and load) and once received by the loco, no further communication is needed until required. There is plenty of processing time to perform the actual speed calculations in the loco. Also, it's best to keep the volume of radio traffic to a minimum, as this is reduces the chances of data errors over the air, and it allows the same radio frequency to be shared by other locos and/or controllers. Radio interference caused by the proximity of the radio receiver to the motor may be a problem, which is one of the things I am keeping in mind. There is an "emergency stop" which will stop all locos immediately and (hopefully) reduce the risks of crashing! The Deltang system looks interesting, but there seems to be no facility to trickle charge the onboard batteries from the track, nor is there any speed control by using feedback from a sensor on the motor (or even back emf). D.
  2. At the moment, the prototype loco does go at the speed demanded, but the eventual idea is to "drive" the train in as realistic a way as possible where the speed of the motor is calculated by the onboard controller using various feedback factors, including throttle, brake, wind resistance and load. This will always be an approximation as it won't be possible for the loco to know every factor to use in its calculation, eg the gradient or curvature of the line, but it will be much more realistic than just turning a knob. In my workshop, I have a simple loop of track which is 7.5m in circumference. On the slowest speed setting, the modified class 47 loco took 8 minutes to go around, a scale speed of about 2.6mph, ie walking pace! If the software is altered to go slower than this, then it is a bit jumpy as there are rather too few pulses from the optical detector on the motor to count. I have now started modifying a Lima class 66 and will post some pictures in due course. David
  3. The PCB I have made does have a expansion port which could be used, but I don't know enough about how sound modules are powered and controlled to say for sure whether it would work or not. David
  4. Hello all and thanks for the comments. I will try to answer the questions. - The batteries are 2 x 7.2V NimH by Varta. I have avoided LiPos because of the difficulties in charging them. This application requires the battery to be trickle charged, not fully cycled which I understand Lipos prefer. Super capacitors may be a future alternative to batteries. - The PCB is of my own work, and yes I do this kind of thing for a living as well. I am not from a r/c modelling background, but I could see that whilst it was possible to buy r/c planes, gliders, helicopters, boats, cars, etc, it was not possible to buy r/c trains, so I started looking (as an electronics engineer) into what could be done. - The 4 diodes were used as I didn't have a bridge rectifier to hand. - The PIC is programmed in C. - I may well be in a position to publish the circuit diagrams in due course, but at the moment, there are still changes which need to be done and bugs to iron out. In any case, most of the work is done in software! The PIC is a PIC18F4620, the motor drive IC is a BD6221 and the RF module is a RFM70. Apart from the LED driver, there's not much more on the PCB anyway. - Obtaining the motor speed is simply a matter of counting pulses from the optical detector over time. The light beam shines through the motor past the armature windings which interrupt the beam as it turns. The motor is not open frame - I simply made a couple of holes in the plastic, one in each side! The alignment is not all that critical, but it does need to be fairly dark inside the loco body. I've not looked at any other kind of motor yet, and there may be difficulties in using this optical technique with other types. It is possible to obtain motors with encoders built in, but this will require some major changes to the drive mechanism. I was just trying to keep it simple. At this stage it is just a "proof of concept" design, for my own interest. The prototype is currently at a stage where it does work. I will need to spend more of my limited spare time in testing it, and solving any problems that are found. The next major step is to develop the controller software on a Raspberry Pi. There will also be some work needed on the radio protocol so that more than one loco can share the same controller, avoiding collisions - not of trains but of radio messages! I think that this is a step in the right direction, and time will tell if it is a viable solution for the manufacturers to take on. David
  5. I've only today come across this forum, so apologies if I am repeating what others have already done or said. I have only returned to the hobby in the last couple of years, so things like DCC are new to me. I do remember Hornby's Zero 1 coming out! I've been experimenting with battery powered/radio control over the last few months and have recently got a prototype running in a OO Lima class 47 bought from ebay. My system has a controller PCB of my own design with a a PIC micro, a miniature 2.4GHz radio tranceiver module, some LED outputs for head/tail lights, and a H-bridge motor IC driven by a PWM output from the PIC to drive the motor. An on-board battery overcomes any problems with intermittent track power. The steel weight has been replaced with a few strips of lead as this takes up less space. Rather than using a back emf technique, the motor speed is measured digitally. The motor has been modified so that a LED shines through the armature and a phototransistor produces a signal which is modulated by the rotation of the motor. This pulse train is fed back to the PIC which measures the motor speed and adjusts the PWM drive according to the speed demanded over the radio link. THEREFORE, the loco goes (within the limits of the motor power) at the speed you demand, whatever the load behind it or the gradient or curve of the track. This allows for a high degree of control even at slow speeds. In theory, the battery is large enough to run the loco on its own for the best part of an hour, and it is trickle charged from the track, when available. Power is sent via a DCDC converter to the motor via the controller PCB. The reason for the DCDC converter is that the track voltage is higher than the battery voltage so that the battery can be charged. Without the DCDC converter, any sudden changes between the battery/track voltage on the motor as the wheels turn will cause the loco to judder as the PIC adjusts the PWM drive to achieve the demanded speed. The DCDC converter is very quick to correct for changes to its input voltage, so it provides a stable output voltage for the motor. Aditionally, Since it has a wide input range, it allows the battery to discharge right down to a voltage where without it, the motor would probably stall, extending the operating time in the absence of track power. Commands are currently sent via another radio module from a PC to set direction, speed, which end the driver is sitting (ie define which is forwards and backwards), and day/night headlight and tail light controls. Since the radio module is bidirectional, the loco can also report data back to the PC, eg battery level ie "fuel", or even "amps" as on a real diesel electric loco to show how hard it is working. As you can imagine, the electronics and batteries take up quite a bit of room, so while it fits (just) inside OO gauge diesel locos, it is probably not suitable for shunters or OO steam locos. It is still very much work-in-progress, when my very limited spare time permits. There is still lots to do, and while the system works OK with my Lima "Duff", I do need to see if it still fits in other classes of locos with similar motors. There may be more design work to get it to work in locos from other manufacturers which may not allow the same optical technique for measuring the motor speed, or where space is more limited. I also want to use a Rasbperry Pi instead of a PC to control everything, including points and signals, making it possible in theory to handle everything on a layout with just two wires (eg the rails). Any feedback would be appreciated! David.
×
×
  • Create New...