I searched the information about how to use user fuses in joulescope_driver, pyjoulescope_examples and pyjoulescope_examples repositories and found only few lines in js220.txt:
Hi @Victor - We have not documented how to use the fuses directly from a Python script, but it’s not that difficult. First, js220.txt is out of date. We ended up moving the calculation off of the JS220 and only provide accumulation and dissipation constants.
See js220_fuse for how the Joulescope UI uses fuse_to_config to convert the two thresholds and a duration into the values for F and K. It then sends these values to the JS220 here.
You can copy fuse_to_config into your script (also to_q and the constants) and do something like:
threshold1 = 1.0 # in amps
threshold2 = 2.0 # in amps
duration = 0.1 # in seconds
fuse_config = fuse_to_config(threshold1, threshold2, duration)
driver.publish(f'{device}/s/fuse/0/en', 0) # fuse disabled for configuration
driver.publish(f'{device}/s/fuse/0/F', fuse_config['js220_fq'])
driver.publish(f'{device}/s/fuse/0/K', fuse_config['js220_kq'])
driver.publish(f'{device}/s/fuse/0/en', 1) # fuse enabled
Alternately, you can compute the F and K constants and then just use them in your script.
The fuse will never trip below threshold1. The fuse will trip in duration at threshold2, slower between threshold1 and threshold2, and faster above threshold2.
For details, see the User Fuse section of the Joulescope JS220 User’s Guide (page 36 in version 1.9).
Please post again with any questions and if you are able to get this working!
I thought of something else. Your script will also need to subscribe to f'{device}/s/fuse/0/engaged' so that your script is notified that the fuse engaged.
I added a complete fuse_js220.py example. Hope this helps!