Skip to content

Commit

Permalink
docs: minor adjustment of the docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
PIERROOOTT committed Feb 1, 2024
1 parent 6b54954 commit e920927
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions examples/sample_protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
sample to the machine.
In this example, the motor is driven in function of the level of stress in the
sample. This Machine Block drives the motor in speed here.
sample. If the force measured by the load cell is greater (resp. lesser) than a
threshold value (10 N), the motor will move at speed = 0.5 mm/s in the
appropriate direction so that the force stays lesser (resp. greater) than the
threshold value.
This Machine Block drives the motor in speed here.
The InOut Block measured the force applied, and also outputs it to a Grapher
Block and to a Recorder Block.
Expand All @@ -16,7 +21,8 @@

gain = 3.26496001e+05
save_folder = '/home/essais/Desktop/margotin/'
speed = 1
speed = 0.5 # Speed in mm/s
thresh = 10 # Threshold force in N

# This IOBlock gets the current force measured by a 1000N load cell with a
# Phidget Wheatstone Bridge, and sends it to downstream Blocks.
Expand Down Expand Up @@ -51,11 +57,11 @@
# The path drive the Machine in function of the force measured by the load
# cell.
gen = crappy.blocks.Generator([{'type': 'Conditional',
'condition1': 'F(N)>10',
'condition2': 'F(N)<-10',
'condition1': f'F(N)>{thresh}',
'condition2': f'F(N)<-{thresh}',
'value0': 0,
'value1': -0.5,
'value2': 0.5}])
'value1': -speed,
'value2': speed}])

# This Grapher displays the force as measured by the LoadCell Block.
graph_force = crappy.blocks.Grapher(('t(s)', 'F(N)'))
Expand Down

0 comments on commit e920927

Please sign in to comment.