Skip to content

Commit

Permalink
v9.6.0: Out of fuel message, KITT sound, optimized semi automatic
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDIYGuy999 committed May 30, 2022
1 parent 02f0d6d commit a70c65b
Show file tree
Hide file tree
Showing 33 changed files with 50,209 additions and 168 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,13 @@ const uint8_t shakerStop = 60; // Shaker power while engine stop (max. 255, abou

## Changelog (newest on top):

### New in V 9.6.0:
- New version numbering: mainVersion.subVersion.patch It is also displayed in Serial Monitor, so you always know, which version you have on your vehicle
- "Out of fuel" voice message in many languages in "3_adjustmentsESC.h"
- Number of battery cells in series indicated by number of beeps after powering up the controller (#define BATTERY_PROTECTION mode only). This lets you always know, if your battery was detected properly.
- Knight Rider KITT scanner Neopixel animation now with sound (select it as siren in vehicle file). Scanner is now only on, if siren is on.
- Optimized "#define SEMI_AUTOMATIC" mode: Transmission is now downshifting earlier, if brake is applied

### New in V 9.5:
- Battery low discharge protection options added to "3_adjustmentsESC.h". Used in combination with ESC's without protection or internal RZ7886 motor driver
- Battery level is shown on LCD dashboard (bottom left instrument and central display).
Expand Down
9 changes: 5 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

[env:esp32dev]
;platform = [email protected] ;force to use v3.0.0 with framework-arduinoespressif32 3.10004.210126 (1.0.4) --> newer ones cause weird lights & rebooting issues!
;platform = espressif32@3.1.0 ;force to use v3.1.0 with framework-arduinoespressif32 3.10006.210326 (1.0.6) --> current version appears to be working correctly now
platform = espressif32 ;use latest version
platform = espressif32@3.2.0 ;force to use v3.1.0 with framework-arduinoespressif32 3.10006.210326 (1.0.6) --> current version appears to be working correctly now
;platform = espressif32 ;use latest version (not recommended!)
board = esp32dev
board_build.mcu = esp32
board_build.f_cpu = 240000000L
Expand All @@ -22,7 +22,7 @@ monitor_speed = 115200
;monitor_port = COM4 ;your port may vary!
upload_protocol = esptool
;upload_port = COM4 ;your port may vary!
upload_port = /dev/cu.wchusbserial52BC0196871
;upload_port = /dev/cu.wchusbserial52BC0196871

build_flags =
;-Os
Expand Down Expand Up @@ -56,4 +56,5 @@ lib_deps =
https://github.com/Bodmer/TFT_eSPI/archive/refs/tags/2.3.70.tar.gz ; 2.3.70 is confirmed to be working properly
https://github.com/FastLED/FastLED
;https://github.com/FastLED/FastLED/archive/refs/tags/3.3.3.tar.gz ; Some users are reporting, that they have to use v3.3.3
https://github.com/madhephaestus/ESP32AnalogRead
https://github.com/madhephaestus/ESP32AnalogRead
https://github.com/lbernstone/Tone32
4 changes: 2 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 All @@ -40,7 +40,7 @@

// Russian trucks --------
//#include "vehicles/Ural4320.h" // URAL 4320 6x6 V8 Diesel military truck
#include "vehicles/Ural375D.h" // URAL 375D 6x6 V8 petrol military truck
//#include "vehicles/Ural375D.h" // URAL 375D 6x6 V8 petrol military truck
//#include "vehicles/URAL375.h" // URAL 375D 6x6 V8 petrol military truck (new version with better V8 sound, but good bass speaker required)
//#include "vehicles/GAZ66.h" // GAZ-66 V8 petrol military truck

Expand Down
124 changes: 68 additions & 56 deletions src/3_adjustmentsESC.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,53 @@
/* Recommended ESC & settings
*****************************************************************************
ESC: HOBBYWING 1080 QUICRUN WP Crawler Brushed with the following settings:
Vehicle: TAMIYA trucks with 3 speed transmission
Motor: 540 size, 35 turns, stock pinion
For more details refer to the ESC manual.
Uncommented settings are left on factory preset
1: 3
2: 1 (1= LiPo, 2 = NIMH battery)
3: 3
4: 3
5: 4
6: 2
7: 9
8: 1
9: 8 (change it, important)
10: 4
11: 4
12: 5
13: 5 (16KHz = less whining)
14: 1 (be careful here, this will change the BEC voltage!!)
15: 1 (change it, important)
ESC: HOBBYWING 1080 QUICRUN WP Crawler Brushed with the following settings:
Vehicle: TAMIYA trucks with 3 speed transmission
Motor: 540 size, 35 turns, stock pinion
For more details refer to the ESC manual.
Uncommented settings are left on factory preset
1: 3
2: 1 (1= LiPo, 2 = NIMH battery)
3: 3
4: 3
5: 4
6: 2
7: 9
8: 1
9: 8 (change it, important)
10: 4
11: 4
12: 5
13: 5 (16KHz = less whining)
14: 1 (be careful here, this will change the BEC voltage!!)
15: 1 (change it, important)
*****************************************************************************
ESC: HOBBYWING QUICRUN FUSION motor / ESC combo with the following settings:
Vehicle: RGT EX86100 Jeep Crawler, stock pinion, 3S LiPo
Motor: Integrated brushless
Make sure you are uncommenting (remove //) "#define QUICRUN_FUSION" below!
For more details refer to the ESC manual.
Uncommented settings are left on factory preset
1: 2 (change it, 1 is jerky)
2: 1
3: 3
4: 1
5: 2 (change it, if Vehicle is driving in wrong direction)
6: 1 (be careful here, this will change the BEC voltage!!)
7: 5
8: 1
9: 4 (change reverse speed as you prefer)
ESC: HOBBYWING QUICRUN FUSION motor / ESC combo with the following settings:
Vehicle: RGT EX86100 Jeep Crawler, stock pinion, 3S LiPo
Motor: Integrated brushless
Make sure you are uncommenting (remove //) "#define QUICRUN_FUSION" below!
For more details refer to the ESC manual.
Uncommented settings are left on factory preset
1: 2 (change it, 1 is jerky)
2: 1
3: 3
4: 1
5: 2 (change it, if Vehicle is driving in wrong direction)
6: 1 (be careful here, this will change the BEC voltage!!)
7: 5
8: 1
9: 4 (change reverse speed as you prefer)
*****************************************************************************
HOBBYWING 1060 is working as well, but 1080 is still better
HOBBYWING 1060 is working as well, but 1080 is still better
*****************************************************************************
AS-12/6RW EASY from Modellbau-Regler.de is suitable for smaller vehicles (WPL, MN Model etc.),
but does not have the best drag brake. Better use an RZ7886 motor driver IC (see below)
AS-12/6RW EASY from Modellbau-Regler.de is suitable for smaller vehicles (WPL, MN Model etc.),
but does not have the best drag brake. Better use an RZ7886 motor driver IC (see below)
*****************************************************************************
*/
Expand All @@ -61,16 +61,16 @@ but does not have the best drag brake. Better use an RZ7886 motor driver IC (see
//#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
Wiring:
Pin 1 to 33 "ESC"
Pin 2 to 32
Pin 3 to GND (0V)
Pin 4 to Battery +
Pin 5 & 6 to motor +
Pin 7 & 8 to motor -
Notes:
- Make sure to have enough copper area around motor + and - for IC heatsinking!
- Connect a 100 - 470uF electrolytic cap and a 100nF tantalum or ceramic cap across pins 2 - 3
Wiring:
Pin 1 to 33 "ESC"
Pin 2 to 32
Pin 3 to GND (0V)
Pin 4 to Battery +
Pin 5 & 6 to motor +
Pin 7 & 8 to motor -
Notes:
- Make sure to have enough copper area around motor + and - for IC heatsinking!
- Connect a 100 - 470uF electrolytic cap and a 100nF tantalum or ceramic cap across pins 2 - 3
*/
//#define RZ7886_DRIVER_MODE // An RZ7886 motor driver is used instead of a standard RC Crawler Type ESC. suitable for motors up to 370 size, for example WPL vehicles.
const uint16_t RZ7886_FREQUENCY = 500; // 500 Hz is recommended. It is not audible, if virtual engine sound is running. Higher frequencies may overheat the driver IC!
Expand All @@ -86,7 +86,7 @@ const uint8_t RZ7886_DRAGBRAKE_DUTY = 100; // 0 - 100%. 100% = max. brake power
// - Hobbywing 1080 ESC & RBR/C 370 motor in Carson Mercedes racing truck (top speed = 160km/h) = 900
// - Modellbau-Regler.de AS-12/6RW EASY ESC = 600
// - Meccano Dumper = 500
const uint16_t escPulseSpan = 500; // 500 = full ESC power available, 1000 half ESC power available etc.
const uint16_t escPulseSpan = 500; // 500 = full ESC power available, 1000 half ESC power available etc.

// Additional takeoff punch:
// Usually 0. Enlarge it, if your motor is too weak around neutral.
Expand All @@ -96,7 +96,7 @@ const uint16_t escPulseSpan = 500; // 500 = full ESC power available, 1000 half
// - Hobbywing 1080 ESC & 35T 540 motor for HERCULES HOBBY trucks with 3 speed transmission = 150
// - Hobbywing 1080 ESC & RBR/C 370 motor in Carson Mercedes racing truck = 50
// - Meccano Dumper = 0
const uint16_t escTakeoffPunch = 0;
const uint16_t escTakeoffPunch = 0;

// Additional reverse speed (disconnect & reconnect battery after changing this setting):
// Usually 0. Enlarge it, if your reverse speed is too slow.
Expand All @@ -112,12 +112,24 @@ const uint16_t escReversePlus = 0;
// This prevents the vehicle from rolling back as long as brake is applied. 0 = no effect, ca. 20 = strong effect.
// How it works? Prevents the ESC from entering the "drag brake range"
// Warning: vehicle may be unable to stop, if too high, especially when driving downhill!
const uint16_t brakeMargin = 0; // For RZ7886 motor driver and 370 motor = 10
const uint16_t brakeMargin = 10; // For RZ7886 motor driver and 370 motor = 10

// Battery low discharge protection (only for boards with voltage divider resistors):
//#define BATTERY_PROTECTION // This will disable the ESC output, if the battery cutout voltage is reached
const float CUTOFF_VOLTAGE = 3.3; // Usually 3.3 V per LiPo cell. NEVER below 3.2 V!
const float FULLY_CHARGED_VOLTAGE = 4.2; // Usually 4.2 V per LiPo cell, NEVER above!
const uint16_t RESISTOR_TO_BATTTERY_PLUS = 9990; // 10000 Ohms (9900 for switch mode test board, 9650 for Ural)
const uint16_t RESISTOR_TO_BATTTERY_PLUS = 9650; // 10000 Ohms (9900 for switch mode test board, 9650 for Ural)
const uint16_t RESISTOR_TO_GND = 1000; // 1000 Ohms
const float DIODE_DROP = 0.34; // About 0.34V for SS34 diode (0 for Ural)
const float DIODE_DROP = 0.0; // About 0.34V for SS34 diode (0 for Ural)
volatile int outOfFuelVolumePercentage = 80; // Adjust the message volume in %
// Select the out of fuel message you want:
//#include "vehicles/sounds/OutOfFuelEnglish.h"
#include "vehicles/sounds/OutOfFuelGerman.h"
//#include "vehicles/sounds/OutOfFuelFrench.h"
//#include "vehicles/sounds/OutOfFuelDutch.h"
//#include "vehicles/sounds/OutOfFuelSpanish.h"
//#include "vehicles/sounds/OutOfFuelPortuguese.h"
//#include "vehicles/sounds/OutOfFuelJapanese.h"
//#include "vehicles/sounds/OutOfFuelChinese.h"
//#include "vehicles/sounds/OutOfFuelTurkish.h"
//#include "vehicles/sounds/OutOfFuelRussian.h"
6 changes: 3 additions & 3 deletions src/4_adjustmentsTransmission.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
// #define VIRTUAL_3_SPEED allows to simulate a 3 speed shifing transmission, if your vehicle doesn't have a real one.
// Gears are 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
//#define VIRTUAL_3_SPEED
//#define VIRTUAL_16_SPEED_SEQUENTIAL // This is still experimental!

//#define TRANSMISSION_NEUTRAL Allows to put the transmission in neutral. This can't be used, if the "Mode 1" button is used for other stuff!
//#define TRANSMISSION_NEUTRAL
#define TRANSMISSION_NEUTRAL

// #define SEMI_AUTOMATIC This will simulate a semi automatic transmission. Shifting is not controlled by the 3 position switch in this mode!
//#define SEMI_AUTOMATIC
Expand All @@ -33,4 +33,4 @@ uint16_t automaticReverseAccelerationPercentage = 100;

//#define DOUBLE_CLUTCH // Double-clutch (Zwischengas) Enable this for older 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 (EXPERIMENTAL). Comment this out for heavy vehicles like semi trucks
4 changes: 2 additions & 2 deletions src/6_adjustmentsLights.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
*
*/

// Neopixel settings (experimental)---------------------------------------------------------------------------------------------------------------
// Neopixel settings -----------------------------------------------------------------------------------------------------------------------------
//#define NEOPIXEL_ENABLED // GPIO0 used for WS2812 Neopixel control, if defined!
#define NEOPIXEL_COUNT 8 // How many Neopixels? 8 for Knight Rider, 3 for B33lz3bub
#define NEOPIXEL_BRIGHTNESS 5 // Brightness (255 is the maximum)

// Choose the mode you want
//#define NEOPIXEL_DEMO // Demo
#define NEOPIXEL_KNIGHT_RIDER // Knight Rider scanner animation
#define NEOPIXEL_KNIGHT_RIDER // Knight Rider scanner animation (use it in combination with "kittScanner.h" "siren" sound in your vehicle file)
//#define NEOPIXEL_B33LZ3BUB // B33lz3bub Austria animation: https://www.rc-modellbau-portal.de/index.php?threads/baubericht-mercedes-actros-1851-gigaspace-tamiya.14349/page-3


Expand Down
Loading

0 comments on commit a70c65b

Please sign in to comment.