Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
# Ignore hidden folders
.pio
.clang_complete
.gcc-flags.json
.vscode
.aid
*Thumbs.db

/data/www
/interface/build
/interface/node_modules
/interface/.eslintcache
.vscode
node_modules
/releases
/src/certs
/temp
/build
/logs
node_modules

# Ignore the built interface file
/lib/framework/WWWData.h
*WWWData.h
lib/framework/WWWData.h
*WWWData.h

/src/certs
ssl_certs/cacert.pem
/logs
.aid

# To update the defaults, use `git add --force ./factory_settings.ini`
# These will be modified during development to help reduce initial device setup time on re-flash
# We ignore them to prevent development changes for reaching main
factory_settings.ini
dev_settings.ini
7 changes: 7 additions & 0 deletions boards/canfuck_16MB.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x640000,
app1, app, ota_1, 0x650000,0x640000,
spiffs, data, spiffs, 0xc90000,0x360000,
coredump, data, coredump,0xFF0000,0x10000,
51 changes: 51 additions & 0 deletions boards/esp32-s3-canfuck.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "boards/canfuck_16MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_ESP32S3_DEV",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "CANfuck ESP32-S3-N16R8 (16 MB QD, 8MB PSRAM)",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 8716288,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
"vendor": "Espressif"
}
56 changes: 56 additions & 0 deletions boards/lust-linmot.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[env:LUST-LINMOT]
board = esp32-s3-canfuck

build_type = debug
lib_ldf_mode = chain+
check_tool = clangtidy

build_flags =
${env.build_flags}

# Motor properties
-D BOARD_STEP_PER_REV=2000 # 2000 steps per revolution
-D BOARD_PULLEY_TEETH=20 # 20 teeth on the pulley
-D BOARD_INVERT_DIRECTION=true # invert direction of the motor or S6
-D BOARD_KEEP_OUT=5.0 # keep out distance in mm
-D BOARD_SENSORLESS_TRIGGER=5.0 # trigger percentage for sensorless homing (Torque or Current)
-D BOARD_BELT_PITCH=2 # belt pitch in mm
-D BOARD_MAX_RPM=3000.0 # maximum RPM
-D BOARD_MAX_ACCELERATION=100000 # maximum acceleration in mm/s^2
-D BOARD_ENABLE_ACTIVE_LOW=true # enable pin is active low

# Pin definitions
-D BOARD_STEP_PIN=14 # step pin
-D BOARD_DIRECTION_PIN=27 # direction pin
-D BOARD_ENABLE_PIN=26 # enable pin
-D BOARD_ALARM_PIN=13 # alarm pin
-D BOARD_IN_POSITION_PIN=4 # in position pin
-D BOARD_ENDSTOP_PIN=12 # endstop pin
-D BOARD_ADC_PIN_CURRENT=36 # current sensor ADC pin
-D BOARD_ADC_PIN_VOLTAGE=39 # voltage sensor ADC pin
-D BOARD_MODBUS_RX_PIN=16 # modbus rx pin
-D BOARD_MODBUS_TX_PIN=17 # modbus tx pin
-D BOARD_NEOPIXEL_PIN=25 # neopixel data pin

# Current sensor properties
-D BOARD_AMPERE_PER_MILLIVOLT=2.5e-3 # ADC conversion factor current reading: 2.5mA per mV
-D BOARD_AMPERE_OFFSET_IN_MILLIVOLT=1666 # ADC offset in mV for 0A
-D BOARD_VOLT_PER_MILLIVOLT=4.0e-2 # ADC conversion factor voltage reading: 40mV per V
-D BOARD_MAX_AMPERE=5.0 # maximum range current sensor in Ampere
-D BOARD_MAX_VOLTAGE=40.0 # maximum range voltage sensor in Volt

# Available motor drivers - VIRTUAL driver is enabled by default
-D DRIVER_GENERIC_STEPPER=1 # Generic stepper driver with endstop switch
-D DRIVER_OSSM_REF_BOARD_V2=1 # OSSM Reference Board V2 with sensorless homing via current sensor

upload_protocol = esp-builtin

debug_tool = esp-builtin
debug_load_mode = manual

upload_port = COM13

monitor_port = ${dev_settings.monitor_port}
monitor_speed = ${dev_settings.monitor_speed}
monitor_filters = esp32_exception_decoder, colorize

42 changes: 42 additions & 0 deletions boards/ossm-ref-4mb.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[env:OSSMRefBoard4MB]
board = esp32dev
board_build.mcu = esp32
board_build.partitions = no_ota.csv
build_flags =
${env.build_flags}
-D FT_DOWNLOAD_FIRMWARE=0

# Motor properties
-D BOARD_STEP_PER_REV=2000 # 2000 steps per revolution
-D BOARD_PULLEY_TEETH=20 # 20 teeth on the pulley
-D BOARD_INVERT_DIRECTION=true # invert direction of the motor or S6
-D BOARD_KEEP_OUT=5.0 # keep out distance in mm
-D BOARD_SENSORLESS_TRIGGER=5.0 # trigger percentage for sensorless homing (Torque or Current)
-D BOARD_BELT_PITCH=2 # belt pitch in mm
-D BOARD_MAX_RPM=3000.0 # maximum RPM
-D BOARD_MAX_ACCELERATION=100000 # maximum acceleration in mm/s^2
-D BOARD_ENABLE_ACTIVE_LOW=true # enable pin is active low

