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

More
3 years 9 months ago - 3 years 9 months ago #261351 by juergenmoser
Code:
@ TOLP2 I've now tried the Example with the STEPGEN.  I copied the example from Read The Docs in my HAL File.  I got an error by starting: pos2vel-cmd : [code] [code]net  pos2vel.0.velocity-cmd => Juergen.stepgen.00.velocity-cmd [code]/my-mill.hal:62: Signal name 'pos2vel.0.velocity-cmd' must not be the same as a pin.  Did you omit the signal name?
[/code][/code]
Code:
[code]so i changed in the Hal:
[/code]
Code:
[code][code][code]net xpos-fp pos2vel.0.velocity-cmd => Juergen.stepgen.00.velocity-cmd
[/code][/code]
[/code]
Code:
[code][code]Is that right to put in after net the xpos-fp? I have to try it with a stepper... So for Now Lcnc starts and i get signals to the  pos -cmd
[/code][/code]
Last edit: 3 years 9 months ago by juergenmoser.
The following user(s) said Thank You: TOLP2

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

More
3 years 9 months ago #261356 by TOLP2
Thanks for your finding. I modified the documentation, the line should read:
Code:
net xvel_cmd pos2vel.0.velocity-cmd => [LITEXCNC](NAME).stepgen.00.velocity-cmd

NOTE: I used xvel_cmd as signal name, as this is the velocity command. It is an unique signal, if you had appointed an existing signal to this line, please rename it.
The following user(s) said Thank You: juergenmoser

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

More
3 years 9 months ago #261357 by juergenmoser
Okay Thank you. And for the other axes I take yvel and zvel?

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

More
3 years 9 months ago - 3 years 9 months ago #261386 by TOLP2

Okay Thank you. And for the other axes I take yvel and zvel?
Would recommend yvel_cmd and zvel_cmd, but any name will do as long as they are unique.

@deroj: I changed a small bit in my modified halcompile to show the errors (added print("EXTRA_CFLAGS += -Wall", file=f) to line 1117). Now I can reproduce the warnings you got. Going to solve these warnings, as I believe in clean code is better code. But, how did you get those warnings on your system, did you change halcompile as well or have a certain setting somewhere? Otherwise this is also a difference between the 2.8-family and 2.9.

Edit:
I solved now all compiler warnings in the code in the branch 7-resolve-compiler-warnings. I will leave the option -Wall as default to see any new warnings. In my opinion the driver should compile without any warning.

I also started on testing why the code fails to link on LinuxCNC 2.9. Created a new development container with Debian Bullseye and LinuxCNC 2.9.0-pre1, et voila, I can reproduce the error:
Code:
halcmd: loadrt litexcnc Note: Using POSIX non-realtime litexcnc: dlopen: /opt/linuxcnc/rtlib/litexcnc.so: undefined symbol: json_object_array_length <stdin>:1: waitpid failed /opt/linuxcnc/bin/rtapi_app litexcnc <stdin>:1: /opt/linuxcnc/bin/rtapi_app exited without becoming ready <stdin>:1: insmod for litexcnc failed, returned -1 halcmd: Note: Using POSIX non-realtime

Now have to solve this one...
Last edit: 3 years 9 months ago by TOLP2.

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

More
3 years 9 months ago #261590 by deroj
@TOLP2
Code:
 But, how did you get those warnings on your system, did you change halcompile as well or have a certain setting somewhere?
Not, as I know...I just installed Linux Mint 21, then the debs with preempt kernel and linuxcnc, and then followed your python install instructions

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

More
3 years 9 months ago - 3 years 9 months ago #261679 by TOLP2
The warnings are solved now. The mostly stem from difference between 32-bit systems and 64bit and the formatting of numbers. Now I use inttypes to format the numbers, which solves the warnings. There were some other warnings as well, those have been solved at the same time.

For compiling it in LinuxCNC 2.9: something has changed in the linking; there is a notion of it in the CHANGELOG. However, I cannot find a way to successfully link the external library after this change. I decided to solve this by changing libjson-c to cJSON. The benefit of using cJSON is that this is a small library which can ben inlined in the driver. This requires a re-write of the driver on the configuration part. I rewrote the driver litexcnc_eth as a prove of concept and it works really well. 

The major work is now in rewriting the modules and the main driver.

Edit:
For the brave: I've committed the re-written code to GitLab. Didn't have the chance to test the code fully, but preliminary tests show that all pins are correctly created from the JSON. Took also the chance to refactor the initialization for the modules to get them all in the same format. The one thing I'm not confident about yet is the calculation of the CRC fingerprint.

So, if you are feeling adventurous, you can try it. Think I can do some testing myself during the weekend. 
Last edit: 3 years 9 months ago by TOLP2.
The following user(s) said Thank You: tommylight, besriworld, Pro_El, juergenmoser, wzor, deroj

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

Moderators: PCW, jmelson
Time to create page: 1.850 seconds
Powered by Kunena Forum