Simulation of a motor with puls-switch

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
vleeuwen
Beiträge: 1565
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Simulation of a motor with puls-switch

Beitrag von vleeuwen » 18 Apr 2020, 11:48

I was busy with creating a complete simulation of the Teachin software.
This because like to see what is happening without the mechanical problems of the real model.
RoboPro can run in simulation mode. However in that mode the combination of a motor and a puls- switch does not work anymore.

So I created a simulation for a motor-switch combination and now the software can run in simulation mode too.
Now my software can run and tested without the presents of a TXT-controller.

This also is an illustration and example about the use of command filters.

The duration of the puls can be controlled, with a slower puls it is easier to follow the workflow
The complete simulation
The simulation
The simulation
MotorSimulation01.JPG (111.83 KiB) 1601 mal betrachtet
The motor react on the motor commands CW, CCW and stop. These commands has been transferred into values.
The stop has no value, so I add the 0.
The decomposition of the motor commands
The decomposition of the motor commands
MotorSimulation02.JPG (58.32 KiB) 1601 mal betrachtet
The RoboPRo ABS function does not work for integers so I create a work around for this problem/bug.
The workaround for the RoboPro ABS
The workaround for the RoboPro ABS
MotorSimulation03.JPG (44.22 KiB) 1601 mal betrachtet
=================Google translate=====================
Ik was bezig met het maken van een complete simulatie van de Teachin-software.
Dit omdat ik graag wil zien wat er gebeurt zonder de mechanische problemen van het echte model.
RoboPro kan in simulatiemodus draaien. In die modus werkt de combinatie van een motor en een pulsschakelaar echter niet meer.
Dus ik heb een simulatie gemaakt voor een motor-schakelaar combinatie en nu kan de software ook in simulatiemodus draaien.
Nu kan mijn software draaien en testen zonder de cadeautjes van een TXT-controller.
Dit is ook een illustratie en voorbeeld over het gebruik van opdrachtfilters.
De duur van de puls is regelbaar, bij een langzamere puls is het makkelijker om de workflow te volgen
De complete simulatie
De motor reageert op de motoropdrachten CW, CCW en stopt. Deze opdrachten zijn omgezet in waarden.
De stop heeft geen waarde, dus ik tel de 0 op.
De RoboPRo ABS-functie werkt niet voor gehele getallen, dus ik maak een oplossing voor dit probleem / deze bug.
==========================
Ich war damit beschäftigt, eine vollständige Simulation der Teachin-Software zu erstellen.
Dies liegt daran, gerne zu sehen, was ohne die mechanischen Probleme des realen Modells passiert.
RoboPro kann im Simulationsmodus ausgeführt werden. In diesem Modus funktioniert die Kombination aus Motor und Impulsschalter jedoch nicht mehr.
Also habe ich eine Simulation für eine Motor-Schalter-Kombination erstellt und jetzt kann die Software auch im Simulationsmodus ausgeführt werden.
Jetzt kann meine Software ohne die Geschenke eines TXT-Controllers ausgeführt und getestet werden.
Dies ist auch eine Illustration und ein Beispiel für die Verwendung von Befehlsfiltern.
Die Dauer des Impulses kann gesteuert werden. Mit einem langsameren Impuls ist es einfacher, dem Arbeitsablauf zu folgen
Die komplette Simulation
Der Motor reagiert auf die Motorbefehle CW, CCW und Stop. Diese Befehle wurden in Werte übertragen.
Der Stopp hat keinen Wert, also addiere ich die 0.
Die RoboPRo ABS-Funktion funktioniert nicht für ganze Zahlen, daher erstelle ich eine Problemumgehung für dieses Problem / diesen Fehler.

vleeuwen
Beiträge: 1565
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Simulation of a motor with puls-switch

Beitrag von vleeuwen » 18 Apr 2020, 22:11

As an alternative for the motor simulation.
This example shows the use of the "8.2.4 Wait for command" RoboPro element.
alternative for the motor simulation
alternative for the motor simulation
MotorSimulation04.JPG (150.47 KiB) 1528 mal betrachtet

vleeuwen
Beiträge: 1565
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Simulation of a motor with puls-switch

Beitrag von vleeuwen » 19 Apr 2020, 10:51

I imagine that novice RoboPro users are wondering "How can I develop a subroutine like the motor simulator myself?".
Or that a teacher wonders "How can I integrate this in my teaching?".
The RoboPro siumulation mode offers many possibilities for this.
Here is an example and some tips:
Work problem-driven and with a "Systematic Problem Approach"
It starts with an idea and writing down the associated objectives:
a) I need a subroutine with a data input that can handle the 3 motor command => CW, CCW and STOP.
b) The data output must be a clock pulse (0 1 0) with a frequency related to the power levels (1..8, -1 ..- 8)
No pulses with a stop command.
c) There is a need for an easy way to slow down the frequency. This allows me to observe the behavior of the system.

The first step is to analyze the 3 basic motor commands (CW,CCW, Stop):
What is a command and which RoboPro elements are available to deal with these commands?
What is the different between a value and a command?

The next step is to setup and to run some experiments to test the behavior of these commands in practice and also execute some experiment with it.

