Merge pull request #3 from SnorreSelmer/can-filler

Updated code to evac feed-pipe after fill
This commit is contained in:
Snorre Selmer 2021-08-29 23:17:16 +02:00 committed by GitHub
commit 2c7983d7df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,12 +5,14 @@
# !!! than 10l! I have mine at 2l for safety !!!
alias canister_storage d0
alias volume_pump d1
alias fill_pump d1
alias evac_pump d2
alias analyzer d4
alias canister_present r0
alias canister_hash r1
alias canister_pressure r2
alias canister_hasroom r3
alias storage_pressure r2
alias gas_to_move r3
alias fill_pressure r4
alias pump_active r5
@ -31,16 +33,25 @@ move fill_pressure 8000000 # regular can safe max
j fill # start filling
smart:
move fill_pressure 1400000 # smart can safe max
move fill_pressure 18000000 # smart can safe max
j fill # start filling
fill:
fill: # fills canister if present and <8Mpa
# get canister pressure in Pa
ls canister_pressure canister_storage 0 Pressure
ls storage_pressure canister_storage 0 Pressure
# is there room in the canister for more gas?
slt canister_hasroom canister_pressure fill_pressure
slt gas_to_move storage_pressure fill_pressure
# is there a can in the slot that has room?
and pump_active canister_hasroom canister_present
# trigger volume pump
s volume_pump On pump_active
and pump_active gas_to_move canister_present
# trigger fill pump
s fill_pump On pump_active
beqz canister_present evac# break if no can
j start
evac: # evacuates pipe on can removed and >0Pa
l storage_pressure analyzer Pressure
# is there gas in the pipe?
sgt gas_to_move storage_pressure 0
# trigger evac pump
s evac_pump On gas_to_move
j start