very experimental needs testing/debugging,
other control modes can currently be selected by editing the class definition in motorctl.hpp
menu/config
- add menu item to enable/disable traction control system
main: pass ptr to other motor to motor object
speedsensor: add method to get last update time
motorctl: handle loop:
- re-arrange some code sections
- add several methods to get current status (needed from other motor for tcs)
- add sketchy code for different control modes DUTY, CURRENT, SPEED (very basic implementation)
- add experimental code for traction control
Tested and debugged speed measurement on actual hardware.
Speed measurement is very stable now (reliable direction)
- fix direction inverted no effect
- fix direction detection
- remove "invalid directions" since every combination is valid
- trigger on rising edge only
- ignore too short pulses - possible noise (config option)
- ignore invalid pulse orders
- debug log count of ignored sequences
- outsource configuration of display and encoder from source/header file
to config.cpp and pass it to init function or task from main()
- optimize logging in several init functions
- speedsensor:
- fix startup error: initialize ISR only once
- create instances at initialization instead of first method call
- ssd1306 display library:
- modify library to pass offsetX to init function instead of using macro
- move speedsensor files from motorctl pcb to common
- single pcb create and configure global speedsensor objects
- display: create fast slow veryslow loop
- clear display every 30s
- show speed in rpm and km/h
NOTE: speedsensor needs fix, direction unreliable