ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board

More
05 Jan 2023 21:46 #261037 by TOLP2

muvideo post=260991 userid=29999

[...]

If I understand correctly TOLP implementation, the position pid part in his software is already embedded in the driver so his implementation hides most of this and your life is simplified.
I prefer to not rewrite a PID logic inside my driver, since we already have a very good PID in ours hal components.

IT is correct that I like to make things as easy as possible. However, your understanding of pos2vel is not completely correct.

The pos2vel component is not a PID implementation. The reason is like you stated, the feedback is predictable. The only part which is not predictable is the amount of counts between two succesive cycles. This is due to the FPGA not running exactly at 40 MHz and also due to the jitter of the thread. These things we can measure and correct for, whilst keeping in mind acceleration limits. The component makes sure that if the acceleration ends (and thus a constant speed is attained), this speed can be reached within one cycle. It is pure physics in the component, very similar to the driving part of LinuxCNC component stepgen, but with added complexity to allow for the stepgen actually taking place on a FPGA.

Also, pos2vel is not baked into the driver. This is because the driver should not contain magic (I agree with you on this one). It is very much possible to use a PID approach to LitexCNC if a user wants this. This also opens the road for full close-loop systems.
The following user(s) said Thank You: muvideo

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 09:33 - 06 Jan 2023 09:39 #261071 by deroj
as i wrote...
"sudo python3 halcompile.py --install litexcnc.c litexcnc_eth.c litexcnc_debug.c stepgen/pos2vel.c"
right in the litex-cnc- driver folder

and after install with sudo, like you said, just "litexcnc install_driver"

original halcompile isnt a python script, or is it? and if, how do i tell litexcnc to use the modified one?
Last edit: 06 Jan 2023 09:39 by deroj.

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 10:44 #261073 by deroj
 

File Attachment:

File Name: install_driver.txt
File Size:36 KB
so i found the original halcompile and renamed it to halcompile1.
then i run the litexcnc install_driver again with no changes.

i attached the terminal output. maybe you can find my mistakes?
thank you
Attachments:

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 14:33 - 07 Jan 2023 06:24 #261083 by TOLP2
I think the error does not come from a linking error, but due to unexpected types in a function. Will have to look into line number 250, where the error occurs.

Edit:
Can you share your system config (OS and version of Linuxcnc) for tracing this error?
Last edit: 07 Jan 2023 06:24 by TOLP2.

Please Log in or Create an account to join the conversation.

More
06 Jan 2023 21:52 #261129 by juergenmoser
@TOLP i tried to install litexcnc yesterday with the original ISO LinuxcncBuster 2.8.0 and i can‘t get it to work. So I tried the excellent manual from tommylight (I think)to install mint21 (for me no worries because i run the tests on a virtual machine)  with linuxcnc2.9 - and it all works like a charm! The only thing what you have maybe to install is „pip“ and maybe „git“ after that you can install litexcnc very easily! Thanks again for the help!
The following user(s) said Thank You: TOLP2

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 14:16 #261167 by DePrutser
I'm trying to follow the steps in README.md from github.com/Peter-van-Tol/LiteX-CNC
I get this error on the first step on my arch linux system:

[cedric@cedric ~]$ pip install litexcnc
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement litexcnc (from versions: none)
ERROR: No matching distribution found for litexcnc
[cedric@cedric ~]$ uname -a
Linux cedric 6.0.11-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 02 Dec 2022 17:25:31 +0000 x86_64 GNU/Linux
 

Next I try the same command on my linuxcnc installation:

$ sudo apt-get install python3-pip
$ pip3 install litexcnc
Collecting litexcnc
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: pypi.org/simple/litexcnc/

$ sudo apt-get install python-pip
$ pip install litexcnc
Collecting litexcnc
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: pypi.org/simple/litexcnc/
$ uname -a
Linux virt-cnc 4.19.0-21-rt-amd64 #1 SMP PREEMPT RT Debian 4.19.249-2 (2022-06-30) x86_64 GNU/Linux

$ cat /etc/issue
Debian GNU/Linux 10 \n \l

What am I doing wrong?

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 14:36 #261169 by TOLP2
@DePrutser: at this moment litexcncis not yet available on the official PyPi.org. The pre-release is available at test.pypi.org. To install it, please use this command:
pip install --extra-index-url https://test.pypi.org/simple/ litexcnc[cli]

I will update the README.md to show the correct command. For documentation, please refer  ReadTheDocs
 

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 19:08 - 07 Jan 2023 19:09 #261186 by juergenmoser
@TOLP - Hello again - So the Litex drivers are already installed - also a board 5a75b v8.0 is flashed - (and ping went good) when I try halrun -> loadrt litexcnc i get this error
cnc@cnc-LIFEBOOK-E744:~$ halrun
halcmd: loadrt litexcnc
Note: Using POSIX realtime
litexcnc: dlopen: /usr/lib/linuxcnc/modules/litexcnc.so: undefined symbol: json_object_array_length
<stdin>:1: waitpid failed /usr/bin/rtapi_app litexcnc
<stdin>:1: /usr/bin/rtapi_app exited without becoming ready
<stdin>:1: insmod for litexcnc failed, returned -1
halcmd: exit
Note: Using POSIX realtime

So i think when i reinstall the litex_driver i can see that the position250 is the board name? is there a maximum lengh maybe? (I Only Uses 6 letters....)
  250 |         rtapi_snprintf(fpga->name, sizeof(fpga->name), json_object_get_string(board_name));
      |         ^~~~~~~~~~~~~~
My System:
[code]Linux cnc-LIFEBOOK-E744 6.0.0-6-rt-amd64 #1 SMP PREEMPT_RT Debian 6.0.12-1 (2022-12-09) x86_64 x86_64 x86_64 GNU/Linux

LinuxCNC Version
2.9
[/code]
Last edit: 07 Jan 2023 19:09 by juergenmoser.

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 20:53 #261196 by TOLP2
I have to check, did you use:
litexcnc install_driver
or (in case of permission denied error)
sudo litexcnc install_driver

If this is the case, I have to dive into the code. At this moment I cannot verify this, as I'm rebuilding my system, will be Monday to have this done.
 

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 21:02 - 07 Jan 2023 21:03 #261199 by juergenmoser
I‘ve done it with sudo (so that everything goes to $PATH) No worries - I have time!
Last edit: 07 Jan 2023 21:03 by juergenmoser.

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.255 seconds
Powered by Kunena Forum