Skip to content

Commit

Permalink
v9.10.0: STEAM_LOCOMOTIVE_MODE see change log
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDIYGuy999 committed Jul 11, 2022
1 parent ddcfbc6 commit 6020a51
Show file tree
Hide file tree
Showing 19 changed files with 16,375 additions and 34 deletions.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 6 additions & 1 deletion documentation/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 9.10.0:
- First quick and dirty STEAM_LOCOMOTIVE_MODE implementation (see vehicles/Adler.h). Note, that you need to disable VIRTUAL_3_SPEED
- Steam whistle on horn channel
- In 8_adjustmentsSound.h: #define NO_INDICATOR_SOUND option, if you don't want the tic - tac sound

### 9.9.1:
- Flysky SBUS should now be stable with #define EMBEDDED_SBUS. Please let me know, if not.
- BATTERY_PROTECTION: scaling bug with higher resistor values fixed.
Expand Down Expand Up @@ -648,4 +653,4 @@
### 0.1:
- Runs on an ESP32 (240MHz)
- It's still quick and dirty, but works with the included V8 short course truck idle sound
- sounds way better than the ATmega 328 version, thanks to 22'050Hz sampling rate (instead of 8'000Hz)
- sounds way better than the ATmega 328 version, thanks to 22'050Hz sampling rate (instead of 8'000Hz)
Binary file modified documentation/ESCLinearity.xlsx
Binary file not shown.
7 changes: 5 additions & 2 deletions src/1_adjustmentsVehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//#include "vehicles/ScaniaV8_50ton.h" // SCANIA V8 50 ton truck. Unknown model. Bad quality!
//#include "vehicles/ScaniaV8.h" // SCANIA V8 truck, unknown model
//#include "vehicles/1000HpScaniaV8.h" // 1000 HP SCANIA V8 truck with open pipes. Insane sound! Good bass speakers reqired
#include "vehicles/Scania143.h" // SCANIA 143 V8 - the legend! The best sounding in my opinion
//#include "vehicles/Scania143.h" // SCANIA 143 V8 - the legend! The best sounding in my opinion
//#include "vehicles/ScaniaV8Firetruck.h" // SCANIA V8 firetruck, automatic Allison 6 speed transmission with torque converter, "Martinshorn" siren
//#include "vehicles/VolvoFH16_750.h" // Volvo FH16 750 truck. Inline 6, 750 horses, open pipes!
//#include "vehicles/VolvoFH16_OpenPipe.h" // Volvo FH truck. Inline 6, open pipes, alternative version
Expand Down Expand Up @@ -91,9 +91,12 @@
// Asian SUV --------
//#include "vehicles/LandcruiserFJ40.h" // Landcruiser Fj40 with inline 6 petrol engine
//#include "vehicles/LandcruiserFJ40Diesel.h" // Landcruiser Fj40 with inline 6 12H Turbo Diesel engine
//#include "vehicles/LandcruiserFJ40Diesel2.h" // Landcruiser Fj40 with inline 6 12H Turbo Diesel engine
//#include "vehicles/LandcruiserFJ40Diesel2.h" // Landcruiser Fj40 with inline 6 12H Turbo Diesel engine (C34)
//#include "vehicles/HiluxDiesel.h" // Hilux Diesel with inline 6 12H Turbo Diesel engine (for HG-P407)

// EU locomotives --------
#include "vehicles/Adler.h" // German Adler steam locomotive

// US locomotives --------
//#include "vehicles/UnionPacific2002.h" // Union Pacific 2002 SD70M locomotive with enormous, low revving 16 cylinder Diesel

Expand Down
4 changes: 2 additions & 2 deletions src/2_adjustmentsRemote.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define SBUS_COMMUNICATION // control signals are coming in via the SBUS interface (comment it out for classic PWM RC signals)
// NOTE: "boolean sbusInverted = true / false" was moved to the remote configuration profiles, so you don't have to change it
uint32_t sbusBaud = 100000; // Standard is 100000. Try to lower it, if your channels are coming in unstable. Working range is about 96000 - 104000.
#define EMBEDDED_SBUS // SBUS library not used, if defined (It is working fine with MICRO_RC, but still unstable with Flysky remotes, use IBUS for them)
#define EMBEDDED_SBUS // SBUS library not used, if defined (let me know, if Flysky remotes are still unstable)
uint16_t sbusFailsafeTimeout = 100; // Failsafe is triggered after this timeout in milliseconds (about 100)

// IBUS communication (RX header, 13 channels not recommended, NO FAILSAFE, if bad contact in iBUS wiring!) --------
Expand All @@ -41,7 +41,7 @@ uint16_t sbusFailsafeTimeout = 100; // Failsafe is triggered after this timeout

// CHANNEL LINEARITY SETTINGS ****************************************************************************************************************

