Commit Graph

2910 Commits

Author SHA1 Message Date
Benjamin Vedder e166a34ab9 Added timeout-support and updated documentation for uart-driver 2024-02-29 17:18:28 +01:00
Benjamin Vedder 4b15ea9385 Added system_time_ticks to C interface 2024-02-29 10:17:06 +01:00
Benjamin Vedder fd958d59a2 Merge commit '128e19cfa6dac685fc59a98757405b3bbcd5bad3' 2024-02-27 13:39:30 +01:00
Benjamin Vedder 128e19cfa6 Squashed 'lispBM/lispBM/' changes from 520fde1a..edb024b7
edb024b7 BUGFIX: in lbm_is_number that would sometimes incorrectly state something is a number when it is not
a620e42c small tweak to REPL
f9911c0f terminate REPL upon problems, added error codes for traceability
c36f1e72 small tweak lbmref
04cad3d8 rearrange charts
86429f0f added images related to f32, f64 performance on various platforms
108791b9 update the reference manual
90dbbf63 added secs-since operation to repl
134c59a5 changes to perfomance plot python script
6a02f301 Update lbmref.md
b913f173 small note about usage of vesc hardware for data collection
0bbf246a update lbmref with some typo fixes
c62eec6d updates to lbmref
f6e188e0 adding some information about numerical operation performance
b8a55394 adding some information about numerical operation performance
ef58050d adding some information about numerical operation performance
e98d5b87 correct file 32bit
3002333a added perfomance examples
c74558cc adding to refman about numbers
ebca34cb type fix lbmref
3fde1dcb type fix lbmref
bfcd8247 update to lbmref
32b56fd3 added some info to lbmref

git-subtree-dir: lispBM/lispBM
git-subtree-split: edb024b75fe37c8f948fccb4e7d992cf783fd429
2024-02-27 13:39:30 +01:00
Benjamin Vedder 0dc873c088
Merge pull request #711 from TechAUmNu/A50S-V23c-release
A50S v2.3c release
2024-02-26 11:32:04 +01:00
Euan 6b3fa1b64e Correct reference voltage 2024-02-26 00:26:15 +00:00
Euan d41466f5a3 Backport to A50S V23 which also has 25MHz clock 2024-02-23 23:20:37 +00:00
Euan be2ae56981 Add A50S V23c to firmware package 2024-02-23 23:14:50 +00:00
Euan b698a9da97 oversample voltage measurement to remove 25Mhz clock noise
The 25MHz clock couples through the floating phase filter capacitor opendrain output on 1 phase. Which appears as a voltage offset and screws up flux linkage measurements at lower voltages. By oversampling, this offset is removed and flux linkage measurements now work properly at all voltages.
2024-02-23 23:09:54 +00:00
Euan b3b047809a Refactor to allow custom voltage measurement
Allows the hw conf to control voltage measurement for foc, useful for adding oversampling.
2024-02-23 23:06:08 +00:00
Euan ad9ee2d24f Tune default calibration values 2024-02-23 19:38:49 +00:00
Euan 0f36dee181 Add config for A50S V23c
V23c version includes EEPROM chip to store calibration data.
2024-02-23 19:38:49 +00:00
Euan 77fde46d88 Update config for A50S V23
This update corrects the shunt resistance.
Adds generic calibration values for the current.
Adds 6 sample filtering for current (takes 6 current samples each pwm cycle and averages them to reduce noise)
Reduced max pwm in foc to 45khz
Disabled offset calibration on boot to speed up boot time. (Boots in under 2s now)
2024-02-23 19:38:48 +00:00
Euan 1edde06ea9 Enable internal pullups for i2c_bb same as hw i2c
This allows slow i2c devices with no external pullup resistors, 100k seems to work fine in my testing.
2024-02-23 19:38:48 +00:00
Benjamin Vedder 5b6148dd1e Updated comment 2024-02-23 08:17:25 +01:00
Benjamin Vedder 5fd5dfe086 Made HFI error truncation configurable 2024-02-23 08:13:56 +01:00
Benjamin Vedder a50829f55a Style tweaks 2024-02-23 07:22:06 +01:00
Benjamin Vedder 7bfadf1c4e Adapted to latest lbm 2024-02-23 07:13:19 +01:00
Benjamin Vedder 3c051b179a Squashed 'lispBM/lispBM/' changes from 610c2d2a..520fde1a
520fde1a fix promotion bug when converting i32 to u64
1ea55e8a fixes related to LBM BYTE type
fba7e9a9 bugfix related to subtraction of byte values
baab84c3 update lbmref with information about numbers
4a7ac41f addition of tests and changes to type promotion and flat values
7a7cf54a updates to type promotion and some changes to flat value encoding for 64 bit
0e30b53a remove some args from flatten_value_size