# Pin definitions
-D BOARD_STEP_PIN=14 # step pin
-D BOARD_DIRECTION_PIN=27 # direction pin
-D BOARD_ENABLE_PIN=26 # enable pin
-D BOARD_ALARM_PIN=13 # alarm pin
-D BOARD_IN_POSITION_PIN=4 # in position pin
-D BOARD_ENDSTOP_PIN=12 # endstop pin
-D BOARD_ADC_PIN_CURRENT=36 # current sensor ADC pin
-D BOARD_ADC_PIN_VOLTAGE=39 # voltage sensor ADC pin
-D BOARD_MODBUS_RX_PIN=16 # modbus rx pin
-D BOARD_MODBUS_TX_PIN=17 # modbus tx pin
-D BOARD_NEOPIXEL_PIN=25 # neopixel data pin

# Current sensor properties
-D BOARD_AMPERE_PER_MILLIVOLT=2.5e-3 # ADC conversion factor current reading: 2.5mA per mV
-D BOARD_AMPERE_OFFSET_IN_MILLIVOLT=1666 # ADC offset in mV for 0A
-D BOARD_VOLT_PER_MILLIVOLT=4.0e-2 # ADC conversion factor voltage reading: 40mV per V
-D BOARD_MAX_AMPERE=5.0 # maximum range current sensor in Ampere
-D BOARD_MAX_VOLTAGE=40.0 # maximum range voltage sensor in Volt

# Available motor drivers - VIRTUAL driver is enabled by default
-D DRIVER_GENERIC_STEPPER=1 # Generic stepper driver with endstop switch
-D DRIVER_OSSM_REF_BOARD_V2=1 # OSSM Reference Board V2 with sensorless homing via current sensor
71 changes: 0 additions & 71 deletions lib/boards/OSSMReferenceBoard.h

This file was deleted.

10 changes: 5 additions & 5 deletions lib/services/MotorConfigurationService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ void MotorConfigurationService::begin()
ESP_LOGI("MotorConfigurationService", "Using GenericStepperMotor");
genericMotorInstance = new GenericStepperMotor();
genericMotorInstance->begin(&genericMotorProperties);
genericMotorInstance->setSensoredHoming(ENDSTOP_PIN, INPUT_PULLUP, true, 0.0, MOTION_HOMING_SPEED);
genericMotorInstance->setStepsPerMillimeter(_state.stepPerRev / (_state.pulleyTeeth * BELT_PITCH));
genericMotorInstance->setSensoredHoming(BOARD_ENDSTOP_PIN, INPUT_PULLUP, true, 0.0, MOTION_HOMING_SPEED);
genericMotorInstance->setStepsPerMillimeter(_state.stepPerRev / (_state.pulleyTeeth * BOARD_BELT_PITCH));
genericMotorInstance->invertDirection(_state.invertDirection);
_motor = static_cast<MotorInterface *>(genericMotorInstance);
_loadedDriver = GENERIC_STEPPER;
Expand All @@ -54,8 +54,8 @@ void MotorConfigurationService::begin()
ESP_LOGI("MotorConfigurationService", "Using OSSMRefBoardV2Motor");
OSSMMotorInstance = new OSSMRefBoardV2Motor();
OSSMMotorInstance->begin(&OSSMMotorProperties);
OSSMMotorInstance->setSensorlessHoming(MAX_AMPERE * (_state.sensorlessTrigger / 100.0), MOTION_HOMING_SPEED);
OSSMMotorInstance->setStepsPerMillimeter(_state.stepPerRev / (_state.pulleyTeeth * BELT_PITCH));
OSSMMotorInstance->setSensorlessHoming(BOARD_MAX_AMPERE * (_state.sensorlessTrigger / 100.0), MOTION_HOMING_SPEED);
OSSMMotorInstance->setStepsPerMillimeter(_state.stepPerRev / (_state.pulleyTeeth * BOARD_BELT_PITCH));
OSSMMotorInstance->invertDirection(_state.invertDirection);
_motor = static_cast<MotorInterface *>(OSSMMotorInstance);
_loadedDriver = OSSM_REF_BOARD_V2;
Expand All @@ -69,7 +69,7 @@ void MotorConfigurationService::begin()
}

// set motor parameters
_motor->setMaxSpeed((_state.maxRPM / 60.0) * _state.pulleyTeeth * BELT_PITCH);
_motor->setMaxSpeed((_state.maxRPM / 60.0) * _state.pulleyTeeth * BOARD_BELT_PITCH);
_motor->setMaxAcceleration(_state.maxAcceleration);
_motor->setMachineGeometry(_state.travel, _state.keepout);

Expand Down
Loading