Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Dual Clutch Controller
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
97.461 KB
15 Mar, 2021 @ 11:59pm
21 Mar, 2021 @ 9:41pm
3 Change Notes ( view )

Subscribe to download
Dual Clutch Controller

Description
dual clutch experiment, with a microcontroller. all of the logic is done in lua.
the transmission can smoothly switch between clutches, allowing for continuous output power

inputs:
- bool to shift up
- bool to shift down

outputs:
- 8 'gears'
- gears 1-6 are actual gearboxes. gear 7 is gearboxes 3+5, and 8 is 4+6
- reverse gear.

code: https://gitlab.com/monofuel34089/luacrafts/-/blob/master/stormworks/dualClutch.lua


# code notes:

CLUTCH_TICKS is # of ticks to engage / disengage clutch
CLUTCH_OFFSET is how many ticks to offset engage / disengage

CLUTCH_TICKS=60 will take 1 second to change gears.
CLUTCH_OFFSET=50 starts to engage the second clutch when the first clutch is almost done disengaging. seems to work OK
CLUTCH_OFFSET=0 means the second clutch will engage at the same rate the first clutch disengages. this is a bit aggressive and will lock things up.
CLUTCH_OFFSET=60 means it will only engage the second clutch after the first clutch is done disengaging.