Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
es
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Gerwinski
es
Commits
7874e080
Commit
7874e080
authored
3 years ago
by
Peter Gerwinski
Browse files
Options
Downloads
Patches
Plain Diff
Ergänzungen und Quelltextauszug 18.11.2021
parent
c4ecdbc7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
20211118/es-20211118.pdf
+0
-0
0 additions, 0 deletions
20211118/es-20211118.pdf
20211118/es-20211118.tex
+102
-0
102 additions, 0 deletions
20211118/es-20211118.tex
20211118/loop-time.cpp
+33
-0
33 additions, 0 deletions
20211118/loop-time.cpp
with
135 additions
and
0 deletions
20211118/es-20211118.pdf
+
0
−
0
View file @
7874e080
No preview for this file type
This diff is collapsed.
Click to expand it.
20211118/es-20211118.tex
+
102
−
0
View file @
7874e080
...
@@ -676,6 +676,108 @@
...
@@ -676,6 +676,108 @@
ansonsten zyklisch einer von bis zu 5 weiteren Tasks.
ansonsten zyklisch einer von bis zu 5 weiteren Tasks.
\end{itemize}
\end{itemize}
\pause
RP6-Steuerung
\begin{itemize}
\item
Konfiguration durch bedingte Compilierung (Präprozessor)
\item
Lichtschranken an Encoder-Scheiben lösen bei Bewegung Interrupts aus.
\\
Die Interrupt-Handler zählen Variable hoch.
\item
10000mal pro Sekunde: Timer-Interrupt
\\
Durch Zähler im Interrupt-Handler: verschiedene Taktraten
\\
1000mal pro Sekunde: Stopwatches
\\
5mal pro Sekunde: Blinkende Power-On-LED
\\
1000mal pro Sekunde: Bumper, ACS, PWM zur Motorsteuerung
\\
Geschwindigkeitsmessung durch Zählen der Ticks in 0.2
\,
s
\\
Anpassung der Motorkraft in
$
\pm
$
1-Schritten
\pause
\item
Nebenbei:
\only
<4->
{
1
}
Benutzerprogramm
\end{itemize}
\end{frame}
\subsection
{
Multitasking
}
\begin{frame}
\showsubsection
\begin{itemize}
\item
\newterm
{
Kooperatives Multitasking
}
\\
Prozesse geben freiwillig Rechenzeit ab
\item
\newterm
{
Präemptives Multitasking
}
\\
Das Betriebssystem unterbricht laufende Prozesse
\\
(englisch:
\emph
{
to pre-empt
\/
}
-- jemandem zuvorkommen)
\pause
\bigskip
\item
\newterm
{
Scheduler
}
\\
Steuerprogramm, das Prozessen Rechenzeit zuteilt
\item
\newterm
{
Kontextwechsel
}
\\
Umschalten zwischen zwei Prozessen
\item
\newterm
{
Round-Robin-Verfahren (Rundlauf)
}
\\
Zuteilung von
\newterm
{
Zeitschlitzen
\/
}
auf einer
\newterm
{
Zeitscheibe
}
an die Prozesse
\bigskip
\pause
\item
Ausblick: Zuteilung von Rechenzeit = wichtiger Spezialfall
\\
allgemein: Zuteilung von Ressourcen
\end{itemize}
\end{frame}
\subsectionnonumber
{
Beispiele für Multitasking
}
\begin{frame}
\showsubsectionnonumber
Quadrocopter-Steuerung
\emph
{
MultiWii
}
\begin{itemize}
\item
Konfiguration durch bedingte Compilierung (Präprozessor)
\item
In der Hauptschleife wird 50mal pro Sekunde der RC-Task aufgerufen,
\\
ansonsten zyklisch einer von bis zu 5 weiteren Tasks.
\end{itemize}
RP6-Steuerung
\begin{itemize}
\item
Konfiguration durch bedingte Compilierung (Präprozessor)
\item
Lichtschranken an Encoder-Scheiben lösen bei Bewegung Interrupts aus.
\\
Die Interrupt-Handler zählen Variable hoch.
\item
10000mal pro Sekunde: Timer-Interrupt
\\
verschiedene Tasks werden unterschiedlich häufig aufgerufen
\item
Nebenbei: 1 Benutzerprogramm
\end{itemize}
% \pause
%
% Linux 0.01
% \begin{itemize}
% \item
% Timer-Interrupt:\only<2->{ Zähler des aktuellen Tasks wird dekrementiert;}\\
% Task mit höchstem Zähler bekommt Rechenzeit.
% \item
% Wenn es keinen laufbereiten Task mit positivem Zähler gibt,\\
% bekommen alle Tasks gemäß ihrer Priorität neue Zähler zugewiesen.
% \item
% \emph{keine\/} harte Echtzeit
% % Aufgabe: Wo wird der Zähler heruntergezählt?
% \end{itemize}
\end{frame}
\end{frame}
\end{document}
\end{document}
This diff is collapsed.
Click to expand it.
20211118/loop-time.cpp
0 → 100644
+
33
−
0
View file @
7874e080
while
(
1
)
{
currentTime
=
micros
();
cycleTime
=
currentTime
-
previousTime
;
#if defined(LOOP_TIME)
if
(
cycleTime
>=
LOOP_TIME
)
break
;
#else
break
;
#endif
}
previousTime
=
currentTime
;
currentTime
=
micros
();
#if defined(LOOP_TIME)
cycleTime
=
currentTime
-
previousTime
;
while
(
cycleTime
<
LOOP_TIME
)
{
currentTime
=
micros
();
cycleTime
=
currentTime
-
previousTime
;
}
#endif
previousTime
=
currentTime
;
#if defined(LOOP_TIME)
while
((
currentTime
=
micros
())
-
previousTime
<
LOOP_TIME
)
;
/* do nothing */
previousTime
=
currentTime
;
#else
currentTime
=
micros
();
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment