Tested new control modes on actual hardware.
Adjust new code so the modes kind of work now, as proof of concept.
Still needs major optimization and fixes though.
motorctl:
- add config option to disable logging for particular instance
- add some definitions to finetune control modes
- rework current and speed mode, so they actually kind of work
- fix TCS to not cause deadlock motors off
menu:
- add item set motorControlMode (select DUTY, CURRENT, SPEED)
- fix missing item maxDuty
speedsensor: fix return type
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
display.cpp:
Optimize battery voltage measurement
While calibrating noticed it is very non-linear
- outsource function to scale using lookup table
- add lookup table to batvoltage measurement
inserted many values to lookup table while testing
currentsensors:
Fix current value jumping around between 0 and 0.2 on display
while standstill
- add parameter snapToZeroThreshold
motorctl, currentsensor:
- add config option for inverted current sensor
- adjust loglevels
config:
- Adjust gpio pins to actual wiring (not breakout board for testing)
- Add min pulse durations for speedsensors (measurements with scope)
- Adjust config to currently mounted encoders
control, buzzer:
- adjust beeping
- Add feature for optinal delay to buzzer class:
have some pause after beeps instead of immediately
continuing with next queued sequence
Changes in menu for accel/decel time are now persistent after
restarts
main: initialize nvs and pass pointer to motorctl task
motorctl:
- add method to get default configured value
- add name to config -> adjust logging
- add methods to read and write msFadeAccel and msFadeDecel from nvs
- outsource task_fans and task_buzzer from main.cpp to their source files
- use task parameters to pass necessary configs and objects
- adjust task priorities (display was too low)
- board_control successfully sends motor commands to board_motorctl
- board_motorctl receives and applies motor commands
note: control pcb currently switches to HTTP mode after startup for testing
with data from ui
- partially commented in code that has to be reworked
- control: send commands via uart instead of to motor objects
- board motorctl handled motor: add timeout when no target data
received (e.g. control pcb offline / uart bugged)
- board motorctl uart: receive motorCommands_t struct and apply data to
target state of handled motors
- types: fix issue with global motorstateStr variable