git-subtree-dir: lispBM/lispBM
git-subtree-split: 520fde1a9610ec05300d72a898dd477553c29624
2024-02-23 07:08:24 +01:00
Benjamin Vedder 5ac558816d Merge commit '3c051b179a1e6dda1d3f7c1ae9b412206ab6e64f' 2024-02-23 07:08:24 +01:00
Benjamin Vedder 1e8e494c61
Merge pull request #709 from ljungholm/limit_pid_set_rpm
FOC speed control: Limit m_speed_pid_set_rpm to achievable RPM when ramp rate is non-zero
2024-02-23 07:01:49 +01:00
Benjamin Vedder 9499e56348
Merge pull request #705 from TechAUmNu/Calibrated-currents
Add ability to calibrate current sensors, simplify ifdefs in foc, higher resolution sampled current
2024-02-23 06:52:49 +01:00
Benjamin Vedder d61bde5841 Truncate HFI error to reject noise 2024-02-21 17:21:20 +01:00
Benjamin Vedder 957b720c41 Squashed 'lispBM/lispBM/' changes from 7ba933de..610c2d2a
610c2d2a added a silent mode to the REPL, --silent
79c69181 Fix bug in how errors happening inside of fundamentals are returned
de5c356b fix bug in addition that incorrectly promotes byte values to U type
64219f1b remove some printing in REPL
b24e4c39 fix bug in unflatten value related to 64bit int
baa5bfba fix bug in flatten_value related to the size of expressions that contain Byte sized data
5fc5a7df Merge branch 'master' of github.com:svenssonjoel/lispbm
52665236 minor changes to new repl
22070c29 update README
59b5144a update README
9e8c2a2a update README
582f2235 minor changes to new REPL
24d4b6e0 added storing of flattened result to the repl
412e6483 added a terminate option to the REPL
15af284f  enabled loading and storing of environment files from the new REPL
b5319ebe fix bug in 64bit version, added a NULL check after readline in the REPL
05b3eb61 fix missing include repl
300213b9 preparing for loading and storing of global environment
fc3d20b0 sequence loading and evaluation of multiple source files when using multiple instances of -s flag on repl
1370102c loading source files
4a2f1c3d preparing for accepting source files from command line to the repl
9b45e4da small changes to new repl
ba47441e promoted the experimental_repl to repl status, it is still work in progress but at a much nicer state
fe16c290 cleanup some unused code in repl.c
e6705251 adding general purpose functions from vesc_express to the REPL
a0955b93 fix to state change logic
cfbb6114 started a revamping of experiment_repl now depends on readline, more to do
41c142a3 small fixes to vesc_express hil test scripts
ee763c72 work on automated vesc express fw build with vesc_express from main and lbm from master
3a2884b5 some maintenance and clearning, removal of unused function
ade15e9d removing some unused code
e16a8598 added loging of failed tests to a unique log file for each instance of run_tests.sh
ce9bdcdd fix potential out of bounds writes found by Marcos. Also removed a few dead-writes
5e1bad69 Small tweaks to eval. Changes to test script, store failing tests to test.log and print way less during testing.
93d14889 remove a blank line
04e1dc62 small refactorings
dbadb211 Trying to make the vesc_express hil script slightly more robust
99b6540d added a TTY available check before attempting to launch the tests
fb7fbee7 Added a slightly longer running vesc_express hil test as an experiment. The run_tests scripts for hil tests needs to be made more robust
0dc4b25c vesc_express hil tests now use the new vesc_tool feature of stdout redirection, no uart needed
78781da2 Added framework for Vesc Express HIL tests

git-subtree-dir: lispBM/lispBM
git-subtree-split: 610c2d2a3b0b4724a31929150789cda70b5aacfc
2024-02-21 11:42:12 +01:00
Benjamin Vedder f7596f1c9e Merge commit '957b720c4122a6ce8765200cc9b63b022b28e929' 2024-02-21 11:42:12 +01:00
Carl Ljungholm 84f2253f98 Limit m_speed_pid_set_rpm to achievable RPM.
If m_speed_pid_set_rpm is allowed to exceed foc_openloop_rpm before index is found,
then there will be a jump in torque when index is found.
If m_speed_pid_set_rpm is allowed to exceed [l_min_erpm, l_max_erpm] then there is
a wind up effect since it will take time for m_speed_pid_set_rpm to return to valid
range due to ramp limit.
2024-02-20 11:29:59 +01:00
Benjamin Vedder 69c837a795 Resolved warning 2024-02-14 07:58:17 +01:00
Benjamin Vedder dcc2a24ffa
Merge pull request #703 from TechAUmNu/lisp-hw-pins-2
Add ability to use custom pins in lisp
2024-02-11 05:25:05 +01:00
Euan 5e66bb4387 Scale sampled data properly
Needs to be rescaled back to int for storage, 8* higher resolution so the hw can use oversampling.

