docs: update dev/Code_overview

This commit is contained in:
Valery Rutkovskiy 2021-01-12 13:08:15 +00:00 committed by Josh Stewart
parent 8e2ec9b5c5
commit 082af60989
1 changed files with 21 additions and 21 deletions

View File

@ -2,33 +2,33 @@
title: Обзор кода Code_overview
description:
published: true
date: 2021-01-12T12:52:44.783Z
date: 2021-01-12T13:08:09.568Z
tags:
editor: markdown
dateCreated: 2021-01-02T04:56:02.482Z
---
# Overview
A low level description of each code file and its purpose can be found in the Doxygen pages: https://speeduino.github.io/speeduino-doxygen/files.html
# Обзор
Низкоуровневое описание каждого файла кода и его назначение можно найти на страницах Doxygen: https://speeduino.github.io/speeduino-doxygen/files.html
## High level description of Speeduino control loop
## Высокоуровневое описание контура управления Speeduino
The main loop in the `speeduino.ino` file runs continually and has 2 primary functions, determining the engine requirements and setting the ignition/injection schedules according to these requirements.
Основной цикл в `speeduino.ino` файле работает постоянно и имеет 2 основных функций, определяя требования к двигателю и устанавливая параметры зажигания/впрыска в соответствии с этими требованиями.
A high level description of the functions performed in the main loop is below:
Ниже приведено высокоуровневое описание функций, выполняемых в основном цикле:
- Check whether there is a request in the serial buffer to be processed
- See whether the engine is turning by looking at the last time a crank tooth was seen
- Read values from all analog sensors (TPS, IAT, CLT, MAP, O2, Battery voltage). Not all sensors are read every loop as they do not change frequently enough to warrant this
- The following functions only occur if the engine has 'sync':
- Check whether the RPM is above or below the cranking threshold (Both fuel and ignition values are adjusted when the engine is cranking)
- Run all corrections functions (See corrections.ino section below). The outcome of this is a % that the pulsewidth will be adjusted by (100% = no adjustment, 110% = 10% more fuel, 90% = 10% less fuel)
- Lookup VE from the the main fuel table
- Convert VE into a pulsewidth value in uS
- Lookup the desired advance from the ignition table
- Calculate the current crank angle
- Calculate the crank angle that each injector should open at based on the current engine speed
- Calculate the dwell angle based on the desired dwell time and current engine speed
- Calculate the ignition start angle for each cylinder by subtracting the advance angle and the dwell angle from the TDC angle
- Set a 'schedule' for each injector by converting the above calculated start angles into a number of uS in the future (Eg if injector should start opening at 45\* ATDC and the crank angle is currently 10\*BTDC, how long will it take to travel those 55\*)
- Perform the same schedule setting for each ignition output
- Проверка наличия запроса в последовательном буфере для обработки
- Проверяется, вращается ли двигатель, контролируя когда в последний раз был замечен зуб реперного диска коленвала
- Считывание значений со всех аналоговых датчиков (TPS, IAT, CLT, MAP, O2, Battery voltage). Не все датчики считываются по каждому циклу, так как данные с датчиков не меняются достаточно часто
- Следующие функции выполняются только в том случае, если обработчик имеет 'sync':
- Проверьте, не превышает ли частота вращения порог прокрутки (При прокрутке при запуске двигателя значения топлива и зажигания регулируются)
- Выполните все функции корректировки (см. раздел corrections.ino ниже). Результатом этого является %, на который будет регулироваться ширина пульса (100% = без регулировки, 110% = 10% больше топлива, 90% = 10% меньше топлива).
- Поиск VE (объемной эффективности) из основной топливной таблицы
- Преобразование VE в значение ширины пульса в милисекундах
- Поиск требуемого опережения из таблицы зажигания
- Рассчитать текущий угол коленвала
- Рассчитать угол поворота кривошипа, при котором каждый инжектор должен открываться, исходя из текущей частоты вращения двигателя
- Рассчитать угол выдержки на основе требуемого времени выдержки и текущей частоты вращения двигателя
- Вычислить угол начала зажигания для каждого цилиндра путем вычитания угла опережения и угла задержки из угла TDC (ВМТ)
- Установите "график" для каждого инжектора, преобразовав вышеуказанные вычисленные начальные углы в число uS в будущем (например, если инжектор должен начать открываться при 45\* ATDC, а угол поворота кривошипа в настоящее время составляет 10\* BTDC, сколько времени потребуется для перемещения этих 55\*)
- Выполните одну и ту же настройку графика для каждого выхода зажигания