Chapter 10 code

This commit is contained in:
Danny Staple
2022-08-01 09:52:56 +01:00
parent 35358211ac
commit 7eff69d680
23 changed files with 1517 additions and 170 deletions
@@ -25,6 +25,8 @@ while True:
distance = robot.left_distance.distance
error = distance_set_point - distance
speed = distance_controller.calculate(error)
if abs(speed) < 0.2:
speed = 0
uart.write(f"{error},{speed}\n".encode())
print(f"{error},{speed}")
robot.set_left(speed)
+44
View File
@@ -0,0 +1,44 @@
import time
import board
import busio
import robot
uart = busio.UART(board.GP12, board.GP13, baudrate=9600)
class PIController:
def __init__(self, kp, ki):
self.kp = kp
self.ki = ki
self.integral = 0
def calculate(self, error, dt):
self.integral += error * dt
return self.kp * error + self.ki * self.integral
## We'll set up a single distance sensor, and keep a set distance from an object
robot.left_distance.distance_mode = 1
robot.left_distance.start_ranging()
distance_set_point = 10
distance_controller = PIController(-0.19, -0.005)
prev_time = time.monotonic()
while True:
if robot.left_distance.data_ready:
distance = robot.left_distance.distance
error = distance_set_point - distance
current_time = time.monotonic()
speed = distance_controller.calculate(error, current_time - prev_time)
prev_time = current_time
# Control the motors with the speed
if abs(speed) < 0.35:
speed = 0
uart.write(f"{error},{speed},"
f"{distance_controller.integral}\n".encode())
print(f"{error},{speed},{distance_controller.integral}")
robot.set_left(speed)
robot.set_right(speed)
robot.left_distance.clear_interrupt()
time.sleep(0.05)
@@ -19,8 +19,8 @@ left_encoder = pio_encoder.QuadratureEncoder(board.GP26, board.GP27)
i2c0 = busio.I2C(sda=board.GP0, scl=board.GP1)
i2c1 = busio.I2C(sda=board.GP2, scl=board.GP3)
right_distance = adafruit_vl53l1x.VL53L1X(i2c0)
left_distance = adafruit_vl53l1x.VL53L1X(i2c1)
left_distance = adafruit_vl53l1x.VL53L1X(i2c0)
right_distance = adafruit_vl53l1x.VL53L1X(i2c1)
def stop():
+35
View File
@@ -0,0 +1,35 @@
import time
import board
import busio
import robot
from pid_controller import PIDController
uart = busio.UART(board.GP12, board.GP13, baudrate=9600)
## We'll set up a single distance sensor, and keep a set distance from an object
robot.left_distance.distance_mode = 1
robot.left_distance.start_ranging()
distance_set_point = 10
distance_controller = PIDController(-0.09, -0.02, -0.07)
prev_time = time.monotonic()
while True:
if robot.left_distance.data_ready:
distance = robot.left_distance.distance
error = distance_set_point - distance
current_time = time.monotonic()
speed = distance_controller.calculate(error, current_time - prev_time)
prev_time = current_time
# Control the motors with the speed
if abs(speed) < 0.35:
speed = 0
uart.write(f"{error},{speed},{distance_controller.integral},{distance_controller.derivative}\n".encode())
print(f"{error},{speed},{distance_controller.integral},{distance_controller.derivative}")
robot.set_left(speed)
robot.set_right(speed)
# reset the distance sensor
robot.left_distance.clear_interrupt()
time.sleep(0.05)
@@ -0,0 +1,20 @@
class PIDController:
def __init__(self, kp, ki, kd, d_filter_gain=0.1):
self.kp = kp
self.ki = ki
self.kd = kd
self.d_filter_gain = d_filter_gain
self.integral = 0
self.error_prev = 0
self.derivative = 0
def calculate(self, error, dt):
self.integral += error * dt
# Add a low pass filter to the difference
difference = (error - self.error_prev) * self.d_filter_gain
self.error_prev += difference
self.derivative = difference / dt
return self.kp * error + self.ki * self.integral + self.kd * self.derivative
@@ -0,0 +1,77 @@
import rp2pio
import adafruit_pioasm
import array
program = """
; use the osr for count
; input pins c1 c2
set y, 0 ; clear y
mov osr, y ; and clear osr
read:
; x will be the old value
; y the new values
mov x, y ; store old Y in x
in null, 32 ; Clear ISR - using y
in pins, 2 ; read two pins into y
mov y, isr
jmp x!=y, different ; Jump if its different
jmp read ; otherwise loop back to read
different:
; x has old value, y has new.
; extract the upper bit of X.
in x, 31 ; get bit 31 - old p1 (remember which direction it came in)
in null, 31 ; keep only 1 bit
mov x, isr ; put this back in x
jmp !x, c1_old_zero
c1_old_not_zero:
jmp pin, count_up
jmp count_down
c1_old_zero:
jmp pin, count_down
; fall through
count_up:
; for a clockwise move - we'll add 1 by inverting
mov x, ~ osr ; store inverted OSR on x
jmp x--, fake ; use jump to take off 1
fake:
mov x, ~ x ; invert back
jmp send
count_down:
; for a clockwise move, just take one off
mov x, osr ; store osr in x
jmp x--, send ; dec and send
send:
; send x.
mov isr, x ; send it
push noblock ; put ISR into input FIFO
mov osr, x ; put X back in OSR
jmp read ; loop back
"""
assembled = adafruit_pioasm.assemble(program)
class QuadratureEncoder:
def __init__(self, first_pin, second_pin, reversed=False):
"""Encoder with 2 pins. Must use sequential pins on the board"""
self.sm = rp2pio.StateMachine(
assembled,
frequency=0,
first_in_pin=first_pin,
jmp_pin=second_pin,
in_pin_count=2,
)
self.reversed = reversed
self._buffer = array.array("i", [0])
def read(self):
while self.sm.in_waiting:
self.sm.readinto(self._buffer)
if self.reversed:
return -self._buffer[0]
else:
return self._buffer[0]
+52
View File
@@ -0,0 +1,52 @@
import board
import pwmio
import pio_encoder
import busio
import adafruit_vl53l1x
motor_A1 = pwmio.PWMOut(board.GP17)
motor_A2 = pwmio.PWMOut(board.GP16)
motor_B1 = pwmio.PWMOut(board.GP18)
motor_B2 = pwmio.PWMOut(board.GP19)
right_motor = motor_A1, motor_A2
left_motor = motor_B1, motor_B2
right_encoder = pio_encoder.QuadratureEncoder(board.GP20, board.GP21, reversed=True)
left_encoder = pio_encoder.QuadratureEncoder(board.GP26, board.GP27)
i2c0 = busio.I2C(sda=board.GP0, scl=board.GP1)
i2c1 = busio.I2C(sda=board.GP2, scl=board.GP3)
left_distance = adafruit_vl53l1x.VL53L1X(i2c0)
right_distance = adafruit_vl53l1x.VL53L1X(i2c1)
def stop():
motor_A1.duty_cycle = 0
motor_A2.duty_cycle = 0
motor_B1.duty_cycle = 0
motor_B2.duty_cycle = 0
def set_speed(motor, speed):
# Swap motor pins if we reverse the speed
if speed < 0:
direction = motor[1], motor[0]
speed = -speed
else:
direction = motor
speed = min(speed, 1) # limit to 1.0
max_speed = 2 ** 16 - 1
direction[0].duty_cycle = int(max_speed * speed)
direction[1].duty_cycle = 0
def set_left(speed):
set_speed(left_motor, speed)
def set_right(speed):
set_speed(right_motor, speed)
-39
View File
@@ -1,39 +0,0 @@
class PID:
def __init__(self, proportional_k, integral_k, differential_k, set_point):
self.proportional_k = proportional_k
self.integral_k = integral_k
self.differential_k = differential_k
self.set_point = set_point
self.error_sum = 0
self.last_value = 0
self.min_output = -1
self.max_output = 1
self.dead_zone = 0.3
def update(self, measurement, time_delta):
error_value = measurement - self.set_point
proportional = error_value * self.proportional_k
# calculate integral
self.error_sum += error_value * time_delta
# clamp it
self.error_sum = min(self.max_output, self.error_sum)
self.error_sum = max(self.min_output, self.error_sum)
integral = self.error_sum * self.integral_k
differentiated_error = (error_value - self.last_value) / time_delta
differential = differentiated_error * self.differential_k
self.last_value = error_value
output = proportional + integral + differential
# clamp output
if abs(output) < self.dead_zone:
output = 0
else:
output = min(self.max_output, output)
output = max(self.min_output, output)
return output
-25
View File
@@ -1,25 +0,0 @@
import board
import busio
from digitalio import DigitalInOut
from adafruit_esp32spi import adafruit_esp32spi
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
def connect_to_wifi():
esp32_cs = DigitalInOut(board.GP10)
esp32_ready = DigitalInOut(board.GP9)
esp32_reset = DigitalInOut(board.GP8)
spi = busio.SPI(board.GP14, MOSI=board.GP11, MISO=board.GP12)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
esp.reset()
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets)
wifi.connect()
return wifi, esp
-104
View File
@@ -1,104 +0,0 @@
import time
import json
import math
from adafruit_esp32spi import adafruit_esp32spi_wsgiserver
from adafruit_wsgi.wsgi_app import WSGIApp
import pid
import robot
import robot_wifi
class FollowWallApp:
def __init__(self) -> None:
self.speed = 0.6
self.max_deflection = 0.4
self.follow_pid = pid.PID(0.1, 0.5, 0, 15)
self.follow_pid.dead_zone = 0.6
self.wifi = None
self.server = None
self.last_time = time.monotonic()
self.left_dist = 0
self.pid_output = 0
def setup_robot(self):
robot.left_distance.distance_mode = 1
def setup_wifi(self, app):
print("Setting up wifi.")
self.wifi, esp = robot_wifi.connect_to_wifi()
self.server = adafruit_esp32spi_wsgiserver.WSGIServer(80, application=app)
adafruit_esp32spi_wsgiserver.set_interface(esp)
print("Starting server")
self.server.start()
ip_int = ".".join(str(int(n)) for n in esp.ip_address)
print(f"IP Address is {ip_int}")
def index(self, request):
return (
200,
[("Content-Type", "application/json")],
[
json.dumps(
{
"last_value": self.follow_pid.last_value,
"pid_output": self.pid_output,
"time": self.last_time,
}
)
],
)
def movement_update(self):
# do we have data
if robot.left_distance.data_ready:
self.left_dist = robot.left_distance.distance
# calculate time delta
new_time = time.monotonic()
time_delta = new_time - self.last_time
self.last_time = new_time
# get turn from pid
self.pid_output = self.follow_pid.update(self.left_dist, time_delta)
deflection = self.pid_output * self.max_deflection
# make movements
robot.set_left(self.speed - deflection)
robot.set_right(self.speed + deflection)
# reset and loop
robot.left_distance.clear_interrupt()
def main_loop(self):
robot.left_distance.start_ranging()
while True:
try:
self.movement_update()
self.server.update_poll()
except RuntimeError as e:
print(f"Server poll error: {type(e)}, {e}")
robot.stop()
print(f"Resetting ESP...")
self.wifi.reset()
print("Reset complete.")
def start(self):
app = WSGIApp()
app.route("/")(self.index)
print("Starting")
try:
self.setup_robot()
self.setup_wifi(app)
self.main_loop()
finally:
robot.stop()
robot.left_distance.clear_interrupt()
robot.left_distance.stop_ranging()
FollowWallApp().start()
+60
View File
@@ -0,0 +1,60 @@
import time
import board
import busio
import robot
from pid_controller import PIDController
uart = busio.UART(board.GP12, board.GP13, baudrate=9600)
robot.right_distance.distance_mode = 1
robot.right_distance.start_ranging()
speed = 0.7
distance_set_point = 15
distance_controller = PIDController(0.046, 0.0, 0)
print("Waiting for bytes on UART...")
prev_time = time.monotonic()
motors_active = False
while True:
if robot.right_distance.data_ready:
distance = robot.right_distance.distance
error = distance_set_point - distance
current_time = time.monotonic()
deflection = distance_controller.calculate(error, current_time - prev_time)
prev_time = current_time
uart.write(f"{error},{deflection}\n".encode()) # ,{distance_controller.derivative}
if motors_active:
robot.set_left(speed - deflection)
robot.set_right(speed + deflection)
# reset the distance sensor
robot.right_distance.clear_interrupt()
time.sleep(0.05)
if uart.in_waiting:
command = uart.readline().decode().strip()
if command.startswith("M"):
speed = float(command[1:])
elif command == "O":
motors_active = not motors_active
robot.set_left(0)
robot.set_right(0)
distance_controller.integral = 0
elif command.startswith("P"):
distance_controller.kp = float(command[1:])
elif command.startswith("I"):
distance_controller.ki = float(command[1:])
elif command.startswith("D"):
distance_controller.kd = float(command[1:])
elif command.startswith("S"):
distance_set_point = float(command[1:])
elif command.startswith("?"):
uart.write(f"P{distance_controller.kp:.3f}\n".encode())
uart.write(f"I{distance_controller.ki:.3f}\n".encode())
uart.write(f"D{distance_controller.kd:.3f}\n".encode())
uart.write(f"S{distance_set_point:.3f}\n".encode())
uart.write(f"M{speed:.1f}\n".encode())
time.sleep(3)
elif command.startswith("R"):
distance_controller.integral = 0
+20
View File
@@ -0,0 +1,20 @@
class PIDController:
def __init__(self, kp, ki, kd, d_filter_gain=0.1):
self.kp = kp
self.ki = ki
self.kd = kd
self.d_filter_gain = d_filter_gain
self.integral = 0
self.error_prev = 0
self.derivative = 0
def calculate(self, error, dt):
self.integral += error * dt
# Add a low pass filter to the difference
difference = (error - self.error_prev) * self.d_filter_gain
self.error_prev += difference
self.derivative = difference / dt
return self.kp * error + self.ki * self.integral + self.kd * self.derivative
+77
View File
@@ -0,0 +1,77 @@
import rp2pio
import adafruit_pioasm
import array
program = """
; use the osr for count
; input pins c1 c2
set y, 0 ; clear y
mov osr, y ; and clear osr
read:
; x will be the old value
; y the new values
mov x, y ; store old Y in x
in null, 32 ; Clear ISR - using y
in pins, 2 ; read two pins into y
mov y, isr
jmp x!=y, different ; Jump if its different
jmp read ; otherwise loop back to read
different:
; x has old value, y has new.
; extract the upper bit of X.
in x, 31 ; get bit 31 - old p1 (remember which direction it came in)
in null, 31 ; keep only 1 bit
mov x, isr ; put this back in x
jmp !x, c1_old_zero
c1_old_not_zero:
jmp pin, count_up
jmp count_down
c1_old_zero:
jmp pin, count_down
; fall through
count_up:
; for a clockwise move - we'll add 1 by inverting
mov x, ~ osr ; store inverted OSR on x
jmp x--, fake ; use jump to take off 1
fake:
mov x, ~ x ; invert back
jmp send
count_down:
; for a clockwise move, just take one off
mov x, osr ; store osr in x
jmp x--, send ; dec and send
send:
; send x.
mov isr, x ; send it
push noblock ; put ISR into input FIFO
mov osr, x ; put X back in OSR
jmp read ; loop back
"""
assembled = adafruit_pioasm.assemble(program)
class QuadratureEncoder:
def __init__(self, first_pin, second_pin, reversed=False):
"""Encoder with 2 pins. Must use sequential pins on the board"""
self.sm = rp2pio.StateMachine(
assembled,
frequency=0,
first_in_pin=first_pin,
jmp_pin=second_pin,
in_pin_count=2,
)
self.reversed = reversed
self._buffer = array.array("i", [0])
def read(self):
while self.sm.in_waiting:
self.sm.readinto(self._buffer)
if self.reversed:
return -self._buffer[0]
else:
return self._buffer[0]
Binary file not shown.
+52
View File
@@ -0,0 +1,52 @@
import board
import pwmio
import pio_encoder
import busio
import adafruit_vl53l1x
motor_A1 = pwmio.PWMOut(board.GP17, frequency=100)
motor_A2 = pwmio.PWMOut(board.GP16, frequency=100)
motor_B1 = pwmio.PWMOut(board.GP18, frequency=100)
motor_B2 = pwmio.PWMOut(board.GP19, frequency=100)
right_motor = motor_A1, motor_A2
left_motor = motor_B1, motor_B2
right_encoder = pio_encoder.QuadratureEncoder(board.GP20, board.GP21, reversed=True)
left_encoder = pio_encoder.QuadratureEncoder(board.GP26, board.GP27)
i2c0 = busio.I2C(sda=board.GP0, scl=board.GP1)
i2c1 = busio.I2C(sda=board.GP2, scl=board.GP3)
left_distance = adafruit_vl53l1x.VL53L1X(i2c0)
right_distance = adafruit_vl53l1x.VL53L1X(i2c1)
def stop():
motor_A1.duty_cycle = 0
motor_A2.duty_cycle = 0
motor_B1.duty_cycle = 0
motor_B2.duty_cycle = 0
def set_speed(motor, speed):
# Swap motor pins if we reverse the speed
if speed < 0:
direction = motor[1], motor[0]
speed = -speed
else:
direction = motor
speed = min(speed, 1) # limit to 1.0
max_speed = 2 ** 16 - 1
direction[0].duty_cycle = int(max_speed * speed)
direction[1].duty_cycle = 0
def set_left(speed):
set_speed(left_motor, speed)
def set_right(speed):
set_speed(right_motor, speed)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

