ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
06 Nov 2022 11:29 #256058
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Please change the branch of Litex-CNC to stepgen_improvement, you are using main.
Also, try to build the stepgen example to see whether it solves the issue. Maybe the example you are using might be outdated (will fix that).
Also, try to build the stepgen example to see whether it solves the issue. Maybe the example you are using might be outdated (will fix that).
Please Log in or Create an account to join the conversation.
06 Nov 2022 20:04 - 06 Nov 2022 20:20 #256090
by svb
Replied by svb on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Hello Peter.
Today I found time to play with the new driver. Alas, I failed.
This is the result of running a full configuration.
After that, I decided to try to run in parts via halrun, but got the same result.
I am attaching the config that I launched with halrun.
p.s. I'm use your config from forum.linuxcnc.org/27-driver-boards/4442...ard?start=290#255870
Today I found time to play with the new driver. Alas, I failed.
This is the result of running a full configuration.
After that, I decided to try to run in parts via halrun, but got the same result.
I am attaching the config that I launched with halrun.
p.s. I'm use your config from forum.linuxcnc.org/27-driver-boards/4442...ard?start=290#255870
Attachments:
Last edit: 06 Nov 2022 20:20 by svb. Reason: Attach logs
The following user(s) said Thank You: TOLP2
Please Log in or Create an account to join the conversation.
06 Nov 2022 22:15 #256098
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Thanks for testing! This should not be happening, during my the tests on my computer it did work. In the example I provided in my earlier post:
Could you please reduce the number of GPIO, stepgens and remove the encoders? I'm wondering whether size has something to do with it. I noticed the error does not directly come from Litex-CNC, but some other component is not starting correctly. This can be due to a memory error somewhere.
Just to let you know: this evening I also committed a new version of the stepgen. The firmware has been modified, where the stepgen is split into:
I would like to recommend to pull and rebuild both driver and firmware. Please note that the stepgen example has been updated as well.
- did you copy the snippet from the HAL-file after I made the edit?
- I just noticed that by editing the post, part of the text of the post about installation got into the code section.
Could you please reduce the number of GPIO, stepgens and remove the encoders? I'm wondering whether size has something to do with it. I noticed the error does not directly come from Litex-CNC, but some other component is not starting correctly. This can be due to a memory error somewhere.
Just to let you know: this evening I also committed a new version of the stepgen. The firmware has been modified, where the stepgen is split into:
- a generator, which does all the heavy lifting such as position, speed and acceleration;
- a stepgen module, which converts the position into steps.
I would like to recommend to pull and rebuild both driver and firmware. Please note that the stepgen example has been updated as well.
Please Log in or Create an account to join the conversation.
08 Nov 2022 09:39 #256195
by andypugh
Replied by andypugh on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
I am looking at the possibility of integrating this driver into the LinuxCNC codebase. However I don't know enough about it to be the maintainer. Looking through this thread I am not now sure which is the "lead" development branch of this driver. Could someone enlighten me?
If it is a family of related drivers for a family of similar boards then it might be possible to include multiple drivers, however a common LinuxCNC HAL driver and variety of firmwares would be better.
If it is a family of related drivers for a family of similar boards then it might be possible to include multiple drivers, however a common LinuxCNC HAL driver and variety of firmwares would be better.
Please Log in or Create an account to join the conversation.
08 Nov 2022 10:43 #256200
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Please let me try to enlighten you. There are several drivers for 5a-75X family of cards:
- the original written by romanetz and several variants there of. This driver is a single c-file and has a fixed layout for the FPGA.
- my modified version, dubbed LitexCNC, which is a more flexible approach with configuration file (JSON) which configures both the driver (mainly the pins which have to exported) and the firmware.
- can you enlighten us what integration would mean for the development of the driver. Does this mean that expansion of the driver or modifications lead to a complete re-build of LinuxCNC on the computer? At this moment is is fairly quick by using just halcompile.
- to make this more accessible a tool like stepconf should be made as well, which could produce the JSON-file and part of the HAL-files.
- the driver should be tested and finished. At this moment it works for me for GPIO, PWM and Stepgen, however svb had some troubles getting it to work on his machine. Support for encoders is still lacking.
Please Log in or Create an account to join the conversation.
08 Nov 2022 11:13 #256204
by andypugh
Replied by andypugh on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
What you describe sounds a little more like a config tool than a driver?
One approach might be to include the tool and also a sample set of driver/firmware combinations.
The LinuxCNC build process will create a module for anything that halcompile can build, by adding the .comp or .c to the src/hal/drivers folder and adding it to the makefile (not necesary for .comp, those are automatically detected)
Another way might be to add a section to the makefile that feeds a sample set of JSON files to the tool, and then lets the existing code compile the .comp.
One thing to decide is if the LinuxCNC repository then becomes the "home" of the driver, with development work happening there. (The Litex developers would obviously have to be given LinuxCNC commit rights for that to work) This isn't necessary (Mesa firmware development happens separately. but the driver code is very much only inside the LinuxCNC repository,)
This decision should really be made on the basis of long-term stability and maintenance.
One approach might be to include the tool and also a sample set of driver/firmware combinations.
The LinuxCNC build process will create a module for anything that halcompile can build, by adding the .comp or .c to the src/hal/drivers folder and adding it to the makefile (not necesary for .comp, those are automatically detected)
Another way might be to add a section to the makefile that feeds a sample set of JSON files to the tool, and then lets the existing code compile the .comp.
One thing to decide is if the LinuxCNC repository then becomes the "home" of the driver, with development work happening there. (The Litex developers would obviously have to be given LinuxCNC commit rights for that to work) This isn't necessary (Mesa firmware development happens separately. but the driver code is very much only inside the LinuxCNC repository,)
This decision should really be made on the basis of long-term stability and maintenance.
The following user(s) said Thank You: tommylight, svb
Please Log in or Create an account to join the conversation.
10 Nov 2022 15:59 #256360
by TOLP2
The driver can be part of LinuxCNC. On the wiki of LinuxCNC we can then point to the proces on obtaining, configuring and building the firmware which is in an external repository.
Please note that with LitexCNC uses a modified halpcompile. I needed an external library to be linked. It would be nice to grab the chance to make halcompile a little more flexible and let user link their own libraries when needed.
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
I think I expressed myself not clear. It is definitely a driver, however the number of pins, stepgen, etc. is configurable using the JSON config file.What you describe sounds a little more like a config tool than a driver?
The driver can be part of LinuxCNC. On the wiki of LinuxCNC we can then point to the proces on obtaining, configuring and building the firmware which is in an external repository.
Please note that with LitexCNC uses a modified halpcompile. I needed an external library to be linked. It would be nice to grab the chance to make halcompile a little more flexible and let user link their own libraries when needed.
Please Log in or Create an account to join the conversation.
10 Nov 2022 17:35 #256364
by andypugh
You might not need to modify halcompile to do that, you can use an undocumented feature of halcompile, "include"
See, for example: github.com/LinuxCNC/linuxcnc/blob/master...s/mesa_7i65.comp#L46
Replied by andypugh on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Please note that with LitexCNC uses a modified halpcompile. I needed an external library to be linked.
You might not need to modify halcompile to do that, you can use an undocumented feature of halcompile, "include"
See, for example: github.com/LinuxCNC/linuxcnc/blob/master...s/mesa_7i65.comp#L46
The following user(s) said Thank You: TOLP2
Please Log in or Create an account to join the conversation.
11 Nov 2022 07:28 #256406
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Didn't know that (it was after all undocumented). I will try that at my next compilation round how it works and will update the repo accordingly.
Please Log in or Create an account to join the conversation.
11 Nov 2022 07:46 #256409
by sensille
Replied by sensille on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
This project is really interesting to me. I have both the 5A-75B as well as the RV901T. I'm setting myself up to join in. Just for my understanding: why do you use your own protocol and reimplement stepgen etc. instead of using the hostmot2 design and protocol, making the card mesa-compatible? Not that I'm against it, i just want to understand the reasoning behind it.
Please Log in or Create an account to join the conversation.
Time to create page: 0.159 seconds