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 » 16 Mär 2022, 19:55

MasterOfGizmo hat geschrieben:
16 Mär 2022, 19:51
Your FPGA board is also manufactured in china ...
Yes idd but it is about ordering and paying. That FPGA was ordered from Mouser. It's about how to make payments.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 24 Mär 2022, 15:12

Lego hub monitoring for the Mindstorms 51515.

A brief update:

BildLego Hub monitoring for the PC. by Frans, on Flickr

With this interface I can now intercept all 6 hub signals. The information obtained is the same as what Lego reads. It can't be done any faster. No program needs to be written. The hub itself looks at powerup to see what is connected. After auto configuration, the connected device transmits its data continuously. This happens upon request of the hub (every 100 msec) or upon internal change of the data values. The data transmission depends on the device type. This varies from 20 msec to every 1 msec. The FPGA can very quickly process all data from the 6 hubs and make it available in registers. Also, the FPGA can execute commands. For this I do need to use one of the hubs lines. Normally this will be hubE. Because the FPGA stores every data change in registers, they are also available to the TXT Controller of Fischertechnik. Results can now be displayed on a large monitor via the PC. If necessary, I can selectively turn the measurement leads on and off via a jumper. On the pcb there are also some resistors for impedance adjustment. I use twisted pair cable for the signals.

The picoscope is connected via the FPGA module. Through the Picoscope, I can view up to 4 hub signals at any given time. There I see all the data appearing from the 115200 baud lines. On the FPGA keypad I can select which hub I want to monitor on the scope. All data up to 10 sec deep I can monitor this way.

The problem of the extension cables I solved myself by cutting the flat cables of the devices in the middle and reconnecting them with 6-pin low-cost connectors. This way I can make extension cables myself. This was really necessary because with the 25cm of existing cables I could not work any further. The only drawback is that you have to check for yourself if the connectors are connected correctly. For this I have of each cable pin1 marked with a black stroke

Now I can continue working on a practical application with Lego and Fischertechnik. You may expect new information from this soon.

Frans.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 28 Mär 2022, 18:30

Lego en Fischertechnik connected.

BildLego Mindstorms and Fischertechnik by Frans, on Flickr

This is a screen dump of the data from Lego and Fischertechnik together. All values of the 6 hubs can be read out real time by listening on the serial communication lines. These results are stored in a register array in the FPGA. In this way, the results are available to the Fischertechnik TXT Controller via the RoboPro program. The results are displayed realtime on the PC screen. The motors, servos and analog values of the DE0-NanO-Soc module are also available in this way. The recording speed is the same as Lego's internal hub speed.

The FPGA reads the data sent by the device on the hub at the same time. In this way the color that the color sensor reads can be displayed on the PC screen. Also the leds of the distance sensor are transmitted in this way. With these leds you can send commands to the FT-program. You can easily control these leds in a Lego program. The Fischertechnik program is here primarily as a GUI interface of all Lego hub values. But extending it further can make the working together of FT and Lego easy. If a lot of commands have to be used and in both directions then it is better with a serial line on one of the hubs. For this I will use HubE. This leaves only 5 hubs for the Lego devices. I have no Bluetooth available on my current FPGA code. Hence I have to extend via the serial line.

Frans

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Lego-Fischertechnik.

Beitrag von MasterOfGizmo » 30 Mär 2022, 09:55

You might like this:
https://www.raspberrypi.com/products/build-hat/

I am sure it can easily be controlled from your FPGA.

It can e.g. be ordered from reichelt.de
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 30 Mär 2022, 10:09

MasterOfGizmo hat geschrieben:
30 Mär 2022, 09:55
You might like this:
https://www.raspberrypi.com/products/build-hat/

I am sure it can easily be controlled from your FPGA.
I already use it for the 4 connectors. I disconnected the connector connections from the logic and soldered flat cables on. I don't use the logic, just destroyed it with the dremmel tool.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 06 Apr 2022, 12:36

Lego and Fischertechnik linked together.
This is a nice link between Lego and the TXT Controller.
All 6 ports of the Lego hub are connected to the DE0-Nano-Soc module. This allows all data from Lego to be monitored. Many results can be displayed via the Fischer TXT controller. This is done via a simple program with the RoboPro software. The TXT Controller has a very nice feature where you can make a logging of the signals. This allows you to visualize the data in real time on the PC screen. All lego ports operate at 115200 baud rate. On the Lego side, you do not need to write a program for this because the data logging is done at low level. This is the same data the hub receives from the motors and sensors.

I use the port hubE for serial data exchange between the two systems. Everything is written in Python because in blocks not everything is available. For this serial connection I do need to write a bit of software. A small problem is the configuration at the first startup of the program. Lego uses an auto config system so the port is not ready for serial connections. I need to place an additional delay. Once started up you would no longer need the delay. I now use a delay of 1sec for this. If nothing was found at startup Lego searches every 500 msec for a new configuration. Once you have configured the port as serial everything is solved.