I myself have worked with the following small RoboPro program, my program to test my algorithmes.
This test program has been developed during my experiments. In the beginning it was rather small.
This simple RoboPro program runs in the simulation mode of RoboPRo, I don't need any hardware (TXT, motor, sensors).
Using this simulation mode also makes it much easier to use RoboPro in a classroom.
impression
impression
MotorSimulation05.JPG (163.53 KiB) 1484 mal betrachtet
After this experimental phase follows the phase to construct a good RoboPro subroutine.

For use in education, I am also busy with expanding the Robot Teachin application with a simulation part.
This makes this software more useful for use in educational situations. Children/students can also use this software at home to study.
===============================Google translate=======================================
Ik stel me voor dat beginnende RoboPro-gebruikers zich afvragen hoe ik zelf een subroutine zoals de motorsimulator kan ontwikkelen?
Of dat een leraar zich afvraagt ​​"Hoe kan ik dit in mijn onderwijs opnemen?".
De RoboPro siumulatiemodus biedt hiervoor veel mogelijkheden.
Hier is een voorbeeld en enkele tips:
Probleemgestuurd werken en met een "systematische probleembenadering"
Het begint met een idee en het opschrijven van de bijbehorende doelstellingen:
a) Ik heb een subroutine nodig met een gegevensinvoer die het 3-motorige commando => CW, CCW en STOP aankan.
b) De gegevensuitvoer moet een klokpuls zijn (0 1 0) met een frequentie die gerelateerd is aan de vermogensniveaus (1..8, -1 ..- 8)
Geen pulsen met een stopcommando.
c) Er is behoefte aan een gemakkelijke manier om de frequentie te vertragen. Hiermee kan ik het gedrag van het systeem observeren.

De eerste stap is het analyseren van het motorcommando,
Wat is een commando en welke RoboPro-elementen zijn beschikbaar om met deze commando's om te gaan?

De volgende stap is het uitvoeren van enkele experimenten om het gedrag van deze opdrachten in de praktijk te testen.
En om ermee te kunnen experimenteer.

Ik heb zelf met het volgende kleine RoboPro-programma gewerkt.
Dit testprogramma is ontwikkeld tijdens mijn experimenten.
Dit eenvoudige RoboPro-programma draait in de simulatiemodus van RoboPRo, ik heb geen hardware nodig (TXT, motor, sensoren).
Het gebruik van deze simulatiemodus maakt het ook veel gemakkelijker om RoboPro in een klaslokaal te gebruiken.

Na het experimenteren volgt de stap om hiervan een ​​goede RoboPro-subroutine te construeren.
Er is dus een expliciet onderscheid tussen de onderzoek en constructie van de oplossing.

Voor gebruik in het onderwijs ben ik oom bezig met het uitbreiden van de Robot Teachin applicatie uit met een simulatie gedeelte.
Dit maakt deze software beter bruikbaar voor educatieve toepassingen.
Kinderen/studenten kunnen deze software dan thuis voor zelfstudie gebruiken.
=====================================================================================
Ich stelle mir unerfahrene RoboPro-Benutzer vor, die sich fragen, wie ich selbst ein Unterprogramm wie den Motorsimulator entwickeln kann.
Oder dass sich ein Lehrer fragt: "Wie kann ich das in meinen Unterricht einbeziehen?".
Der RoboPro-Siumulationsmodus bietet hierfür viele Möglichkeiten.
Hier ist ein Beispiel und einige Tipps:
Arbeiten Sie problemorientiert und mit einem "systematischen Problemansatz"
Es beginnt mit einer Idee und dem Aufschreiben der damit verbundenen Ziele:
a) Ich benötige ein Unterprogramm mit einer Dateneingabe, das den 3-Motor-Befehl => CW, CCW und STOP verarbeiten kann.
b) Der Datenausgang muss ein Takt (0 1 0) mit einer Frequenz sein, die sich auf die Leistungspegel bezieht (1..8, -1 ..- 8).
Keine Impulse mit einem Stoppbefehl.
c) Es besteht ein Bedarf an einer einfachen Möglichkeit, die Frequenz zu verlangsamen. Dadurch kann ich das Verhalten des Systems beobachten.

Der erste Schritt ist die Analyse des Motorbefehls.
Was ist ein Befehl und welche RoboPro-Elemente stehen für diese Befehle zur Verfügung?

Der nächste Schritt besteht darin, einige Experimente durchzuführen, um das Verhalten dieser Befehle in der Praxis zu testen. Und experimentiere damit.

Ich selbst habe mit dem folgenden kleinen RoboPro-Programm gearbeitet.
Dieses Testprogramm wurde während meiner Experimente entwickelt.
Dieses einfache RoboPro-Programm läuft im Simulationsmodus von RoboPRo. Ich benötige keine Hardware (TXT, Motor, Sensoren).
Die Verwendung dieses Simulationsmodus erleichtert auch die Verwendung von RoboPro in einem Klassenzimmer erheblich.

Nach dem Experiment folgt der Schritt, um eine gute RoboPro-Subroutine zu erstellen.

Für den Einsatz in der Bildung erweitere ich auch die Robot Teachin-Anwendung um einen Simulationsteil.
Dies macht diese Software für die Verwendung in Bildungsprogrammen nützlicher. Kinder / Schüler können diese Software auch zu Hause zum Lernen verwenden.

Antworten