//#define EXPONENTIAL_THROTTLE // Exponential throttle curve. Ideal for enhanced slow speed control in crawlers
#define EXPONENTIAL_THROTTLE // Exponential throttle curve. Ideal for enhanced slow speed control in crawlers
//#define EXPONENTIAL_STEERING // Exponential steering curve. More steering accuracy around center position

// CHANNEL AVERAGING (EXPERIMENTAL!) **********************************************************************************************************
Expand Down
9 changes: 5 additions & 4 deletions src/3_adjustmentsESC.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@

// General options
//#define QUICRUN_FUSION // Linearity compensation for HOBBYWING Quicrun Fusion motor / ESC combo
//#define QUICRUN_16BL30 // Linearity compensation for HOBBYWING Quicrun 16BL30 ESC (experimental, don't use it)
//#define ESC_DIR // uncomment this, if your motor is spinning in the wrong direction

/* RZ7886 motor driver IC instead of ESC. Not in combination with #define THIRD_BRAKELIGHT or #define TRAILER_LIGHTS_TRAILER_PRESENCE_SWITCH_DEPENDENT
/* RZ7886 motor driver IC instead of an ESC. Not in combination with #define THIRD_BRAKELIGHT or #define TRAILER_LIGHTS_TRAILER_PRESENCE_SWITCH_DEPENDENT
Wiring:
Pin 1 to 33 "ESC"
Pin 2 to 32
Expand Down Expand Up @@ -118,7 +119,7 @@ const uint16_t brakeMargin = 0; // For RZ7886 motor driver and 370 motor = 10
const uint8_t crawlerEscRampTime = 10; // about 10 (15 for Jeep), less = more direct control = less virtual inertia

// Allows to scale vehicle file dependent acceleration
uint16_t globalAccelerationPercentage = 100; // about 100 - 200% (200 for Jeep) Experimental, may cause automatic transmission shifting issues!
uint16_t globalAccelerationPercentage = 70; // about 100 - 200% (200 for Jeep) Experimental, may cause automatic transmission shifting issues!

/* Battery low discharge protection (only for boards with voltage divider resistors):
* IMPORTANT: Enter used resistor values in Ohms (Ω) and THEN adjust DIODE_DROP, until your readings match the actual battery voltage! */
Expand All @@ -130,8 +131,8 @@ const float RECOVERY_HYSTERESIS = 0.2; // around 0.2 V
* When selecting resistors, always use two of the same magnitude: Like, for example, 10k/2k, 20k/4k or 100k/20k. NEVER exceed a ratio LOWER than (4:1 = 4)!
* WARNING: If the ratio is too LOW, like 10k/5k (2:1 = 2), the battery voltage will most likely DAMAGE the controller permanently!
* Example calculation: 2000 / (2000 + 10000) = 0.166 666 666 7; 7.4 V * 0.167 = 1.2358 V (of 3.3 V maximum on GPIO Pin). */
uint32_t RESISTOR_TO_BATTTERY_PLUS = 10000; // Value in Ohms (Ω), for example 10000
uint32_t RESISTOR_TO_GND = 2000; // Value in Ohms (Ω), for example 2000. Measuring exact resistor values before soldering, if possible is recommended!
uint32_t RESISTOR_TO_BATTTERY_PLUS = 99900; // Value in Ohms (Ω), for example 10000
uint32_t RESISTOR_TO_GND = 19800; // Value in Ohms (Ω), for example 2000. Measuring exact resistor values before soldering, if possible is recommended!
float DIODE_DROP = 0.0; // Fine adjust measured value and/or consider diode voltage drop (about 0.34V for SS34 diode)
/* It is recommended to add a sticker to your ESP32, which includes the 3 calibration values above */
volatile int outOfFuelVolumePercentage = 80; // Adjust the message volume in %
Expand Down
5 changes: 3 additions & 2 deletions src/4_adjustmentsTransmission.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
// #define VIRTUAL_3_SPEED allows to simulate a 3 speed shifing transmission, if your vehicle doesn't have a real one.
// Gears are virtually shifted, using the 3 position switch. Example: your crawler has a 2 speed transmission, which is used as off road reducer,
// but no real 3 speed shifting transmission. Don't uncomment if for vehicles with electric or hydrostatic drive or automatic transmissions!
#define VIRTUAL_3_SPEED
// Also don't use it for STEAM_LOCOMOTIVE_MODE
//#define VIRTUAL_3_SPEED

//#define VIRTUAL_16_SPEED_SEQUENTIAL will enable a sequencial transmission, shifted by up / down impulses via 3 position switch
//#define VIRTUAL_16_SPEED_SEQUENTIAL // This is still experimental and not working properly! Don't use it.
Expand Down Expand Up @@ -46,4 +47,4 @@ uint16_t maxClutchSlippingRpm = 250; // The clutch will never slip above this li

