Skip to content

Commit

Permalink
Add settings for Stepper driven by Push-Pull outputs (#3749)
Browse files Browse the repository at this point in the history
With no H-bridge and no special stepper IC
  • Loading branch information
dron0gus committed Jan 7, 2022
1 parent c458c47 commit e3ece9e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
5 changes: 3 additions & 2 deletions firmware/integration/rusefi_config.txt
Expand Up @@ -926,7 +926,7 @@ custom maf_sensor_type_e 4 bits, S32, @OFFSET@, [0:1], @@maf_sensor_type_e_enum@
bit knockBankCyl12,"Channel 2","Channel 1"
bit tcuEnabled
bit canBroadcastUseChannelTwo,"second","first"
bit unusedBit_310_30
bit useRawOutputToDriveIdleStepper;+If enabled we use four Push-Pull outputs to directly drive stepper idle air valve coilss
bit unusedBit_310_31

dc_io[ETB_COUNT iterate] etbIo
Expand Down Expand Up @@ -1491,8 +1491,9 @@ int8_t[MAX_CYLINDER_COUNT iterate] fuelTrim;;"Percent", @@PERCENT_TRIM_BYTE_PACK
uint8_t[TORQUE_CURVE_SIZE] autoscale torqueValues;;"Nm", 10, 0, 0, 255, 0
uint16_t[TORQUE_CURVE_SIZE] torqueRpmBins;;"RPM", 1, 0, 0, 65000, 0

output_pin_e[4 iterate] stepper_raw_output;

int[100] mainUnusedEnd;;"units", 1, 0, 0, 1, 0
int[99] mainUnusedEnd;;"units", 1, 0, 0, 1, 0

! end of engine_configuration_s
end_struct
Expand Down
37 changes: 27 additions & 10 deletions firmware/tunerstudio/rusefi.input
Expand Up @@ -2621,6 +2621,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
field = "No2 Disable", etbIo2_disablePin

dialog = stepperHbridgeHardware, "Stepper H-Bridge Hardware"
topicHelp = "stepperHbridgeHardwareHelp"
field = "Inverted driver pins", stepperDcInvertedPins
field = "No1 Direction #1", stepperDcIo1_directionPin1
field = "No1 Direction #2", stepperDcIo1_directionPin2
Expand All @@ -2629,19 +2630,29 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
field = "No2 Direction #2", stepperDcIo2_directionPin2
field = "No2 Disable", stepperDcIo2_disablePin

dialog = idleStepperHw, "Stepper Hardware"
dialog = idleStepperHw, "Stepper Controller Hardware"
topicHelp = "idleStepperHwHelp"
field = "Idle Stepper Step Pin", idle_stepperStepPin
field = "Idle Stepper Dir Pin", idle_stepperDirectionPin
field = "Idle Stepper Dir Pin Mode", stepperDirectionPinMode
field = "Idle Stepper Enable Pin", stepperEnablePin
field = "Idle Stepper Enable Pin Mode", stepperEnablePinMode

dialog = idleStepperHwType, "", xAxis
panel = idleStepperHw, East, { useStepperIdle && !useHbridgesToDriveIdleStepper }
panel = stepperHbridgeHardware, West, { useStepperIdle && useHbridgesToDriveIdleStepper }
dialog = stepperDirectDriveHardware, "Stepper Direct-Drive Hardware"
topicHelp = "stepperDirectDriveHardwareHelp"
field = "Stepper A+", stepper_raw_output1
field = "Stepper A-", stepper_raw_output2
field = "Stepper B+", stepper_raw_output3
field = "Stepper B-", stepper_raw_output4

dialog = idleStepperHwType, ""
panel = idleStepperHw, { useStepperIdle && !useHbridgesToDriveIdleStepper && !useRawOutputToDriveIdleStepper }
panel = stepperHbridgeHardware, { useStepperIdle && useHbridgesToDriveIdleStepper && !useRawOutputToDriveIdleStepper }
panel = stepperDirectDriveHardware, { useStepperIdle && !useHbridgesToDriveIdleStepper && useRawOutputToDriveIdleStepper }

dialog = idleStepperGeneral, ""
field = "Drive stepper with dual H bridges", useHbridgesToDriveIdleStepper, useStepperIdle
field = "Drive stepper with PushPull outputs", useRawOutputToDriveIdleStepper, { useStepperIdle && !useHbridgesToDriveIdleStepper }
field = "Stepper reaction time", idleStepperReactionTime, useStepperIdle
field = "Stepper total steps", idleStepperTotalSteps, useStepperIdle
field = "Stepper parking extra steps, %", stepperParkingExtraSteps, useStepperIdle
Expand All @@ -2652,13 +2663,10 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
field = "Min. Duty Cycle", stepperMinDutyCycle, { useHbridgesToDriveIdleStepper && stepperNumMicroSteps > 1 }
field = "Max. Duty Cycle", stepperMaxDutyCycle, { useHbridgesToDriveIdleStepper && stepperNumMicroSteps > 1 }

dialog = idleStepperSettings, "", xAxis
panel = idleStepperGeneral, East
panel = idleStepperMicro, West

dialog = idleStepper, "Stepper"
panel = idleStepperSettings
panel = idleStepperGeneral
panel = idleStepperHwType
panel = idleStepperMicro

dialog = idleHwType, "Idle Valve Hardware", yAxis
panel = idleSolenoid
Expand Down Expand Up @@ -3329,7 +3337,16 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
help = veTableDialogHelp, "Volumetric Efficiency"
text = "Volumetric Efficiency is used to calculate fuel in Speed Density mode. VE incorporates pressure ratio as measured by MAP sensor in boost (no VE ever above 105%ish)"
webHelp = "https://rusefi.com/s/fuel"


help = stepperHbridgeHardwareHelp, "Stepper driven by Dual H-bridge"
text = "In case you are using two H-bridges driving 4-wire stepper. H-brigde control signals connected to MCU pins configured here."

help = idleStepperHwHelp, "Stepper drivern by step motor driver IC"
text = "In case you have some special IC that drives your stepper. MCU to IC control signals (DIR/STEP/EN) configured here"

help = stepperDirectDriveHardwareHelp, "Stepper driven by 4 Push-Pull/Pull outputs"
text = "In case you have 4/6-wire stepper driven by 4 ECU outputs in Push-Pull or Pull mode. Set ECU outputs used for each phase here."

help = fuelHelp, "Fuel Control"
text = "More about fuel control on the web"
webHelp = "https://rusefi.com/s/fuel"
Expand Down

0 comments on commit e3ece9e

Please sign in to comment.