+631
View File
@@ -0,0 +1,631 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="370.942187pt" height="248.518125pt" viewBox="0 0 370.942187 248.518125" xmlns="http://www.w3.org/2000/svg" version="1.1">
<metadata>
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2022-07-18T20:12:56.773432</dc:date>
<dc:format>image/svg+xml</dc:format>
<dc:creator>
<cc:Agent>
<dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
</rdf:RDF>
</metadata>
<defs>
<style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
</defs>
<g id="figure_1">
<g id="patch_1">
<path d="M 0 248.518125
L 370.942187 248.518125
L 370.942187 0
L 0 0
L 0 248.518125
z
" style="fill: none"/>
</g>
<g id="axes_1">
<g id="patch_2">
<path d="M 28.942188 224.64
L 363.742188 224.64
L 363.742188 7.2
L 28.942188 7.2
z
" style="fill: #ffffff"/>
</g>
<g id="PathCollection_1">
<defs>
<path id="m9b80e83e22" d="M 0 3
C 0.795609 3 1.55874 2.683901 2.12132 2.12132
C 2.683901 1.55874 3 0.795609 3 0
C 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132
C 1.55874 -2.683901 0.795609 -3 0 -3
C -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132
C -2.683901 -1.55874 -3 -0.795609 -3 0
C -3 0.795609 -2.683901 1.55874 -2.12132 2.12132
C -1.55874 2.683901 -0.795609 3 0 3
z
" style="stroke: #ff7f0e; stroke-width: 2"/>
</defs>
<g clip-path="url(#pd7c4f83c9f)">
<use xlink:href="#m9b80e83e22" x="74.6272" y="119.131063" style="fill: #ff7f0e; stroke: #ff7f0e; stroke-width: 2"/>
</g>
</g>
<g id="PathCollection_2">
<g clip-path="url(#pd7c4f83c9f)">
<use xlink:href="#m9b80e83e22" x="94.43064" y="135.373614" style="fill: #ff7f0e; stroke: #ff7f0e; stroke-width: 2"/>
</g>
</g>
<g id="PathCollection_3">
<g clip-path="url(#pd7c4f83c9f)">
<use xlink:href="#m9b80e83e22" x="196.494522" y="120.411129" style="fill: #ff7f0e; stroke: #ff7f0e; stroke-width: 2"/>
</g>
</g>
<g id="PathCollection_4">
<g clip-path="url(#pd7c4f83c9f)">
<use xlink:href="#m9b80e83e22" x="257.428183" y="118.872607" style="fill: #ff7f0e; stroke: #ff7f0e; stroke-width: 2"/>
</g>
</g>
<g id="matplotlib.axis_1">
<g id="xtick_1">
<g id="line2d_1">
<defs>
<path id="m49118ebe64" d="M 0 0
L 0 3.5
" style="stroke: #000000; stroke-width: 0.8"/>
</defs>
<g>
<use xlink:href="#m49118ebe64" x="44.160369" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_1">
<!-- 0 -->
<g transform="translate(40.979119 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-30" d="M 2034 4250
Q 1547 4250 1301 3770
Q 1056 3291 1056 2328
Q 1056 1369 1301 889
Q 1547 409 2034 409
Q 2525 409 2770 889
Q 3016 1369 3016 2328
Q 3016 3291 2770 3770
Q 2525 4250 2034 4250
z
M 2034 4750
Q 2819 4750 3233 4129
Q 3647 3509 3647 2328
Q 3647 1150 3233 529
Q 2819 -91 2034 -91
Q 1250 -91 836 529
Q 422 1150 422 2328
Q 422 3509 836 4129
Q 1250 4750 2034 4750
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-30"/>
</g>
</g>
</g>
<g id="xtick_2">
<g id="line2d_2">
<g>
<use xlink:href="#m49118ebe64" x="82.205824" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_2">
<!-- 1 -->
<g transform="translate(79.024574 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-31" d="M 794 531
L 1825 531
L 1825 4091
L 703 3866
L 703 4441
L 1819 4666
L 2450 4666
L 2450 531
L 3481 531
L 3481 0
L 794 0
L 794 531
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-31"/>
</g>
</g>
</g>
<g id="xtick_3">
<g id="line2d_3">
<g>
<use xlink:href="#m49118ebe64" x="120.251278" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_3">
<!-- 2 -->
<g transform="translate(117.070028 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-32" d="M 1228 531
L 3431 531
L 3431 0
L 469 0
L 469 531
Q 828 903 1448 1529
Q 2069 2156 2228 2338
Q 2531 2678 2651 2914
Q 2772 3150 2772 3378
Q 2772 3750 2511 3984
Q 2250 4219 1831 4219
Q 1534 4219 1204 4116
Q 875 4013 500 3803
L 500 4441
Q 881 4594 1212 4672
Q 1544 4750 1819 4750
Q 2544 4750 2975 4387
Q 3406 4025 3406 3419
Q 3406 3131 3298 2873
Q 3191 2616 2906 2266
Q 2828 2175 2409 1742
Q 1991 1309 1228 531
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-32"/>
</g>
</g>
</g>
<g id="xtick_4">
<g id="line2d_4">
<g>
<use xlink:href="#m49118ebe64" x="158.296733" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_4">
<!-- 3 -->
<g transform="translate(155.115483 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-33" d="M 2597 2516
Q 3050 2419 3304 2112
Q 3559 1806 3559 1356
Q 3559 666 3084 287
Q 2609 -91 1734 -91
Q 1441 -91 1130 -33
Q 819 25 488 141
L 488 750
Q 750 597 1062 519
Q 1375 441 1716 441
Q 2309 441 2620 675
Q 2931 909 2931 1356
Q 2931 1769 2642 2001
Q 2353 2234 1838 2234
L 1294 2234
L 1294 2753
L 1863 2753
Q 2328 2753 2575 2939
Q 2822 3125 2822 3475
Q 2822 3834 2567 4026
Q 2313 4219 1838 4219
Q 1578 4219 1281 4162
Q 984 4106 628 3988
L 628 4550
Q 988 4650 1302 4700
Q 1616 4750 1894 4750
Q 2613 4750 3031 4423
Q 3450 4097 3450 3541
Q 3450 3153 3228 2886
Q 3006 2619 2597 2516
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-33"/>
</g>
</g>
</g>
<g id="xtick_5">
<g id="line2d_5">
<g>
<use xlink:href="#m49118ebe64" x="196.342188" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_5">
<!-- 4 -->
<g transform="translate(193.160938 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-34" d="M 2419 4116
L 825 1625
L 2419 1625
L 2419 4116
z
M 2253 4666
L 3047 4666
L 3047 1625
L 3713 1625
L 3713 1100
L 3047 1100
L 3047 0
L 2419 0
L 2419 1100
L 313 1100
L 313 1709
L 2253 4666
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-34"/>
</g>
</g>
</g>
<g id="xtick_6">
<g id="line2d_6">
<g>
<use xlink:href="#m49118ebe64" x="234.387642" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_6">
<!-- 5 -->
<g transform="translate(231.206392 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-35" d="M 691 4666
L 3169 4666
L 3169 4134
L 1269 4134
L 1269 2991
Q 1406 3038 1543 3061
Q 1681 3084 1819 3084
Q 2600 3084 3056 2656
Q 3513 2228 3513 1497
Q 3513 744 3044 326
Q 2575 -91 1722 -91
Q 1428 -91 1123 -41
Q 819 9 494 109
L 494 744
Q 775 591 1075 516
Q 1375 441 1709 441
Q 2250 441 2565 725
Q 2881 1009 2881 1497
Q 2881 1984 2565 2268
Q 2250 2553 1709 2553
Q 1456 2553 1204 2497
Q 953 2441 691 2322
L 691 4666
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-35"/>
</g>
</g>
</g>
<g id="xtick_7">
<g id="line2d_7">
<g>
<use xlink:href="#m49118ebe64" x="272.433097" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_7">
<!-- 6 -->
<g transform="translate(269.251847 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-36" d="M 2113 2584
Q 1688 2584 1439 2293
Q 1191 2003 1191 1497
Q 1191 994 1439 701
Q 1688 409 2113 409
Q 2538 409 2786 701
Q 3034 994 3034 1497
Q 3034 2003 2786 2293
Q 2538 2584 2113 2584
z
M 3366 4563
L 3366 3988
Q 3128 4100 2886 4159
Q 2644 4219 2406 4219
Q 1781 4219 1451 3797
Q 1122 3375 1075 2522
Q 1259 2794 1537 2939
Q 1816 3084 2150 3084
Q 2853 3084 3261 2657
Q 3669 2231 3669 1497
Q 3669 778 3244 343
Q 2819 -91 2113 -91
Q 1303 -91 875 529
Q 447 1150 447 2328
Q 447 3434 972 4092
Q 1497 4750 2381 4750
Q 2619 4750 2861 4703
Q 3103 4656 3366 4563
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-36"/>
</g>
</g>
</g>
<g id="xtick_8">
<g id="line2d_8">
<g>
<use xlink:href="#m49118ebe64" x="310.478551" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_8">
<!-- 7 -->
<g transform="translate(307.297301 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-37" d="M 525 4666
L 3525 4666
L 3525 4397
L 1831 0
L 1172 0
L 2766 4134
L 525 4134
L 525 4666
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-37"/>
</g>
</g>
</g>
<g id="xtick_9">
<g id="line2d_9">
<g>
<use xlink:href="#m49118ebe64" x="348.524006" y="224.64" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_9">
<!-- 8 -->
<g transform="translate(345.342756 239.238437)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-38" d="M 2034 2216
Q 1584 2216 1326 1975
Q 1069 1734 1069 1313
Q 1069 891 1326 650
Q 1584 409 2034 409
Q 2484 409 2743 651
Q 3003 894 3003 1313
Q 3003 1734 2745 1975
Q 2488 2216 2034 2216
z
M 1403 2484
Q 997 2584 770 2862
Q 544 3141 544 3541
Q 544 4100 942 4425
Q 1341 4750 2034 4750
Q 2731 4750 3128 4425
Q 3525 4100 3525 3541
Q 3525 3141 3298 2862
Q 3072 2584 2669 2484
Q 3125 2378 3379 2068
Q 3634 1759 3634 1313
Q 3634 634 3220 271
Q 2806 -91 2034 -91
Q 1263 -91 848 271
Q 434 634 434 1313
Q 434 1759 690 2068
Q 947 2378 1403 2484
z
M 1172 3481
Q 1172 3119 1398 2916
Q 1625 2713 2034 2713
Q 2441 2713 2670 2916
Q 2900 3119 2900 3481
Q 2900 3844 2670 4047
Q 2441 4250 2034 4250
Q 1625 4250 1398 4047
Q 1172 3844 1172 3481
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-38"/>
</g>
</g>
</g>
</g>
<g id="matplotlib.axis_2">
<g id="ytick_1">
<g id="line2d_10">
<defs>
<path id="m7953119ac1" d="M 0 0
L -3.5 0
" style="stroke: #000000; stroke-width: 0.8"/>
</defs>
<g>
<use xlink:href="#m7953119ac1" x="28.942188" y="192.010909" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_10">
<!-- 1 -->
<g transform="translate(7.2 195.810128)scale(0.1 -0.1)">
<defs>
<path id="DejaVuSans-2212" d="M 678 2272
L 4684 2272
L 4684 1741
L 678 1741
L 678 2272
z
" transform="scale(0.015625)"/>
</defs>
<use xlink:href="#DejaVuSans-2212"/>
<use xlink:href="#DejaVuSans-31" x="83.789062"/>
</g>
</g>
</g>
<g id="ytick_2">
<g id="line2d_11">
<g>
<use xlink:href="#m7953119ac1" x="28.942188" y="153.965455" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_11">
<!-- 0 -->
<g transform="translate(15.579688 157.764673)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-30"/>
</g>
</g>
</g>
<g id="ytick_3">
<g id="line2d_12">
<g>
<use xlink:href="#m7953119ac1" x="28.942188" y="115.92" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_12">
<!-- 1 -->
<g transform="translate(15.579688 119.719219)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-31"/>
</g>
</g>
</g>
<g id="ytick_4">
<g id="line2d_13">
<g>
<use xlink:href="#m7953119ac1" x="28.942188" y="77.874545" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_13">
<!-- 2 -->
<g transform="translate(15.579688 81.673764)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-32"/>
</g>
</g>
</g>
<g id="ytick_5">
<g id="line2d_14">
<g>
<use xlink:href="#m7953119ac1" x="28.942188" y="39.829091" style="stroke: #000000; stroke-width: 0.8"/>
</g>
</g>
<g id="text_14">
<!-- 3 -->
<g transform="translate(15.579688 43.62831)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-33"/>
</g>
</g>
</g>
</g>
<g id="line2d_15">
<path d="M 44.160369 153.965455
L 44.465038 143.247896
L 45.074374 139.083836
L 45.988379 134.94757
L 47.207052 130.6224
L 48.730394 126.147905
L 50.253735 122.374726
L 51.777077 119.179438
L 53.300418 116.508832
L 54.82376 114.332952
L 56.042433 112.93336
L 57.261106 111.825378
L 58.47978 110.997845
L 59.698453 110.438648
L 60.917126 110.134509
L 62.135799 110.070915
L 63.354473 110.232152
L 64.573146 110.601402
L 66.096487 111.328306
L 67.619829 112.315922
L 69.447839 113.791826
L 71.580517 115.830018
L 74.322531 118.787628
L 82.853244 128.245703
L 85.29059 130.50278
L 87.423269 132.181921
L 89.251278 133.371167
L 91.079288 134.312961
L 92.907298 134.998881
L 94.735308 135.427242
L 96.563318 135.602628
L 98.391328 135.535319
L 100.219337 135.240627
L 102.047347 134.738164
L 104.180025 133.92038
L 106.617372 132.731328
L 109.664055 130.961587
L 114.234079 127.993843
L 119.718109 124.473208
L 123.06946 122.590387
L 125.811475 121.28957
L 128.55349 120.242357
L 130.990836 119.539275
L 133.428183 119.053183
L 135.865529 118.777372
L 138.607544 118.700114
L 141.349559 118.840151
L 144.70091 119.25054
L 148.661598 119.97244
L 162.67634 122.740601
L 166.637028 123.172844
L 170.293047 123.352446
L 173.949067 123.320585
L 177.909755 123.069729
L 182.47978 122.557181
L 189.182482 121.55088
L 199.541205 119.995696
L 205.329902 119.374116
L 210.813932 119.017168
L 216.60263 118.871126
L 223.914669 118.930979
L 244.327445 119.241939
L 252.858158 119.05412
L 263.826217 118.56264
L 282.715652 117.704724
L 294.902384 117.414609
L 346.086659 116.494052
L 348.524006 116.434164
L 348.524006 116.434164
" clip-path="url(#pd7c4f83c9f)" style="fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square"/>
</g>
<g id="line2d_16">
<path d="M 99.836453 147.625803
L 49.417947 90.636324
" clip-path="url(#pd7c4f83c9f)" style="fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #ff7f0e; stroke-width: 1.5"/>
</g>
<g id="line2d_17">
<path d="M 131.823585 142.389614
L 57.037694 128.357614
" clip-path="url(#pd7c4f83c9f)" style="fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #ff7f0e; stroke-width: 1.5"/>
</g>
<g id="line2d_18">
<path d="M 158.840089 125.851746
L 234.148954 114.970512
" clip-path="url(#pd7c4f83c9f)" style="fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #ff7f0e; stroke-width: 1.5"/>
</g>
<g id="line2d_19">
<path d="M 219.420049 120.557358
L 295.436316 117.187857
" clip-path="url(#pd7c4f83c9f)" style="fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #ff7f0e; stroke-width: 1.5"/>
</g>
<g id="patch_3">
<path d="M 28.942188 224.64
L 28.942188 7.2
" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g>
<g id="patch_4">
<path d="M 363.742188 224.64
L 363.742188 7.2
" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g>
<g id="patch_5">
<path d="M 28.942188 224.64
L 363.742188 224.64
" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g>
<g id="patch_6">
<path d="M 28.942188 7.2
L 363.742188 7.2
" style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g>
</g>
</g>
<defs>
<clipPath id="pd7c4f83c9f">
<rect x="28.942188" y="7.2" width="334.8" height="217.44"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long