//#define DOUBLE_CLUTCH // Double-clutch (Zwischengas) Enable this for older manual transmission trucks without synchronised gears

#define HIGH_SLIPPINGPOINT // Clutch will engage @ higher RPM, if defined (EXPERIMENTAL). Comment this out for heavy vehicles like semi trucks
#define HIGH_SLIPPINGPOINT // Clutch will engage @ higher RPM, if defined. Comment this out for heavy vehicles like semi trucks
8 changes: 4 additions & 4 deletions src/6_adjustmentsLights.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
//#define INDICATOR_SIDE_MARKERS // The indicators are used as side markers as well. This is commonly used in US trucks.

// More light configurations ---------------------------------------------------------------------------------------------------------------------
//#define NO_CABLIGHTS // The cablights step in the lights sequence is skipped, if defined
//#define NO_FOGLIGHTS // The foglights step in the lights sequence is skipped, if defined
#define NO_CABLIGHTS // The cablights step in the lights sequence is skipped, if defined
#define NO_FOGLIGHTS // The foglights step in the lights sequence is skipped, if defined
//#define THIRD_BRAKELIGHT // if defined, pin 32 is used for a third brake light, otherwise for a trailer presence switch (pulled to GND = no trailer attached)
#define FLICKERING_WHILE_CRANKING // The lights will flicker a bit during engine cranking, otherwise they are just a bit dimmed
#define HAZARDS_WHILE_5TH_WHEEL_UNLOCKED // Hazards on, if 5th wheel is unlocked
Expand All @@ -38,6 +38,6 @@
uint8_t cabLightsBrightness = 255; // Usually 255, 100 for Actros & Ural
uint8_t sideLightsBrightness = 200; // Usually 200, 100 for WPL C44, 50 for Landy, 100 for P407, 150 for Actros
uint8_t rearlightDimmedBrightness = 30; // tailligt brightness, if not braking, about 30
uint8_t rearlightParkingBrightness = 0; // 0, if you want the taillights being off, if side lights are on, or about 5 if you want them on (0 for US Mode)
uint8_t headlightParkingBrightness = 0; // 0, if you want the headlights being off, if side lights are on, or about 5 if you want them on (0 for US Mode)
uint8_t rearlightParkingBrightness = 3; // 0, if you want the taillights being off, if side lights are on, or about 5 if you want them on (0 for US Mode)
uint8_t headlightParkingBrightness = 3; // 0, if you want the headlights being off, if side lights are on, or about 5 if you want them on (0 for US Mode)
uint8_t reversingLightBrightness = 140; // Around 140, 50 for Landy & Ural
22 changes: 21 additions & 1 deletion src/7_adjustmentsServos.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
*/

// Select the vehicle configuration you have:
#define SERVOS_DEFAULT // <------- Select (remove //) one of the remote configurations below
//#define SERVOS_DEFAULT // <------- Select (remove //) one of the remote configurations below
//#define SERVOS_LANDY
#define SERVOS_C34
//#define SERVOS_URAL
//#define SERVOS_RGT_EX86100
//#define SERVOS_ACTROS
Expand Down Expand Up @@ -67,6 +68,25 @@ const uint16_t STEERING_RAMP_TIME = 0; // 0 = fastest speed, enlarge it to aroun

#endif

// WPL C34 Toyota Land Cruiser configuration profile -------------------------------------------------------------------------------------------
#ifdef SERVOS_C34

// Servo frequency
const uint8_t SERVO_FREQUENCY = 50; // usually 50Hz, some servos may run smoother @ 100Hz

// WARNING: never connect receiver PWM signals to the "CH" pins in BUS communication mode!

// Servo limits
const uint16_t CH1L = 1940, CH1C = 1600, CH1R = 1140; // CH1 steering left 1990, center 1640, right 1090
const uint16_t CH2L = 670, CH2C = 1800, CH2R = 1800; // CH2 transmission gear 1 978, 2 1800, 3 1800
const uint16_t CH3L = 1300, CH3C = 1450, CH3R = 1600; // CH3 winch pull, off, release
const uint16_t CH4L = 1300, CH4R = 1700; // CH4 trailer coupler (5th. wheel) locked, unlocked

// Servo ramp time
const uint16_t STEERING_RAMP_TIME = 0; // 0 = fastest speed, enlarge it to around 3000 for "scale" servo movements

#endif

// WPL Ural servo configuration profile -------------------------------------------------------------------------------------------
#ifdef SERVOS_URAL

Expand Down
1 change: 1 addition & 0 deletions src/8_adjustmentsSound.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

//#define NO_SIREN // siren sound is not played, if defined
//#define NO_INDICATOR_SOUND // If you don't want the indicator "tick - tack" sound

// Volume adjustment
//const uint8_t numberOfVolumeSteps = 3; // The mumber of volume steps below
Expand Down
Loading

0 comments on commit 6020a51

Please sign in to comment.