Welcome to MattzoBricks Forums MattzoTrainController for Power Functions (MTC4PF) RC train base #7987 Passenger Train and #7898 Cargo Train

Viewing 1 reply thread
  • Author
    • #5813
      Martin HuckeMartin Hucke

      Back in 2005 Lego has released the beautiful #7987 Passenger Train and #7898 Cargo Train sets. These were using a new rc train base with infrared receivers. The good news is, that you might be successfull in integrating them into the Mattzo-Project with very limited effort, by using an MTC4PF infrared controller. Bad news is, that there is no guarantee that you are successfull. The success depends on the firmware version that is on the rc train base (Lego part number 55455c01). There are at least two different firmware versions and the older ones ist not supporting it. I haven’t found any external indication to say wether it will work or not. Only when I was opening it and checking the board, I’ve learned that at least the ones from 2005 are not supporting the required commandset. So my recommendation is: Test it and see if it works.

      What do you need to do ?
      As the support is not guaranteed and the rc train base was only an intermediate step towards power functions, the base is quite limited. Thus is does not make sense to add it as another MotorShieldType to the MTC4PF sources.
      But it is quite easy: You just need to edit a number of lines in the file <MattzoPowerFunctions.h> that you’ll find in ./src/mlc_lib/MattzoPowerFunctions:

      Replace these lines:
      // By spec CHECKSUM is a XOR based on the 4-bit triplet you are sending
      #define PF_CHECKSUM() (0xf ^ _nib1 ^ _nib2 ^ _nib3)

      #define PF_START_STOP PF_IR_CYCLES(39)
      #define PF_HIGH_PAUSE PF_IR_CYCLES(21)
      #define PF_LOW_PAUSE PF_IR_CYCLES(10)

      #define PF_MAX_MESSAGE_LENGTH PF_IR_CYCLES(522) // 2 * 45 + 16 * 27

      And use these lines instead:
      // By spec CHECKSUM is a XOR based on the 4-bit triplet you are sending
      #define PF_CHECKSUM() (0xf ^ ((_nib1 + _nib2 + _nib3) % 0x10))

      #define PF_START_STOP PF_IR_CYCLES(74)
      #define PF_HIGH_PAUSE PF_IR_CYCLES(35)
      #define PF_LOW_PAUSE PF_IR_CYCLES(15)

      #define PF_MAX_MESSAGE_LENGTH PF_IR_CYCLES(724) // 2 * 74 + 16 * 36

      Configure it like a one motor (A) configuration on an 8884, compile and deploy it to an ESP. Than you will see if you have a working configuration. The rc train base has two infrared receivers (one on the left, one on the right) on the crossed notches in the middle (next to the powerswitch). If the red LED indication is starts blinking periodically (every second) that your board supports the functions and you can use it in Rocrail!

      For the rc train bases that, I have that are not supporting it, I found a solution to build a solution with an ESP and a L9110. So I can switc to control the train with the original infrared controller or a Mattzo integration of the train into Rocrail. In any case the solution uses the onboard battery pack of the train base.

      Good luck !

    • #5814
      Matthias RunteMatthias Runte

      Thank you for the extension of our technology, Martin.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.