Welcome to MattzoBricks Forums MattzoTrainController for Bluetooth (MTC4BT) Two motors. Forwards and Backwards

Viewing 2 reply threads
  • Author
    Posts
    • #6305
      Liam MolloyLiam Molloy
      Participant

      Hi. Thank you / Dankeschön for this wonderful piece of software. I can tell that many hours of blood, sweat and tears has gone into making this.

      My son and I are in the process of automating our locos using the MTC4BT and are running into trouble attempting to run a loco with 2 motors on channel A and B of a Lego powered up hub. Both motors are working but they turn in opposite directions. We need them to turn in the same direction as we are using two motors to pull a heavy train. We have tried experimenting by changing the “direction” attribute to combinations of “forward” and “backward” but this does not appear to have any impact and the motors continue to spin in opposite directions.

      MattzoTrainController for Bluetooth (MTC4BT)

      Are we doing something wrong?

      {
      “address”: 4,
      “name”: “10194”,
      “bleHubs”: [
      {
      “type”: “PU”,
      “address”: “90:84:2B:D2:3A:FA”,
      “channels”: [
      {
      “channel”: “A”,
      “attachedDevice”: “motor”,
      “direction”: “backward”
      },
      {
      “channel”: “B”,
      “attachedDevice”: “motor”,
      “direction”: “forward”
      }
      ]
      }
      ]
      }

    • #6306
      Liam MolloyLiam Molloy
      Participant

      I found the issue. In the example configurations on the MTC4BT, “backward” is used but in ‘loadControllerConfiguration.h” in line 116 the value “reverse” is used to set the “isinverted” property when the channels are configured.

      In my configuration file I changed “backward” to “reverse” and now the loco runs as expected.

      I would recommend either updating the documentation to say “reverse” or updating the code to say “backward”. Updating the documentation would mean the code does not have to be updated.

      // loadControllerConfiguration.h
      [115] const char *dir = channelConfig[“direction”] | “forward”;
      [116] bool isInverted = strcmp(dir, “reverse”) == 0;

    • #6307
      Matthias RunteMatthias Runte
      Keymaster

      Confirmed. In firmware version V1.0.2, you need to you “reverse”. With V1.1, you can also use “backward” instead of “reverse”. We already updated the documentation, but we are running a bit late with the publication of the new firmware version V1.1.

      If you can’t wait, check out the development branch of the git repository for now.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.