diff --git a/MotorDriver.cpp b/MotorDriver.cpp index 9aadbe6..0c6cef1 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -179,6 +179,8 @@ void MotorDriver::setDCSignal(byte speedcode) { if (tSpeed <= 1) brake = 255; else if (tSpeed >= 127) brake = 0; else brake = 2 * (128-tSpeed); + if (invertBrake) + brake=255-brake; analogWrite(brakePin,brake); // as the port registers can be shadowed to get syncronized DCC signals // we need to take care of that and we have to turn off interrupts during diff --git a/MotorDrivers.h b/MotorDrivers.h index b2b798d..d2dc027 100644 --- a/MotorDrivers.h +++ b/MotorDrivers.h @@ -65,6 +65,13 @@ // new MotorDriver(2, 8, UNUSED_PIN, -10, A1, 18, 3000, 12) // See Pololu dial_mc33926_shield_schematic.pdf and truth table on page 17 of the MC33926 data sheet. +// Pololu Dual TB9051FTG Motor Shield +// This is the shield without modifications which means +// no HA waveform and no RailCom on an Arduino Mega 2560 +#define POLOLU_TB9051FTG F("POLOLU_TB9051FTG"), \ + new MotorDriver(2, 7, UNUSED_PIN, -9, A0, 10, 2500, 6), \ + new MotorDriver(4, 8, UNUSED_PIN, -10, A1, 10, 2500, 12) + // Firebox Mk1 #define FIREBOX_MK1 F("FIREBOX_MK1"), \ new MotorDriver(3, 6, 7, UNUSED_PIN, A5, 9.766, 5500, UNUSED_PIN), \ diff --git a/WiThrottle.cpp b/WiThrottle.cpp index 5a835ce..66463de 100644 --- a/WiThrottle.cpp +++ b/WiThrottle.cpp @@ -211,9 +211,7 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) { } break; case 'N': // Heartbeat (2), only send if connection completed by 'HU' message - if (initSent) { - StringFormatter::send(stream, F("*%d\n"),HEARTBEAT_SECONDS); // return timeout value - } + StringFormatter::send(stream, F("*%d\n"), initSent ? HEARTBEAT_SECONDS : 1); // return timeout value break; case 'M': // multithrottle multithrottle(stream, cmd); diff --git a/config.example.h b/config.example.h index 3dac207..d6d60dc 100644 --- a/config.example.h +++ b/config.example.h @@ -37,6 +37,7 @@ The configuration file for DCC-EX Command Station // // STANDARD_MOTOR_SHIELD : Arduino Motor shield Rev3 based on the L298 with 18V 2A per channel // POLOLU_MOTOR_SHIELD : Pololu MC33926 Motor Driver (not recommended for prog track) +// POLOLU_TB9051FTG : Pololu Dual TB9051FTG Motor Driver // FUNDUMOTO_SHIELD : Fundumoto Shield, no current sensing (not recommended, no short protection) // FIREBOX_MK1 : The Firebox MK1 // FIREBOX_MK1S : The Firebox MK1S