Welcome to MattzoBricks › Forums › MattzoTrainController for Bluetooth (MTC4BT) › Two motors. Forwards and Backwards
- This topic has 2 replies, 2 voices, and was last updated 1 year, 7 months ago by Matthias Runte.
-
AuthorPosts
-
-
May 14, 2023 at 18:16 #6305Liam MolloyParticipant
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.
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”
}
]
}
]
} -
May 14, 2023 at 19:13 #6306Liam MolloyParticipant
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; -
May 15, 2023 at 14:04 #6307Matthias RunteKeymaster
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.
- This reply was modified 1 year, 7 months ago by Matthias Runte.
-
-
AuthorPosts
- You must be logged in to reply to this topic.