Setup with the new DE0-Nano-Soc board.

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: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 17 Apr 2021, 10:39

Hello Florian,
atzensepp hat geschrieben:
16 Apr 2021, 21:59
Hello Frans,
I would have no idea how to do the integration between the FPGA and an FT-controller. This is hard engineering stuff.
Is there already publication about your work?
The link between the TXT and the FPGA is the standard I2C line. All communication is done through this channel. On the FPGA side, I had to implement an I2C slave. This allows all commands and parameters to be sent back and forth. Along the FPGA side, I provided 512x8 read and 512x8 write registers.
They are arranged in 16x32 blocks and have an address range on the I2C between $60 and $6F. The FPGA can use all registers simultaneously. Commands such as motor control are then executed in the FPGA. For this I also had to write a module. If you have several motors then you use several of those hardware modules. In the FPGA there are 15,880 Logic utilization (in ALMs) and a full motor controller that can work in 4 modes also with quadrature encoders, end switches, home point, calibration etc consume about 230 ALMs per module. You see there is a lot that can go into an FPGA. I currently have 12 Motors inserted but there is no limit to increase this to any number. They may all work simultaneously of course and the motor control is in there. Same story for the servos. I now have 24 provided. For the Neopixel LEDs, I also wrote a driver. There, 2 output strings are provided and each drive 128 LEDs. Again, there is no limitation to drive more leds.

I also have a built-in LCD display of 4x20 char. There I can read the most important values in real time. I now have 120 inputs through 5 spi lines. The status of all 120 inputs can be read in real time. Also 8 analog inputs each 12 bit can be read out on the display and the TXT. With a rotary encoder on the front plate I can view the different LCD pages. I have an old IR remote control that has 40 keys on it. This is also readout continuously and when a new key is pressed the value comes into the output register. This value is also on the LCD but can also be read by the TXT.

The FPGA itself has 2.7 Mbit of ram internally that you can use freely. I regularly use this to make dual ported ram. Then multiple tasks can apply and read data simultaneously. You see you have huge power, lots of I/O pins and all real time without mutual influence for execution speed.

The status of the FPGA is now:
Logic utilization (in ALMs) 5,321 / 15,880 ( 34 % )
Total registers 5111
Total pins 110 / 314 ( 35 % )
Total block memory bits 38,528 / 2,764,800 ( 1 % )
Total DSP Blocks 0 / 84 ( 0 % )
Total PLLs 1 / 5 ( 20 % )
Total DLLs 0 / 4 ( 0 % )

In fact, I underuse the FPGA. It has to do very little effort. Nowhere really highspeed is used. The highest clock is 20 MHz.
I have now started to write the driver for the flash spi module. If you just use the regular spi mode it doesn't look that difficult. There are of course a series of functions that you have to implement. But it will work.

The only documentation I have is my Flickr web. That's where I regularly document all my tests. You can also find the hardware there. But everything is pretty much scattered around. It's more like a Journal. I use it myself to sometimes go look up my past tests.

Frans.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von atzensepp » 17 Apr 2021, 17:37

Hello Frans.