In the Python example, I sent some commands to the FPGA module ($D5). The Pico-scope 2406B is also always connected to the FPGA module. The 4 scope channels can be selected from 4x8 signal sources via the keyboard on the module. This scope thus also has real-time access to all Lego data. I use this mainly for time analysis and for testing the Python programs. In the video you can see how the data is displayed in real time by the TXT. You can see the motor displacement, the motor speed and direction, the sensor distance and the status of the 4 LEDs on the sensor. The leds are turned on and off at certain times. You can see that in the Python program and in the video itself.

BildLego and Fischertechnik linked together. by Frans, on Flickr

The Python program:

Bildpython-prog-distance-diagram by Frans, on Flickr

And a short video:
BildLego and Fischertechnik by Frans, on Flickr

Update:
RoboPro program added.
BildFT program for Lego interface by Frans, on Flickr

Frans

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 11 Apr 2022, 11:28

Adapters FT-Lego.
To use both motors together, a number of adapters are needed. For example, a FT chain can be placed on a Lego motor and and a Lego chain can be placed on a FT motor. Now we can really start using both systems together. Attaching a Lego part to a Fischertechnik grid is also now possible.

BildAdapters FT-Lego by Frans, on Flickr

Frans.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 13 Apr 2022, 11:44

Adapter for FT-Lego parts. Via 3D print of the Lego frames 7x11.
BildDSC07899 by Frans, on Flickr
Frans.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 13 Apr 2022, 19:41

BildDSC07923-ketting by Frans, on Flickr
Some parts are done via 6D printing.
Frans

Benutzeravatar
rubem
Beiträge: 240
Registriert: 10 Feb 2014, 17:45
Wohnort: Porto Alegre, RS, Brasil

Re: Lego-Fischertechnik.

Beitrag von rubem » 13 Apr 2022, 19:48

Hi fotoopa,

Wow, nice! Many possibilities ahead.

Thanks for the nice pictures, please keep them coming.

Best regards,

Rubem

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 15 Apr 2022, 19:26

Thanks Rubem, There are definitely more images to come.

Here is a new test today to link both systems.

BildDSC07979-Lego-FT-set by Frans, on Flickr

Test setup interface Lego - Fischertechnic.

Via 3D printing, a number of additional blocks are being printed to connect the two systems. Now modules can be coupled in both directions. Because FT motors have no absolute encoder I use a proprietary encoder disc with hall detectors. Via quadrature decoding I have 32 pulses/revolution. On the Lego chain, I use small pins that are secured via a screw M2.5x8mm. They are now printed yellow but in the future I will print them black to work better together with the color sensor.
Step by step we go through...

Frans.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 20 Apr 2022, 15:42

Some additional 3D printed adaptors for Lego and Fischertechnik.
The next step is a small application. I am in the process of preparing it.

BildDSC08007 by Frans, on Flickr

BildDSC07980 by Frans, on Flickr

Both systems have certain advantages. It is now a matter of presenting these in a working solution.

Frans.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 25 Apr 2022, 16:22

First small application of the Lego Mindstorms hub. I am also using parts from Fischertechnik for construction here. The base plate is a FT plate. To build FT and Lego parts together I made some adaptors via 3D printing. This way the grid problem between FT (15mm) and Lego (16mm) can be solved. You could also build this application with Lego parts only but that is not my intention. I was able to solve a number of problems during construction. To be able to use more FT modules I first have to cut the flat cables of all the motors and connect them via 6 pin connectors. This way I can increase the distance between hub and motor. Then I can also re-enable my interface which can listen to all Lego Uart signals. From that moment on I can let FT and Lego fully interact with each other.
First the setup:

BildDSC08056-sorting-balls by Frans, on Flickr

Then the program:

BildSorting-colored-balls by Frans, on Flickr

And the video:

BildLego Sorting 14mm balls by Frans, on Flickr

The following application will use both hardware modules FT and Lego and the PC screen as the GUI.

Frans.

atzensepp
Beiträge: 658
Registriert: 10 Jul 2012, 21:40
Wohnort: Uttenreuth

Re: Lego-Fischertechnik.

Beitrag von atzensepp » 25 Apr 2022, 21:42

Hello Frans,

again this is a very nice model. I like the idea combining the two worlds of ft and lego. It is lived "design thinking" principles: "Yes And" instead of "Either Or". The lego motors have built-in encoders that makes it easier.

Some of the lego technic parts would be great to have them in ft as well. As you have shown one can create some adapters or get inspirations for ft-ized versions.

Florian

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 26 Apr 2022, 16:00

Thanks Florian for your response.
There are advantages in both systems and as always there are those who will complain about the new modules. I see those reactions in both groups.
However, I do enjoy each specific benefit. To date few are taking this step to make both systems work together. I am not a model builder, I look more for the technology. Also 3D parts printing keeps me busy.
With Lego, you have far fewer inputs with the new Mindstorms. With FT you have a lot more. I am speaking here for the new Mindstorms 51515 hub. But the biggest asset for me is the GUI via RoboPro on the PC screen. The I2C bus is an important element in this. However, Lego has very good motor types with absolute built-in encoders. This makes positioning quite easy and precise. FT parts you move in all directions, Lego is mostly grid based.

