{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "98ef83f5-9309-4c69-90fb-dc33723007c6", "metadata": {}, "outputs": [], "source": [ "d = (reading_now - reading_last)/(time_now - time_last)\n", "i = (reading_now + reading_last)/2 * (time_now - time_last)\n", "p = reading_now\n", "\n", "output = (p * k_p) + (i * k_i) + (d * k_d)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.5" } }, "nbformat": 4, "nbformat_minor": 5 }