Do you think that an "ALTERA Cyclone II (EP2C5)" or a Core EP4CE6 board (http://land-boards.com/blwiki/index.php ... _Dev_Board) could serve for first experiments?

They are not really expensive. I guess one needs an additional JTAG-programmer.
And a bunch of voltage converters...

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 17 Apr 2021, 19:12

atzensepp hat geschrieben:
17 Apr 2021, 17:37
Hello Frans.
Do you think that an "ALTERA Cyclone II (EP2C5)" or a Core EP4CE6 board (http://land-boards.com/blwiki/index.php ... _Dev_Board) could serve for first experiments?
Those are old cheap boards but hard to start because you need so much extra around it. I have difficulty with with those cheap boards because final you will still have extra costs and old technology. Startup will be even more difficult. I already had several better DE0-nano boards in use in 2012.
See :
Bild
HD on Flickr: https://www.flickr.com/photos/fotoopa_hs/7774477448

Now it has been replaced by the DE0-nano-soc. Those modules are really complete, including power supply and USB cables, Unix kernel on memory card included, ready to boot. These boards are really under priced boards by Intel. In the FPGA there is already a test program. The software to write programs for the module is freely available from Intel (registration required). Just plug it into the PC and you're ready to go. Creating a first program will always be difficult. You have to choose the method, schema entry or VHDL (verilog or VHDL). That is always difficult but also with a lowcost module you have the same problem but there you may need an additional programmer and power supply. That is a thing of the past. I did it 10 years ago.The only thing is your low-cost argument.

With the DE0-nano-soc you also have the other part, including the linux kernel ready to go. I also tested it but I don't have the experience to write programs in C. I just don't have that part enabled in my applications. Yet the real power would be in being able to use both. Especially for network applications, USB connections, etc. The board is also specially made to use Arduino shields.
To use the test program you only need to connect the module to the power supply or even just insert it into the USB of the PC. The board will start up with driving the LEDs. Documentation is included in the kit.

Frans.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von MasterOfGizmo » 17 Apr 2021, 19:44

atzensepp hat geschrieben:
17 Apr 2021, 17:37
Do you think that an "ALTERA Cyclone II (EP2C5)" or a Core EP4CE6 board (http://land-boards.com/blwiki/index.php ... _Dev_Board) could serve for first experiments?

They are not really expensive. I guess one needs an additional JTAG-programmer.
And a bunch of voltage converters...
Yes, you need a JTAG cable. Some of them come with such a cable. And they usually have the power supply integrated and you can just power them from a USB port.

These are totally fine to get a basic understanding how these things work. You'll have to learn a lot before you'll make the first of the LEDs on this board blink. Once you have accomplished that you might consider buying something more advanced. I have e.g. started my MIST project (https://github.com/mist-devel/mist-board/wiki) with exactly such a board. And you can still do a lot even with these simple boards. E.g. attach a VGA cable via some resistors and a few buttons and you can run pacman on a VGA screen.

Frans on the other hand is using quite complex boards and he's only making use of a fraction of them. Imho they are way too expensive for someone who doesn't know what he wants and needs. So my advise: Get one of those super cheap boards, get the development setup running, understand how you download code to the board and let the LEDs blink. You can then connect that board to your TXT and let it control the LEDs via I²C. And then ... if you have a basic understanding, then you'll have learned enough to spend more money on a more advanced board.

Everything you learn from these cheap boards directly applies to the more expensive ones as well. The software tools are the same, the programming languages are the same. The more expensive boards are just faster and have more logic cells. But the EP3C5 is powerful enough for an entire Pacman hardware. So it will take some time until you exceed the capabilities even of the most simple board.
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: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 19 Apr 2021, 11:07

First test to have access to the spi flash W25Q64. Here I use the read ID command $90 to read the ID values. The chip answers nicely with the data $EF $16. I use the TXT via the I2C line for this purpose. Now I continue to implement the other functions.

Bild
HD picture on Flickr: https://www.flickr.com/photos/fotoopa_hs/51125014028

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von atzensepp » 20 Apr 2021, 21:35

Could it be that I am understanding only "railway station"? I am eager to learn but that is too fast for me.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von MasterOfGizmo » 21 Apr 2021, 08:10

atzensepp hat geschrieben:
20 Apr 2021, 21:35
Could it be that I am understanding only "railway station"? I am eager to learn but that is too fast for me.
That's why I suggested that you start with a simple board and a few blinking LEDs.
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: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 21 Apr 2021, 09:07

MasterOfGizmo hat geschrieben:
21 Apr 2021, 08:10
atzensepp hat geschrieben:
20 Apr 2021, 21:35
Could it be that I am understanding only "railway station"? I am eager to learn but that is too fast for me.
That's why I suggested that you start with a simple board and a few blinking LEDs.
Yes that is a useful tip. That's also how I started years ago.

Benutzeravatar
H.A.R.R.Y.
Beiträge: 1083
Registriert: 01 Okt 2012, 08:38
Wohnort: Westpfalz

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von H.A.R.R.Y. » 23 Apr 2021, 16:51

Hello All,
Hello atzensepp,
fotoopa hat geschrieben:
21 Apr 2021, 09:07
MasterOfGizmo hat geschrieben:
21 Apr 2021, 08:10
atzensepp hat geschrieben:
20 Apr 2021, 21:35
Could it be that I am understanding only "railway station"? I am eager to learn but that is too fast for me.
That's why I suggested that you start with a simple board and a few blinking LEDs.
Yes that is a useful tip. That's also how I started years ago.
Yes, this is quite a good starting point. But it still might give you some hazzle. First you need to select one fine board. The you need to get board documentation and the development suite from the respective chip vendor. Preferrably this also has some circuit simulation so you can see on the screen what happens before you flash the design. Then you need to obtain one of the pricey programming tools for a dedicated brand - or you take some cheap Arduino stuff and convert it into a JTAG-player. The FPGA- or CPLD-toolsuite needs to put out .svf files (a real industry standard so it shall be supported by the toolchain) and those then get send to the JTAG player. If you have all this hardware on your desk, then you still need to write the behavioral code using Verilog or VHDL. This is modelling is called Register Transfer Level (RTL - nothing to do with the TV station). Eventually you could use some graphical tool to sketch the logic circuitry which makes things easier for the beginner used to sketch logic gates onto a schematic.

Purchasing an Arduino compatible board gives you some common access to lots of different microcontrollers and boards, there is yet anything compatible with FPGA boards. Shields or breakout boards made for Arduino experiments can get used also with FPGA and the like. But be really careful, most FPGAs do not support 5 V IO voltages nowadays. There are even some around that claim to be "5 V tolerant" but are only if powered by their 3.3 V supply. And some just have 2.7 V or even lower. If unpowered the external 5V IO voltage will damage them irreversibly. So levelshifting (and here comes again the cheap Arduino peripherals into play) is a mandatory thing to consider. Of course, combining such FPGAs with a computer opens up an universe way beyond the reach of most Arduino users. Like fotoopa shows to us.

And being there, one FPGA containing logic made the right way outperforms dozens of microcontroller boards coupled together. So even a dozen of cheap Arduinos will never give the possibilities and signal processing power that such an FPGA can reach.

Maybe you now understand a bit less "railway station" and a bit more how to hop on the train. In case you really would like to enter it and need some help, please open up some dedicated thread. Like fotoopa I am one of those rare guys who have done some years of industrial logic design and I am more dedicated to Verilog than to VHDL.

Happy Hacking
H.A.R.R.Y.
[42] SURVIVE - or die trying

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 05 Mai 2021, 13:10

A new update:

Colour pattern editor under Fischertehnik Robopro programme. Here is a picture of the neo-matrix display placed on top of the window of the FT programme. With the Robopro programme, you can only use a fixed colour to the LEDs on your screen via a constant value. When you run the programme, you cannot use any other colours. This is an annoying limitation if you want to work with different colours. To demonstrate this, I have made an overlay with the neo-led display.

The programme contains a full colour editor with 5 possible colours. The pattern of 8x16 pixels can be edited and also stored in the flash memory. I have written the necessary functions in verilog for the FPGA to support the possibilities of the 8Mb flash. Programming is done in the TXT controller via the I2C connection.

I have allocated the flash memory up to 4 users who can each store and use 256 patterns. The second part of the flash memory is used to store different character roms. This way, different character sets can be used for letters in the pattern. Once a pattern is read, it can be further updated and stored under a different number. You can also change an existing pattern and overwrite it if you wish.
Cost 8Mbyte flash W25Q64: € 2,99.

A total of 1024 patterns can be stored. However, this is a severe underutilisation of the flash memory. But this is done because erasing is always done sector by sector. If you would put more patterns in one sector, you would have to do more work to first save all the old patterns, erase the sector and finally rewrite the new pattern together with the old patterns. You cannot erase a 128x8 byte pattern separately without erasing the whole sector. Since I can now store 1024 patterns anyway, I think this is sufficient.

Note:
The colour reproduction of the neo-leds in the picture is not perfect. It is very difficult to photograph those neo-leds and also have the correct colour profile.

Bild
UHD picture on Flickr: https://www.flickr.com/photos/fotoopa_hs/51159287308

Bild
UHD picture on Flickr: https://www.flickr.com/photos/fotoopa_hs/51159831549

An overview of the layout of the flash memory :
Bild
HD picture on Flickr: https://www.flickr.com/photos/fotoopa_hs/51158386392

Frans.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 10 Mai 2021, 11:25

I hereby terminate my contribution with the DE0-nano soc. There are hardly any FPGA users, so my contribution makes little sense. The English language also appears to be a limitation for some users. I am going to limit myself to the information on my Flickr web:
https://www.flickr.com/photos/fotoopa_hs/

All tests with the flash spi mem module are finished. I have written the necessary lib functions in verilog for the FPGA. All these functions can be used via the TXT controller over I2C. Now I will continue with the pic and place robot program. The new results will be shown on my Flickr web.

I will continue to follow the entire TFC forum. There are enough beautiful projects to see that can be very inspiring.

Frans.

Benutzeravatar
steffalk
ft:pedia-Herausgeber
Beiträge: 1791
Registriert: 01 Nov 2010, 16:41
Wohnort: Karlsruhe
Kontaktdaten:

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von steffalk » 10 Mai 2021, 22:10

Hello Fotoopa,

Your projects are so fine that everywhere you are documenting them will be just as fine. I just want to make clear that a potentially small group of readers needs not at all to be a reason not to post here. You are more than welcome here with your *superb* projects and knowledge, entirely regardless of the language you prefer.

And the door is still wide open, and will be kept so, if you ever like to publish something in an ft:pedia article. English language is quite fine for us, and you could perhaps reach even more readers.

Thank you very much the your insights you posted in this forum to date, and all the best for you and your plans, whatever they may be.

Best Regards,
Stefan
Zuletzt geändert von steffalk am 11 Mai 2021, 18:33, insgesamt 1-mal geändert.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von atzensepp » 11 Mai 2021, 14:36

Hello Frans,

your FPGA-project is extremely inspiring because it is very concrete and gives outlook beyond the normal horizon.
But since it is very demanding there are not so many people here who can say something. Actually I am very keen on starting with an FPGA development. And some help to get started and with the additional hw would be good.

Anyhow I personally would highly apprechiate if you could further report here about interesting updates of your work.

Thank you
Florian

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 25 Mai 2021, 14:29

Yet another update on the Pic and place robot.
I further finished the Robopro program that allows the robot to scan the table and remove all the discs. Meanwhile, the full verilog lib function for flash memory is also finished. The editor is completely finished. New patterns can be drawn and stored in the flash memory. Here I created a pattern of how the discs lay on the table. By starting the scan function, the robot looks for all the discs and takes them away. The next step is to completely finish the input module. Most of it is already done.

A short video can be seen here: https://www.flickr.com/photos/fotoopa_hs/51203159600

A few images:

Bild
HD on Flickr: https://www.flickr.com/photos/fotoopa_hs/51202869934

Bild
HD on Flickr: https://www.flickr.com/photos/fotoopa_hs/51202095381

Frans.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von rubem » 26 Mai 2021, 14:41

Hi,

Your project is really impressive, and it looks absolutely fantastic. I can only imagine how many hours of work (and filament :) ) you must have put into it... The video is great, too. The robot looks very stable and precise. Congratulations!

Rubem

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 26 Mai 2021, 19:29

Thanks for your reply.

Yes there are many hours of work in the project. That was the intent, to make something to keep my busy. At my age, you have a lot of time. Originally, the project was intended to work with the FT steel balls. I had made the 3D prints for this purpose. They had also been made in a grid of 15mm.
Then I had seen the neo-led matrix 8x8. I wanted to replace those steel balls with colored discs. That way I could show patterns on the display in color. The installation of the neo-leds was also designed with 3D printing. So that also takes some time. The control of this neo-display from the FPGA also had to be made. It had to work with the TXT controller via I2C.

The next step was how to incorporate the colored discs. For this I chose to place a small neodym magnet in each disc. This allowed me to record the discs, detect them via hall sensor and move them via chain with an underlying magnet. While developing the program for the TXT, I had the need to draw and store my own colored patterns. For this purpose I had seen an 8Mb SPI flash module. Since you can't find a lib for the FPGA I had to write it completely from scratch myself. For that I already had a 4 channel scope so I could test all the flash operations very easily. That also takes a lot of time but is very pleasant once everything works.

I also wrote the control algorithm for the motors. A control curve allows for fast positioning. I used only integer values for this purpose. Given that I always work with quadrature encoders, the absolute error is never greater than 1 encoder pulse. You may work a full day with all the motors, you will not see any deviations. How the positioning works well you can see nicely in the video. The FPGA module now contains the control of up to 12 motors. The TXT only needs to transmit the new desired position and send a start command. The control is done entirely internally in the FPGA. All position values are always available to the TXT via the I2C connection.
Input signals are no problem, I have up to 120 inputs via 5 SPI lines. For the outputs, same story, plenty of signals. The beauty is that everything runs with the Robopro software + the TXT controller. I have on the PC 2 UHD 32inch screens to display all the data. You can never do that otherwise on a small screen like on the TXT itself.

The Robopro software allows you to create very nice programs, run multiple tasks and still keep a good overview. For me this is the best tool ever. The fact that I have printed many of my own 3D parts is precisely one of my fun pursuits.

Frans.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 26 Jun 2021, 15:01

Detection of the color disks with the USB FT camera. The camera is mounted on the pic an place robot arm. It is set to image a zone of 4x4 discs. The table consists of 8 of these modules. By taking 8 images the whole surface can be measured. In total, there can be up to 128 color disks. The camera must also detect if there are any unused areas. Once all 8 blocks have been recorded, the entire drawing can be displayed on the 128 neo-led pixel display. The drawing can then be stored in the flash memory for later automatic remaking by the pic and plcae robot. The grandchildren can then manually make and save a drawing.
The table shows the RGB and W values of 16 measured zones (C0 .. C15). The task is now to calculate the correct color from these values.

Bild
HD picture on Flickr: https://www.flickr.com/photos/fotoopa_hs/51272771635

Bild
HD picture on Flickr: https://www.flickr.com/photos/fotoopa_hs/51270994892

Thus, again, there is some extra work to make the calculations and adapt the Robopro program for the job.
Frans.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 01 Jul 2021, 17:12

As promised, I updated the Roboprogram to detect the colored discs on the robot table.

Manually you can apply the discs to the table yourself. By making a scan we can read the drawing, display it on a color neo-led display and store it in the flash memory. Later we can upload the drawing again to make it with the robot. The Fischertechnik USB camera takes a picture of a block of 4x4 discs. The color of each disk is calculated. For this we use the Robopro graphics program. In the lib there is a camera function that can determine these colors. By taking 2x4 images all 128 pixels can be determined. The FPGA is connected via an I2C connection to store the drawing in the ram.

I made a short video of this on my Flickr web: Bildft scan color disks by Frans, on Flickr

Frans.

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von rubem » 02 Jul 2021, 00:31

Hi Frans,

Wow. Truly amazing (again). Hats off to your accomplishments. We can see that you do use fischertechnik as a base, but you are pushing its boundaries. I also find your combination of ft with control boards, 3d printed parts, conventional hardware and sheer craftsmanship fascinating. You should probably contact Hackaday (.com or .io, it depends) about this project, they will definitely have a place for your work there.

Cheers,

Rubem

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

Re: Setup with the new DE0-Nano-Soc board.

Beitrag von fotoopa » 02 Jul 2021, 10:23

rubem hat geschrieben:
02 Jul 2021, 00:31
You should probably contact Hackaday (.com or .io, it depends) about this project, they will definitely have a place for your work there.
Thanks Rubem for the comment!
Yes I know Hackaday. In 2008 they already wrote articles of "fotoopa". If you search for "fotoopa" you will still find articles. Currently, I use Flickr as a kind of log of all my works. I myself regularly go back to my own posting to see how I had made it at that time.

From my pic and place robot I now have to finish the input module. Most parts are ready. With that, existing drawings can be recreated with the robot. Unfortunately I have severe limitations with my eyes. It will be difficult to work with the computer for a long time. There are some interventions planned that should make it a little better.

Fortunately, I do not have an end date limit for finishing. If it goes I will continue to work.

Frans.

Antworten