Mit RoboPro und TXC Impulse messen

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
Benutzeravatar
Tim
Beiträge: 30
Registriert: 27 Dez 2010, 16:40
Wohnort: Hattingen
Kontaktdaten:

Mit RoboPro und TXC Impulse messen

Beitrag von Tim » 16 Feb 2011, 13:40

Hallo Community,

ich würde für meine Modelle gerne ein Kompassmodul wie dieses hier verwenden.

Inder Produktbeschreibung steht das die Signale auf zwei Arten ausgegeben werden können:

# Ausgangssignal 1: Signalpuls von einer 1ms bis 37ms in 0.1ms Schritten. Die Länge des Signales ergibt somit den Grad Wert 0 bis 360 Grad
# Ausgangssignal 2: Das der beliebte I2C Bus. Hier kann die Richtung entweder in dem Bereich von 0 bis 255 oder dem Wertebereich von 0 bis 3599 abgerufen werden.

Da Fischertechnik ja meines Wissens nach die I²C Implementierung für den TXC noch nicht abgeschlossen hat, bleibt mir ja eigentlich nur Möglichkeit 1.
Deswegen meine Frage, ist es möglich mit Robo Pro und dem TXC Impulse wie diese zu messen.

Vielen Dank im Vorraus

niekerk
Beiträge: 25
Registriert: 01 Nov 2010, 00:04
Wohnort: Eindhoven

Re: Mit RoboPro und TXC Impulse messen

Beitrag von niekerk » 16 Feb 2011, 20:56

Hello Tim,

I have the same compass module, and I had it connected to the Robo Interface through an intermediate micro
controller on the serial port. Technically, when you're a software engineer / hobbyist, you could measure pulse
width using the Fast Counter input of the Robo Interface, but you would have to write your own program for that.
On the positive side: no further electronics would be needed.

But your question was about the TX, and I'm sorry, but you'll have to wait for I2C. The TX controller is a very
closed system, and some of the processing power is actually used to make sure that you can only do what
ft allows you to do. An advanced hobbyist could create an extension for the RS485 bus, as Ad did, and
connect the compass module via the extension to the TX.

While waiting is easy, I sometimes get a bit tired of it :(

Paul

hamlet
Beiträge: 332
Registriert: 12 Jan 2011, 21:41

Re: Mit RoboPro und TXC Impulse messen

Beitrag von hamlet » 16 Feb 2011, 20:58

Hallo Tim,
die Messung einer Pulslänge im Bereich von wenigen ms ist hart an der Grenze, was mit dem TX in Verbindung mit RoboPro zu realisieren ist. In der Computing FAQ auf der fischertechnik Seite wird die Samplingrate der Analogeingänge mit 1/10ms angegeben. => Das ist für Deine Anwendung unbrauchbar. Ich bin allerdings fast sicher, dass die Zählereingänge jede ms ausgewertet werden. Eine grobe Messung ließe sich evtl. wie folgt realisieren (falls der Baustein mit den Zählereingängen kompatibel ist):
- Warten auf steigende Flanke des Zählereingangs
- Timervariable mit 1ms-Auflösung mit einem Wert > 37 initialisieren
- Warten auf fallende Flanke des Zählereingangs
- Differenz des aktuellen und des Initialwerts des Zählers bilden => Winkel mit ca. 10° Auflösung
Das funktioniert -- wenn überhaupt -- nur lokal auf dem RoboController, da im Onlinebetrieb die Messwerte nur ca. alle 15ms (USB) bzw. 30ms (BT) und mit gewaltigem jitter an den PC gesendet werden. Die gesampelten Werte sind, soweit ich weiß, leider nicht mit einem genauen Zeitstempel versehen. Die Zeitmessung läuft vom Sampling völlig entkoppelt mittels der RooPro-Timer auf dem PC. => Im Onlinebetrieb ist da keine Messung mehr möglich.

Beste Grüße,
Helmut

hamlet
Beiträge: 332
Registriert: 12 Jan 2011, 21:41

Re: Mit RoboPro und TXC Impulse messen

Beitrag von hamlet » 16 Feb 2011, 21:11

Kleine Korrektur:
- Differenz des aktuellen und des Initialwerts des Timers bilden => Winkel mit ca. 10° Auflösung

Benutzeravatar
Tim
Beiträge: 30
Registriert: 27 Dez 2010, 16:40
Wohnort: Hattingen
Kontaktdaten:

Re: Mit RoboPro und TXC Impulse messen

Beitrag von Tim » 23 Feb 2011, 09:33

So I use the Arduino to evaluate the data from the compas modul and convert it for example to a analog signal.
But why I need a potentiometer to use it with the TXC?

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

Re: Mit RoboPro und TXC Impulse messen

Beitrag von vleeuwen » 23 Feb 2011, 11:50

To have communication between a microcontroller board and the TX-C.
Otherwise this will cost you a couple of Ix inputs. Now it will cost you one analogue input.
(Conversion digital to analogue <=> TX-C analogue to digital at least 8 bits precession in not to difficult to obtain.
So with a digital potentiometer you are able to sent bytes to the TX-C)

See for example the possibilities offer by the LEGO-brick

With microcontroller boards like the Arduino or the Microchip Explorer16 you are able to build more complex sensor/actuator system.
The problem is the communication between the TX-C and that board.
-) I2C is not yet on the TX-C available and probably it will be a light implementation
-) The RS485 bus on the TX-C is official not documented (although some expert are using it for the communication with a microcontroller board)
-) The BT communication protocol on the TX-C is not documented either
-) The camera bus on the TX-C is not documented or available for communication.

With the old Robo Interface this communication is much simpler.
The Radio call protocol on the RS232 bus is documented.
So it is very easy to have communication between the Robo Interface and a board.
Because the Radio Call mechanism is part of RoboPro, this communication is possible from your RoboPro program.
For example Robo interface connected to a microconroller based webserver.

niekerk
Beiträge: 25
Registriert: 01 Nov 2010, 00:04
Wohnort: Eindhoven

Re: Mit RoboPro und TXC Impulse messen

Beitrag von niekerk » 02 Okt 2011, 23:20

@all,

At the Convention 2011 I was showing my fischertechnik compass, consisting
of a RoboInterface and the electronic compass module CMPS03 from Devantech.
The CMPS03 PWM output was interfaced to the Fast Counter Input of the
RoboInterface. A small C program accurately measures the pulse length of
the signal on the Fast Counter Input, and lights the bulb facing North.

Note that the pulse length measurement is very accurate with a resolution
of 2 us. This is far more accurate than the resolution of the PWM output,
which is 0.1 ms. And in the final step of mapping this value onto just 8
lamps, a lot of accuracy and resolution is lost again. It's just a very simple
example of what can be done.

In the 'BilderPool' you can see some pictures of the fischertechnik compass:

http://ftcommunity.de/details.php?image_id=31997

http://ftcommunity.de/details.php?image_id=32642

Bild

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

Re: Mit RoboPro und TXC Impulse messen

Beitrag von vleeuwen » 03 Okt 2011, 10:56

In LinkedIn we have a "I like it" button.
This is missing in this forum.

:D I like this Paul. :D

Antworten