Commit Graph

3081 Commits

Author SHA1 Message Date
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
Benjamin Vedder a7d18b0376 Squashed 'lispBM/lispBM/' changes from 6fc68bd8..2837aa33
2837aa33 attempting to fix issue related to restoring incremental read status after exiting a nested reader
c85d3e90 added a test for dynamically loaded extensions

git-subtree-dir: lispBM/lispBM
git-subtree-split: 2837aa336b743c41e6d4b4b91530ff0d13a6901a
2024-01-11 14:02:10 +01:00
Benjamin Vedder e55ce294ef Merge commit 'a7d18b0376ddaf4118d68a691793c3aa92e77dfe' 2024-01-11 14:02:10 +01:00
Benjamin Vedder 6902a9d307 Only load imports when flash is valid 2024-01-11 13:36:26 +01:00
Benjamin Vedder aeed53d348 Reduced memory size slightly 2024-01-11 09:43:36 +01:00
Benjamin Vedder 01ac9ef141 Squashed 'lispBM/lispBM/' changes from b436f573..6fc68bd8
6fc68bd8 Clear extension counter on init
869ff5c7 tweak error response in reader upon memory error while loading ext- symbol

git-subtree-dir: lispBM/lispBM
git-subtree-split: 6fc68bd84b166f3a7b867cdde27cba8e54550989
2024-01-11 08:53:26 +01:00
Benjamin Vedder 003c28c710 Merge commit '01ac9ef14159cfab7e8fbfb9e2068f869c6f61b4' 2024-01-11 08:53:26 +01:00
Benjamin Vedder b12c52afad Better symbol name location info 2024-01-11 08:53:21 +01:00
Benjamin Vedder 1d9195f7e2
Merge pull request #700 from makerbase-motor/master
Makerbase - Implement shutdown support, onboard IMU, fix H file naming definition error
2024-01-11 08:40:36 +01:00
Benjamin Vedder 25b424c717
Merge pull request #695 from surfdado/shutdown
COMM_SHUTDOWN command for shutdown/restart
2024-01-11 08:39:44 +01:00
makerbase-motor 0ac3421c7e
Merge branch 'vedderb:master' into master 2024-01-11 09:06:39 +08:00
Benjamin Vedder 3af0ba58f6 Squashed 'lispBM/lispBM/' changes from 2542797b..b436f573
b436f573 fix bugs in new extension storage

git-subtree-dir: lispBM/lispBM
git-subtree-split: b436f573e9712e0cb4d32e781d6d3d3e51a47f90
2024-01-10 22:05:17 +01:00
Benjamin Vedder 59cf772b79 Merge commit '3af0ba58f626f5ba6976b6c1148b9162cdfb19db' 2024-01-10 22:05:17 +01:00
Benjamin Vedder a966875683 Updated to new extension format, print more symbol info 2024-01-10 22:02:50 +01:00
Benjamin Vedder 6d53c08df0 Squashed 'lispBM/lispBM/' changes from 9c2023ac..2542797b
2542797b extension storage changed
055ec467 f_sym takes a symbol_id not an encoded symbol. f_sym_string takes a c string representing a symbol
1475b1a7 added functions for retrieving storage locations for symbols and symbol list entry
d234d21d Added functions for accessing the data in array, ro and rw kinds
5e009396 re-enabling the callcc gc bugfix with a modification to rule out following non-pointers into memory

git-subtree-dir: lispBM/lispBM
git-subtree-split: 2542797b8124eac6dc2a9d0671c7d9c9711b6968
2024-01-10 21:15:00 +01:00
Benjamin Vedder d277a59a02 Merge commit '6d53c08df06a9e5bd70546f6937be7b079d8e853' 2024-01-10 21:15:00 +01:00
makerbase-motor 6d5a24b596
Merge branch 'vedderb:master' into master 2024-01-10 09:05:09 +08:00
Benjamin Vedder f71d005d03 Squashed 'lispBM/lispBM/' changes from 4a176b04..9c2023ac
9c2023ac revert callcc gc fix and make the env hashmap static
e091c36c added tests of sort and one for callcc
eb164666 small tweak to make static analysis more happy

git-subtree-dir: lispBM/lispBM
git-subtree-split: 9c2023acd81fc12ebdc276b58a5bee6e11c18770
2024-01-09 23:14:11 +01:00
Benjamin Vedder 9f523580a1 Merge commit 'f71d005d03029fa47e96db22e561a40d48d77e7d' 2024-01-09 23:14:11 +01:00
Benjamin Vedder 105c6682a5 Squashed 'lispBM/lispBM/' changes from d2f9c684..4a176b04
4a176b04 update lbmref
5590c91b update doc
feda99fe resolve mistake
36c79cc6 resolve mistake
2145c388 expanding explanation of symbols in manual
a3140ff1 small tweak to doc removing mention of #var, maybe a section about valid symbol names should be added

git-subtree-dir: lispBM/lispBM
git-subtree-split: 4a176b04c18f183d19b1bb044a9cba9b7b8c419a
2024-01-09 16:16:13 +01:00
Benjamin Vedder 3b65f9095b Merge commit '105c6682a53cbaab6efa7c30114cd0059dc44427' 2024-01-09 16:16:13 +01:00
makerbase-motor f9f5f5e800
Merge branch 'vedderb:master' into master 2024-01-09 09:21:52 +08:00
Benjamin Vedder 9002293b50 Removed code related to variable memory 2024-01-08 22:07:14 +01:00
Benjamin Vedder 070e5cde9b Squashed 'lispBM/lispBM/' changes from 55553f58..d2f9c684
d2f9c684 removed the variable memory as the new hash-env seems to perform well enough
128813bf coercing all 64bit tests to pass
fc62e27a adding an nfibs example in experiment_repl
ecdb2720 extensions table outside of lbm memory, rearrange of lbm_init arguments
a95f3c94 moved variable storage to lbm memory
6d3af68d tiny tweak
c789fcc4 Work in progress moving stacks into lbm_memory

git-subtree-dir: lispBM/lispBM
git-subtree-split: d2f9c68466cc0cb19446bc3a9a06e5855b1690b0
2024-01-08 21:54:33 +01:00
Benjamin Vedder 330d4a1934 Merge commit '070e5cde9b7416f981e4b518545c8f204baf7e56' 2024-01-08 21:54:33 +01:00
Benjamin Vedder cd9acca714 Adapted to hash-table environment 2024-01-08 21:54:28 +01:00
Benjamin Vedder 999e87e80d Squashed 'lispBM/lispBM/' changes from 202b5763..55553f58
55553f58 hash table of environments for faster lookups
4c559b1f small tweak to env lookup
ef9dead0 A fix to a bug in GC handling of callcc continuations. Temporary, may change fix approach later
63868a8f closed a waring in array extensions
3135b7ec update of benchmarking with a sort benchmark that runs sort 10 times on 500 elt
44ec82cd remove a file that is nolonger in use
123717aa upped version

git-subtree-dir: lispBM/lispBM
git-subtree-split: 55553f580b75dfd66ab00491ed4ff234daf31b0b
2024-01-08 20:40:17 +01:00
Benjamin Vedder 32be95bde1 Merge commit '999e87e80d53b1da70fa3a42aa49f64cfa491e6d' 2024-01-08 20:40:17 +01:00
makerbase-motor 01651cf7f2
Close ADC-15, channel 16 2024-01-08 18:47:23 +08:00
makerbase-motor ad7850e630
Supports onboard IMU and shutdown 2024-01-08 18:43:41 +08:00