Lego-Fischertechnik.

Fussballroboter, Autofabrik...
Modellideas &- presentation - Soccerrobot, Carfactory...
Forumsregeln
Bitte beachte die Forumsregeln!
fotoopa
Beiträge: 312
Registriert: 05 Okt 2017, 11:44
Wohnort: Belgie
Kontaktdaten:

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 14 Nov 2022, 19:08

Sending multiple commands from the Fischertechnic TXT to the Lego hubs.

I use the color sensor on the Lego hub for this and the CMDs via the TXT PC screen buttons. The TXT sends the color data to the neo LEDs over an I2C connection. So with 1 color sensor, different commands can be recognized. With the scope I measured the delay. The scope is connected to the I2C line ( 2 channels) of the TXT and also to the Lego hub pin5 output (1 channel). A small Python program on the Lego side provides the feedback in this way. The delay is about 16 msec, values between 12 and 25 msec. The light pulse of the TXT is 25 to 30 msec. The TXT program is set to 25 msec. By reducing this value, you can easily see when the hub does not always respond to the narrow pulse. For the neoleds, I use a short string of 3 consecutive LEDs. The distance between the sensor and the neoleds is not critical. This measurement confirmed that the response times of the TXT and the Lego hub are quite small.
Here in the example I use 3 different colors but you can use more. For the color value of the neo LEDs you may have to do some searching. But the basic colors red, blue and green always work. Also the brightness for this is not critical.

The picture is a UHD image. So you can zoom in nicely to all the details.
BildI2C-to-hub-delay by Frans, on Flickr

Frans

fotoopa
Beiträge: 312
Registriert: 05 Okt 2017, 11:44
Wohnort: Belgie
Kontaktdaten:

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 17 Nov 2022, 11:41

Herewith a small test to enable the hub to hub in Pybricks Python while waiting for them to have the Pybricks hub to hub software available. This setup uses the internal hub1 color LED. This makes 4 commands available by using the colors Red, Green, Blue and None. Detection is done by a color sensor connected to hub2 and mounted on hub1. 2 Python programs are used. The communication is very fast. De typical delay between hub1 and hub2 is 25 msec, min 10msec max 50 msec.

BildTechnic-hub-to-hub_setup by Frans, on Flickr

The 2 Pybricks Python programs:

BildTechnic-hub-to-hub by Frans, on Flickr

Now to make the TXT also work together it can be done with the remote control as I have already indicated. Thus, the TXT can also control both Lego hubs. Since this is done through the remote, all ports of the hub remain available.
The big general problem with the Lego hubs is that they do not have their own digital input module where multiple inputs are available. For this, the TXT is much better equipped. But Lego has very good motors with built-in absolute encoder. We are missing something like that with FT. The FT encoder motor does not have its own encoder, only 1 pulse generator. Which is not absolute.
Also, the software at Lego always remains a weak point. They did add hub to hub now but you then have other limitations.

For now, for Lego, I still feel best with Pybricks Python which is in full development and where you have very regular updates of new beta versions. On the other hand, I am extremely satisfied with the TXT RoboPro software which is very well suited to handle multiple tasks.

You see so both systems have their strengths. Hence it is still a nice challenge to make both systems work together in a larger project. The hardware cost of the Lego Technic version is very low, with €25 you have a hub with 4 ports. Motors and sensors are cheapest if you can buy optimal sets. For example, they will supply me today the Lego set 42114 at the exceptionally low price of €130. There is the Technic hub , also 3 absolute encoder motors, along with almost 2100 pieces. Much work remains for further experimentation.

Frans.

Antworten