- update config and connection plan
- swap B+ and B- of encoder to invert the rotational direction,
so the direction in code make more sense
- swap VFD and stepper pin. For some reason stepper did not work with
dir pin on mos2. Maybe pulse affected dir pin, try again with denoise
pcb
- Add datasheets of VFD and stepper driver
- Change pins in config for stepper driver
- DISABLED LAMP (pin now used for stepper)
- update connection plan with stepper section and wiring
To be able to use the encoder in future stepper task as well
- make certain variables global
- initialize encoder in main
- outsorce encoder functions in encoder.cpp / h
- adjust config
- add macro variable STEPPER_TEST (config.hpp)
if set: only `task_stepper-test` is started (main.cpp)
- add file for stepper/guide related code (guide-stepper.cpp/hpp)
currently defines a task that simply moves the axis left to right
repeatedly with a speed defined by a potentiometer connected to ADC
GPIO34
Add feature and config option #define TARGET_LENGTH_OFFSET
that makes it possible to set a distance that gets added to the target
length, thus preventing falling short on the actual length when spools
rotates back slightly after stop.
Also move reached tolerance to config.
control.cpp:
- Add new systemState CUTTING
- change systemState_t from enum to enum class (conflicting with
cutter enum)
- Add CUTTING functionality to CUT switch and auto cut after target
reached if enabled
cutter.cpp:
- Add function cutter_isRunning()
config:
- Add GPIO_LAMP macro to config
Rework config.cpp and config.hpp:
- different naming convention for evaluated switch objects
- thus updated macros for switches
- add new evalswitch instances for 4 switches on 1 adc
- update switch assignment, use the 4 new inputs
Update connection plan with new assignment, add stripboard details
- create new files with code for demultiplexing the 4 switches from the
one analog signal
- define lookup table with measurements done with the build pcb, test
switches and esp32 breakout board
- add note do config that gpio used for digital in is now used for
this multiplexer
- main.cpp: disable control task, run new handle function in a loop for
testing
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
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
- 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)