ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
IT is correct that I like to make things as easy as possible. However, your understanding of pos2vel is not completely correct.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.
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.
Please Log in or Create an account to join the conversation.
"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?
Please Log in or Create an account to join the conversation.
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.
Edit:
Can you share your system config (OS and version of Linuxcnc) for tracing this error?
Please Log in or Create an account to join the conversation.
- juergenmoser
- Offline
- Junior Member
- Posts: 26
- Thank you received: 10
Please Log in or Create an account to join the conversation.
I get this error on the first step on my arch linux system:
Next I try the same command on my linuxcnc installation:[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
What am I doing wrong?$ 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
Please Log in or Create an account to join the conversation.
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.
- juergenmoser
- Offline
- Junior Member
- Posts: 26
- Thank you received: 10
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
Please Log in or Create an account to join the conversation.
litexcnc install_driver
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.
- juergenmoser
- Offline
- Junior Member
- Posts: 26
- Thank you received: 10
Please Log in or Create an account to join the conversation.