BLDC can use floats for these variables, since they get changed to floats later anyway. Might as well do it earlier to make the code simpler.
2024-02-07 22:27:36 +00:00
Euan e26a2bac38 Fix for hw defining index without has_3_shunts defined 2024-02-07 01:30:10 +00:00
Euan 1f3667018f Fix compiler errors. 2024-02-07 01:05:35 +00:00
Euan 7628667458 Refactor raw sampling to improve readability
Cleaned up the sensor picking, my brain is happy now!
2024-02-07 00:04:15 +00:00
Euan 5b3906f9d8 Simplify mcpwm calibration. Make current samples correctly scaled. 2024-02-06 22:51:19 +00:00
Euan 5af6dbd03c Add missing M2 defines and reduce code duplication 2024-02-06 22:23:53 +00:00
Euan 0cd896ab5b make GET_CURRENT3 = 0 when not on 3 shunt hw
Some hw defines ADC_IND_CURR3 without defining HW_HAS_3_SHUNTS. So need to force GET_CURRENT3 to 0 in that case.
2024-02-06 22:16:09 +00:00
Euan c2878474a1 Refactor mcpwm_foc and fix bug in hw.h
Removed a bunch of ifdefs by making is_second_motor = 0 when not using dual motors.

Fixed a bug in hw.h where it wrongly defined GET_CURRENT3 when inverted shunts was selected. GET_CURRENT3 will now always be 0 by default, removing the need for a few ifdefs in the foc code.
2024-02-06 21:53:03 +00:00
Euan 8580ec8c77 Fix typo 2024-02-06 00:14:54 +00:00
Euan af65f521de Add support for calibrating current sensors
Hw_conf can define CURRENT_CAL1,2,3 to set individual calibrations for each current sensor.

By default no calibration is used. (x1.0)

For example this is used on the A50S by looping a calibrated current using a power supply through each phase. Then the correction is saved in external eeprom to persist across firmware updates.

Tested on FOC, DC and BLDC modes.
2024-02-05 23:55:42 +00:00
Euan 4b716795a8 Always define pin enum values 2024-02-05 23:29:50 +00:00
Benjamin Vedder c5b8bb7feb Fixed ADC override bug 2024-02-01 12:37:06 +01:00
Benjamin Vedder c1f27b0478 Added hw_rb 2024-02-01 12:36:42 +01:00
Euan Mutch 987c777d66
Merge branch 'vedderb:master' into lisp-hw-pins-2 2024-01-27 14:39:34 +00:00
Euan 5350aa0e72 Fix ifdefs 2024-01-27 14:38:52 +00:00
Euan 003f6c9947 Add ability to use custom pins in lisp 2024-01-27 14:38:52 +00:00
Benjamin Vedder c9dbe942e0 Doc tweak 2024-01-22 16:20:42 +01:00
Benjamin Vedder 38a42ba203 Squashed 'lispBM/lispBM/' changes from 2837aa33..7ba933de
7ba933de lbm_lookup_extension_id now returns the actual extension symbol ID instead of the index into extension table
1c5c8da6 fix typo
0fb03637 defining different kinds of built-in symbols in some specific ranges. Cleaning out some old code.
b14dbe32 refactor of stack_push operations
4d1f5fd9 cont_closure_application_args refactor
aeb7d4d9 small tweak
8aafd407 expanding on the thuroughness of the ALWAYS_GC test mode
6eb4f614 clean out comments in cont_qq_expand_list
0d1e92b2 Bugfix in quasiquote expansion
c9bb4005 Added an ALWAYS_GC testmode and improved on the feedback from the tester
ccc3560a small refactor of cont_match and addition of 2 tests of match with guards
34609e1b tweaks and typo-fixes in lbmref.md
eb4e7def merror at lbm_lift_array if header cannot be allocated

git-subtree-dir: lispBM/lispBM
git-subtree-split: 7ba933de6261d5b33092f320adfc07050973b007
2024-01-22 14:54:32 +01:00
Benjamin Vedder 6e8dc4d7aa Merge commit '38a42ba20326836b12798ba3b5ea718deea50977' 2024-01-22 14:54:32 +01:00
Benjamin Vedder 924f85765f Added more bms commands 2024-01-12 13:22:42 +01:00
Benjamin Vedder da955e42c4 Added BMS pressure sensor support 2024-01-12 11:53:47 +01:00
Benjamin Vedder 2bc55235d6 Added ublox-init to doc 2024-01-11 15:00:10 +01:00