Commit Graph

3038 Commits

Author SHA1 Message Date
Josh Stewart 7e8534c6d0 Allow RPM2 to be used for VSS on all decoders that don't have secondary 2023-05-17 15:39:34 +10:00
Josh Stewart 9bc49d9aa2 Warnings cleanup 2023-05-17 11:36:08 +10:00
Josh Stewart 62e14754bb Don't break VSS if using RPM2 pin and enable tooth or composite log 2023-05-17 11:25:50 +10:00
Josh Stewart 27531d3440 Allow use of RPM2 pin for VSS with Basic Distributor trigger 2023-05-17 08:46:20 +10:00
Josh Stewart b0cf9e6cd2 Missed ini line from last commit. 2023-05-17 08:21:25 +10:00
Josh Stewart b49c6b6ab8 Add option to power stepper motor constantly. Fixes #1031 2023-05-17 08:17:26 +10:00
Josh Stewart 4e157ce504 Change test paths to use / rather than \
Should be cross platform this way
2023-05-15 15:40:56 +10:00
tx_haggis 18501d4cbd
Additonal schedule initialization unit tests (#1046)
* const

* Add RUN_TEST_P

* Reduce test memory usage.

* More granular fuel tests - better failure reports

* More granular ignition tests - better failure reports

* Add unit tests for no injection timing

* Add fuel schedule oddfire tests

* Unit test ignition odd fire
2023-05-15 15:16:41 +10:00
mike501 805a535238
VVT2 improved logging & setup (#1036)
* adding VVT logging and trigger edge editing


fix missing define (temp fix?)


Revert "fix missing define (temp fix?)"

This reverts commit c6280f38ff69cc41278148a79c888736a71754b1.

fixes

* Create an additional logger screen in tunerstudio

Changes to create a third high speed logger window in tuner studio.

* Change variable name 

Discord discussion requested compositeLogEnabled didn't do a test for false as the type is now a byte. Variable renamed to be compositeTriggerUsed and false replaced with 0. Variable name and values used should now make more logical sense.

* added more logging

Log the primary, secondary and third inputs as well as engine cycle on all composite logs. Still have 3 different logs to allow you to visualise which is the best way to present the information.
2023-05-15 14:15:46 +10:00
Josh Stewart 492d0d2daf Fix for new ign mode on 8 cylinder, single channel output 2023-05-15 13:16:40 +10:00
mike501 d89cd532f9
updated to fix resync and improve sync fail reporting (#1047)
Fixes #801
2023-05-13 15:54:05 +10:00
Vitor Moreno B. Sales 9a1c3e30c3
Cranking add cold advance option (#872)
Co-authored-by: Josh Stewart <josh@noisymime.org>
2023-05-10 10:32:11 +10:00
tx_haggis 424a96d9ea
Test start/end callback assignment (#1044) 2023-05-07 19:42:09 +10:00
tx_haggis f71b7e50e2
Suppress 5.8 & 8.6 (#975)
As of cppcheck 2.9, these checks produce too many false positives
They do not account for class scope.
E.g. class1::method1==class2::method1
2023-05-04 10:14:57 +10:00
Jon Billings bcdd308035
fix check for engine rpm below target (#954)
* fix check for engine rpm below target

code is checking for RPM > target speed, but comment says checking for below target speed.
The comment makes sense, the old code doesn't

* improve idle advance enabling

revert to original (rpm > (target - 200)), to avoid excessive advance in transition from cranking to running with IAC control units.
But add exception if no other idle control mechanism to start it immediately (e.g. ITBs)
2023-05-04 00:24:45 +10:00
Josh Stewart 78bed477f5 Merge branch 'master' of https://github.com/noisymime/speeduino 2023-05-03 15:41:38 +10:00
Pasi Kemppainen a93811c8df
VSS from Aux input (#710)
Co-authored-by: Josh Stewart <josh@noisymime.org>
2023-05-03 15:23:49 +10:00
celso acyr da57378684
Read analog values via CAN BUS (#635)
* Read analog values via CAN BUS

Allows reading of 16 analog signals via CAN-BUS. with selection of Edianness.

* Moved function

Function moved to improve data readability.

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
2023-05-03 15:12:29 +10:00
Josh Stewart 65005c0019 Sync SD log with card at 4Hz interval 2023-05-02 13:13:19 +10:00
Josh Stewart 8d99a9c971 Correct template in build/unit test fail messages to Discord 2023-04-30 19:57:58 +10:00
Josh Stewart 1e66cfc5a6 Fix unit test build errors from last commit 2023-04-30 19:52:02 +10:00
mike501 53d6a6a461
Rover MEMS 4 cylinder decoder (#1032)
Decodes the 5 known Rover MEMS ECU patterns for Rover based engines. Covers A series, T series, O Series, K Series and V8. Doesn't currently cover sequential ignition for v6 or v8.

Co-authored-by: Josh Stewart <josh@noisymime.org>
Resolves #101
2023-04-30 19:01:10 +10:00
mike501 e0dbb38794
Renix 44 tooth decoder (includes 66 tooth code) (#1037)
* Renix 44-2-2 & 66-2-2-2 initial version

coded, not tested yet, saving to secure code

* First working version on ardustim

* updates to trigger setup

* latest changes

* 66 tooth working but occasional short dwell

* staging before major rewrite

updating the primary trigger to look for 12th system tooth to increment toothCurrentCount after this checking

* updated working but with bad dwell/timing

code works but the timing and dwell are not accurate once rpm goes over 400rpm

* Renix code 1st release

updated code to do both 44 and 66 tooth within a single set of functions

* remove support for sequential for 44 tooth

Sequential (via cam) was added for 44 tooth to enable future expansion. This is interfering with the normal code on the first testers car.

* updated cam position

* remove Dev logging

* remove logging

* updates to trigger decoding

fixes to 66 tooth pattern and removal of secondary flag for 44 tooth decoder

* fixes to decoder - rpm double

* updates to support display cam tooth position

added code to display which teeth the cam tooth arrives on as VVT1 & 2 and as Aux0 and Aux1.

* Revert "updates to support display cam tooth position"

This reverts commit d2ace89ea7.

* fixes from update to latest speeduino firmware

* Add 4cyl semi-seq injector pairing option

* Add timestamp field to SD logs

* Fix soft and hard rev limiter (#813)

* Increase dwell limiter in RX-8 type ignition (#820)

Currently the dwell limiter calculation considers rotary ignition to have more than 1 pulse per revolution. This only holds true for FC/FD type ignition which is wasted spark correctly resulting in 2 pulses per revolution. RX-8 type ignition however is fully sequential so there is only 1 pulse per revolution. As a result the dwell limiter is being calculated too low.
This change fixes the issue by correctly assuming 1 pulse per revolution in RX-8 type ignition

* All tapers use byte counters (#746)

Fixes

Update idle.ino

* Correct variable size for MAPlast

* Fix issue with SD RPM threshold not correctly detecting on/off

* Reorganise Engine Protection UI

* Add low/high battery voltage indicator (#824)

Fixes #822

* Remove tacho output flags (#814)

* fix typos in code documentation (#816)

* fix typos in code documentation

* minor reverts

* fix typos in ini

Co-authored-by: Josh Stewart <josh@noisymime.org>

* Added Trigger for the Yamaha Vmax motorcycle, 1990 and up. (#823)

* Test 1

* Added the Vmax decoder option

* Added the Yamaha Vmax decoder

Co-authored-by: RempageR1 <unconfigured@null.spigotmc.org>
Co-authored-by: Josh Stewart <josh@noisymime.org>

* Allow for '?' command through legacy comms.

Fixes #821

* Added idle advance start threshold (#747)

* Added idle advance start threshold

On lower temp and/or on ethanol the engine need to crank more, without this my starter get a kick and the engine backfires.

This enable it only at 200 RPM below the target

* Use define to idle advance RPM threshold

Co-authored-by: Josh Stewart <josh@noisymime.org>

* Remove previousLoopTime - never used (#706)

* Simplify the corrections calculations using div100

* Fix the calculations dash figures when battery correction is applied to open time only

* PWM and on/off idle fixes/cleanup (#806)

* Idle fixes #1

* Idle fixes #2

Co-authored-by: Josh Stewart <josh@noisymime.org>

* Remove duplicate iacClosedLoopTable. Lookup idle target RPM @ 4Hz after CLT reading

* Fix validTrigger assignment in Vmax decoder

* Align TPS_rateOfChange scale. Potential fix for #773

* Enable semi sequential and wasted COP on half sync (#478)

* Semi/Full sequential mode

Semi sequential in case of absent phase input at crank, engine will almost aways start in semi sequential mode

Minimal code change at speeduino.ino

Fix RPM reading when in half sync

* Update with latest changes in master

* Less calls to change functions

See #478 chat history for details

* Semi/Full sequential mode

Semi sequential in case of absent phase input at crank, engine will almost aways start in semi sequential mode

Minimal code change at speeduino.ino

Fix RPM reading when in half sync

* Update with latest changes in master

* Less calls to change functions

See #478 chat history for details

* Add sync status to log

* Updates

Updated speeduino.ini
Updated updates.ino

* Fix error in half to full sync function

Co-authored-by: Josh Stewart <josh@noisymime.org>

* Fixes after merge with speeduino master

* improved debug on sync loss using VVTangle

* additional debug

uses aux channels for debug  eg currentStatus.canin[2] these need removing from the full version. Also uses VVT1 pin for debug via VVT1_PIN_OFF()  and VVT1_PIN_ON()

* fixes

* remove secondary trigger

* different logging

* Final Version

* added automated tests

* fixed fuel pump always being on

* fix build issues after merge with master

* Change how 44 or 66 tooth selected

Updated to work out 44 or 66 tooth decoder based on the number of cylinders, 4 cylinder = 44 tooth, 6 cylinder = 66 tooth

* Fix typo in ini

* Delete compile_commands.json

* Remove duplicate declarations

* Remove VVT code from other PR

* fix speeduino.ino

Remove unintended additions to speeduino.ino

---------

Co-authored-by: Josh Stewart <josh@noisymime.org>
Co-authored-by: Pasi Kemppainen <48950874+pazi88@users.noreply.github.com>
Co-authored-by: theKraid <37898397+theKraid@users.noreply.github.com>
Co-authored-by: Vitor Moreno B. Sales <vitor_boss@yahoo.com.br>
Co-authored-by: Corey-Harding <91717711+Corey-Harding@users.noreply.github.com>
Co-authored-by: Daniel Tobias <dantob@users.noreply.github.com>
Co-authored-by: RempageR1 <103254506+RempageR1@users.noreply.github.com>
Co-authored-by: RempageR1 <unconfigured@null.spigotmc.org>
Co-authored-by: tx_haggis <13982343+adbancroft@users.noreply.github.com>
Co-authored-by: Vitor Moreno B. Sales <vitor.m.benevides@outlook.com>
2023-04-30 18:30:34 +10:00
tx_haggis 6fbf6db752
Fixes for Arduino IDE (#1042) 2023-04-29 14:57:57 +10:00
tx_haggis 4a509d19f2
Unit test fuel and ignition scheduler initialisation (#1039)
* Unit test fuel schedule initialisation

* Move initialisation tests to their own harness
Saves memory

* Rename test_misc to test_tables

* Rename test_misc2 to test_math

* Reduce memory usage

* Fill out remaining ignition init unit tests
2023-04-27 14:43:04 +10:00
Josh Stewart 9ff33f0384 Allow send of partial tooth and composite logs at low rpm/resolution 2023-04-26 16:35:39 +10:00
tx_haggis d1399a0f33
Enable Teensy 3.5 unit testing (#1038)
* Add missing forward declarations
Found while compiling teensy35 unit tests

* Unit test should not rely on EEPROM

* Fix bad lib_dep
Teensy35 #includes FlexCAN_4 headers

* Fix circular include
logger.h needs FPU_MAX_SIZE which is defined
in globals.h. Globals.h includes logger.h!

* Ambguity in integer typedefs
2023-04-26 15:54:15 +10:00
Josh Stewart 8c85b0c998 Remove legacy comms option from TunerStudio. Add legacy comms lock 2023-04-26 13:45:22 +10:00
Josh Stewart 97a8ea78b0 Update to Discord notifications for build and unit test failures 2023-04-24 16:29:24 +10:00
Josh Stewart 76dd7dc1bf Cleanup warnings on non-AVR architectures (scheduler interrupts were not static) 2023-04-24 15:33:02 +10:00
Josh Stewart 3aa9aec13f Update contributing file. Fixes #1004 2023-04-24 15:15:09 +10:00
Pasi Kemppainen 8c3c416f7a
Remove duplicates (#1027) 2023-04-24 11:53:42 +10:00
Josh Stewart d0286fe02d Ensure that output port manipulations are done atomically. Fixes #972 2023-04-24 10:30:51 +10:00
Josh Stewart 90530f65a3 Handle 3 cylinder, non-seq, staging with >= 6 fuel channels 2023-04-16 17:20:39 +10:00
Josh Stewart f32efa7aee Fix for cranking and fixed timing not being applied when secondary spark table in use 2023-04-16 17:19:33 +10:00
Josh Stewart 6987c966f6 Fixes for regressions in the new staging code 2023-04-13 16:35:47 +10:00
Josh Stewart b8b9cc2780 Set pin trigger hysteresis on T4.1 2023-04-08 08:36:14 +10:00
tx_haggis 8794f51550
Fix single cylinder staging configuration (#1028) 2023-04-07 10:03:06 +10:00
Josh Stewart a309659b69 Warnings cleanup. Fixes #1026 #1025 2023-03-30 14:29:38 +11:00
Josh Stewart 1c5ae26d7b Revert "Fix for hang on uninitialised Teensy 41 boards under some conditions"
This reverts commit 0cff612b01.
2023-03-27 16:59:50 +11:00
Josh Stewart 31b18b5078 Fix for hang on uninitialised Teensy 41 boards under some conditions 2023-03-27 16:59:44 +11:00
Josh Stewart 0cff612b01 Fix for hang on uninitialised Teensy 41 boards under some conditions 2023-03-27 16:57:56 +11:00
Josh Stewart e5e46b1d73 Add serial compatibility mode option 2023-03-23 11:05:10 +11:00
Josh Stewart 1886eb3861 Honour the Inverted ignition output setting on boards using MC33810. Fixes #1021 2023-03-16 13:49:59 +11:00
Josh Stewart 05e3ebeea3 Add power cycle warning for oil and fuel pressure. Fixes #1017 2023-03-14 11:59:44 +11:00
DeionSi e99a9e52f1
Remove unused temp sensor calibration option (#1005) 2023-03-14 11:43:21 +11:00
tx_haggis 0afffb2ca0
Unit test the schedule calculations (#1010)
* Refactor: separate out schedule calcs from speeduino.ino
(so they can be unit tested)

* Add unit tests for compute_delay

* Use PROGMEM to store test input & output

* Add some 720 unit tests

* Rename unit test file

* Test ignition codepaths 2-8

* Test ign1 calcs

* Add first injector calc tests

* Add 720 deg tests
Simplify

* Simplify test_calc_inj1_timeout

* Claw back RAM

* Simplify test framework
Channel angle is part of the test data set.

* Move schedule calculation unit tests into their own harness
Competing for RAM with the rest of Speeduino
can cause them to fail,

* Performance: inline all schedule calcs.

* Unit test end angle

* Unit test calculateIgnitionAngle1

* Test start angles also
And test end angles for channel 1

* Unit test calculateIgnitionAngle3

* Unit test calculateIgnitionAngle4

* Improve unit test output

* Add Nissan360 decoder unit tests.

* Add Ford ST170 decoder unit tests

* Add NGC decoder unit tests
2023-03-06 17:23:17 +11:00
Josh Stewart 311cae3fac Allow fuel staging up to 8 total fuel channels (All reasonable combinations) 2023-03-06 16:49:30 +11:00
Pasi Kemppainen 3411917180
Accurate RPM conversion for BMW CAN broadcast (#1012)
* Adjust RPM conversion.

Change the BMW can broadcast RPM conversion to accurate calculation.

* no signed ints

Whoopsie. Non of these are signed values.
2023-02-28 19:48:17 +11:00
Josh Stewart 560764e50b Fix for potential timing issue running dual wheel, sequential at cam speed 2023-02-28 15:02:07 +11:00