Since I am not a bluetooth user with FT, the connection between FT and Lego has to be serial for me. I do use bluetooth for the Lego with their Mindstorms program. The number of Lego parts I own now is still quite low. This still limits me when building. Just like I did before with FT I now look which kits have the most parts for the lowest price. Sometimes older kits are beneficial for this. I should not buy Lego kits that have old type motors in them. I only want to use the new type.
There remains some work to be done....
Frans

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 02 Mai 2022, 15:32

Gripper module for 14 mm balls Version 2.
In this version, the Z axis works much faster. It is now driven directly by the motor.
foto:
BildDSC08092-gripper-module by Frans, on Flickr

Video:
BildBall gripper module by Frans, on Flickr

Here, only a few FT parts are used for the moment. The intention is to expand it further into a larger project. That will include the TXT Controller as well. The gripper itself is 3D printed.
Frans.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 10 Okt 2022, 11:18

Finally I can continue working again. My eyes are seeing better again after some operations.
I have now also bought the Lego technic hub ( €25) and the remote control (€17). They are quite cheap to find at the moment.
The technic hub can only work with the battery box. You have to take the batteries out to recharge them. Very annoying especially if you just want to run tests. I now use Pybricks python for this. Now I replaced the battery box with a 3D printed box with an external connection plug for a 9V adaptor. If you want to go back to the battery box you just swap both. The basic cover plate remains the same.
Some pictures give an overview of how I made this.

Bildtechnic hub powered by Frans, on Flickr

Bildpowerbox-3D-view by Frans, on Flickr

Bildhub pcb by Frans, on Flickr

Bildhub pcb en wires by Frans, on Flickr

Bildhub input power side by Frans, on Flickr

Bildhub electodes by Frans, on Flickr


As a power adaptor I use the Fischertechnic adaptor of 9V 2.5A Now I can quietly spend hours learning to work with python without worry. The hub indicates a voltage of 9.39V. To connect the external 9V plug, a small hole must be made in the hub box. If you don't want that, you can bring out both connecting wires on the side and fit a connector there as desired.

Update:
Link to the .stl file: https://www.thingiverse.com/thing:5557377

Frans

atzensepp
Beiträge: 658
Registriert: 10 Jul 2012, 21:40
Wohnort: Uttenreuth

Re: Lego-Fischertechnik.

Beitrag von atzensepp » 24 Okt 2022, 22:50

Amazing work to construct this power box.
Also good idea to use pins for the power adapter!
Thanks for sharing

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 25 Okt 2022, 10:07

@atzensepp
Thanks!
I already have 2 more Technic hubs now. Together with the Lego RI hub, I now have 14 connectable ports. I now make many measurements with the Techinc hub and Python Pybricks software. Lego, unlike FT, has no digital input modules. That makes it more difficult to communicate from FT to the Lego hubs.
From Lego to FT it can be easier. I can read the serial data from each hub on my DE0-Nano module and so on to the FT. This way I can use Windows 10 for the GUI interface. I am still working on a mixed project FT-Lego. As with FT, things sometimes go limited or unclear with Lego. You have to do a lot of searching and measuring yourself. Now it is starting to work nicely with Python on Lego and the TXT RoboPro software. New results on this will follow later. I had a delay of almost 4 months due to operations on my eyes but now I see quite well again and can work normally.

Frans.

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

Re: Lego-Fischertechnik.

Beitrag von fotoopa » 06 Nov 2022, 16:21

Linking Fischertechnic and Lego.

With FT I use the TXT controller, with Lego I use the Maindstorms inventor hub and the Techinc hub. To make them work together I use 2 Lego remote controllers. On each remote control there are 4 servos. This controls 4 buttons, the 3 remaining buttons can be operated manually. The servos are controlled by the TXT controller. The RoboPro program on the PC is used for this purpose. The servos themselves are controlled by my DE0 module but this can also be done with an I2C module on the TXT. All hubs use the Pybricks Python software: v3.2.0b4 Pybricks Beta v2.0.0-beta.9
There are 2 Pybricks programs running simultaneously, each controlling a different type of hub.

It is now easy to send commands from the TXT to both hubs. This can be done simultaneously or separately. The big problem with Lego hubs is that they have almost no inputs. Thus, we lack the nice 8 channel digital inputs that are present with the TXT. Through my DEO module, I even have 120 digital inputs. Via the servo controlled remote I can now at least send multiple commands to the Lego modules. The large PC screen where the program can be displayed is also indispensable.

Now to send commands from the Lego hubs to the TXT are a number of possibilities. I use a lot of hall sensors. Small magnets connected to Lego parts can send commands this way quickly and easily. I can also listen in on multiple serial lines from the hubs. That data can be used by the TXT. Thus, positions of the motors can be displayed, as well as other data from the hub. The TXT can display this data on the PC screen.

Pybricks does not have a hub to hub at this time. Now, however, commands can be sent from one hub to the TXT which then forwards them to the 2nd hub. This photo shows the total test setup.

Bildremote-hubs-111305 by Frans, on Flickr

Bildservo-remote-test by Frans, on Flickr

Bildremote-detail_141406 by Frans, on Flickr

Bildremote-servo-20221101 by Frans, on Flickr

Frans.

Antworten