Add encoder test:
- used for calibrating the length measurement by counting the steps
per meter
- enabled with #define ENCODER_TEST in config.hpp
- display1: enocder steps
- display2: converted length in meter
Distance conversion:
- defining STEPS_PER_METER instead of MEASURING_ROLL_DIAMETER in
config.hpp
- defining the steps per meter by issuing 3 test measurements with
4mm2 solar cable in the new encoder test mode
Already switched earlier, now optimized code and connection plan to work
best with new vfd (T130750W).
Previous 7.5kw vfd will work too without using all 7 speed levels as at
first.
connection plan: changed pin assignment (1 free pin)
Code:
- vfd.cpp, main.cpp: remove not used D2 pin (only used with 7.5kw vfd)
- config.hpp: change pin assignment
- Fix bug where custom length did not get rounded
- Reduce beeping lengths, remove gap between beep events
- Add hysteresis to custom length selection to prevent unwanted beeps or
flickering display at certain poti positions
- change max loglevel to verbose in menuconfig
- outsource dynamic speed to setDynSpeedLvl function
- reuse function in wind-slow state with limit
- update function diagram to representation of current program
fix bugs introduced with addition of manual mode:
- fix stuck in target_reached state
- fix bug switch to manual mode only in counting possible
new vfd
- new 750W vfd has 1 speed select pin less -> limit used
levels to 0-3
Analog In only pins have no internal pullup resistors.
thus two preset switches need pulldown resistors on pcb to be soldered
and switch to 3v instead of GND
- changed in connection plan
- changed switch config in config.cpp (no pullup, inverted)
Fix manual mode:
previously there was a bugged change loop when pressing all 3 buttons
- made mode switch more clear
vfd: extend vfd_setState function with direction enum (default fwd)
main: reduce log output from buzzer task
config: use mos1 as vfd_FWD output
control:
add MANUAL state: motor can be controlled via preset buttons
adjust code slightly to support new state (also see updated
function-diagram)
Add readadc function from armchair project
Rework display section
- show lengthNow on first display
- show lengthTarget on second display
Prepare for statemachine
Remove unneeded function
Add comments improve structure
Add second display in series to first one
Adjust control.cpp
- welcome msg name. date
- scroll "hello" over two displays"
- display Ist/soll dummy text on each display
Add vfd.cpp/hpp with functions to control the VFD via 4 digital pins
Add way to test the vfd via SET button (rotate speed level) and START
button (toggle motor on/off)
- move code from testing task to control.cpp
- outsource functions for initializing display and encoder
- delete testing code
- add two display pages (current distance and counter)
- run handle functions for each button
Add config.cpp/hpp
- macros for all input and output pins
- gloabl evaluated switch objects
- buzzer object
- display config
- encoder config
Move main.c to main.cpp and adjust code to be c++ compatible
add custom library evaluated switch (copied from armchair project)
add buzzer object (copied from armchair project)
add control.cpp/hpp with control task (no function yet)