LitexCNC: firmware and driver for 5A-75B and 5A-75E

More
09 Feb 2024 08:48 #292919 by TOLP2
The error you are getting is not in the HAL. It is due to the last stepgen not receiving its data. Therefore it does not move (or moves wrongly) and you get a joint follow error.

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

More
09 Feb 2024 10:34 #292926 by uba100
I have my Raspberry Pi4 with the linked Linuxcnc image for RP4 from their instruction page

litex-cnc.readthedocs.io/en/latest/raspberrypi.html

around January 15th and then installed litexcnc with pip according to the instructions described there.
I had problems at the beginning because I could not compile the JSON file because some Python modules were not found.
Then they helped me there.

forum.linuxcnc.org/27-driver-boards/5038...-and-5a-75e?start=20

Thanks again for that.

The Litexcnc version displayed is 1.1.0.

Is there already a newer version?

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

More
09 Feb 2024 20:10 #292956 by TOLP2
The version of litexcnc can be best checked with:
pip freeze litexcnc
​​
The latest version is 1.2.1. You can update with:
​​​​​​
pip install - U litexcnc

After update you have to reinstall the driver and rebuild the firmware for the update to take effect. 

The mentioned change of the PWM module will be in the upcoming version (1.3 that will be). In this version also another bug will be resolved: at this moment the version of the communication protocol is not correctly handled. This is also the root cause of the errors discussed here. 

This weekend I'll find out the misbehaving module: the module which reports the wrong buffer size. Please let me know is the error is solved by updating litexcnc. 

After this you have to reinstall the driver 

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

More
09 Feb 2024 20:33 - 09 Feb 2024 20:54 #292959 by uba100
I actually still had version 1.2.0 of litexcnc installed.
Now I have 1.2.1
Unfortunately, the command "litexcnc install_driver" does not work.
Not even with sudo.
But the command "sudo env "PATH=$PATH" litexcnc install_driver" works.
I am just not sure if it is correct.
Last edit: 09 Feb 2024 20:54 by uba100.

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

More
09 Feb 2024 21:54 #292960 by uba100
here is the output if I only enter "litexcnc install_driver":

cnc@raspberrypi:~$ litexcnc install_driver
INFO: Looking for halcompile...
INFO: Locating Makefile.modinc...
INFO: Run In Place (RIP) Installation not detected
INFO: Detected EMC2_RTLIB_DIR location '/usr/lib/linuxcnc/modules'
INFO: Retrieving default driver files to compile...
Copying file 'watchdog.c'
Copying file 'wallclock.c'
Copying file 'litexcnc.c'
Copying file 'litexcnc_spidev.c'
Copying file 'litexcnc_pigpio.c'
Copying file 'etherbone.c'
Copying file 'litexcnc_pigpio_speed_test.c'
Copying file 'litexcnc_eth.c'
Copying file 'litexcnc_stepgen.c'
Copying file 'litexcnc_pwm.c'
Copying file 'litexcnc_encoder.c'
Copying file 'litexcnc_gpio.c'
Copying file 'watchdog.h'
Copying file 'litexcnc.h'
Copying file 'wallclock.h'
Copying file 'litexcnc_spidev.h'
Copying file 'etherbone.h'
Copying file 'litexcnc_pigpio.h'
Copying file 'litexcnc_eth.h'
Copying file 'litexcnc_stepgen.h'
Copying file 'litexcnc_gpio.h'
Copying file 'litexcnc_encoder.h'
Copying file 'litexcnc_pwm.h'
INFO: Compiling LitexCNC driver...
Compiling realtime litexcnc.c
Linking litexcnc.so
cp litexcnc.so /usr/lib/linuxcnc/modules/
cp: cannot create regular file '/usr/lib/linuxcnc/modules/litexcnc.so': Permission denied
make: *** [/usr/share/linuxcnc/Makefile.modinc:107: install] Error 1
Error: Compilation of the driver failed.

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

More
10 Feb 2024 08:50 #292979 by Mecanix

The Litexcnc version displayed is 1.1.0.
Is there already a newer version?


That would be correct. As per: 
#define LITEXCNC_NAME    "litexcnc"
#define LITEXCNC_VERSION_MAJOR 1
#define LITEXCNC_VERSION_MINOR 1
#define LITEXCNC_VERSION_PATCH 0
Source: github.com/Peter-van-Tol/LiteX-CNC/blob/...nc/driver/litexcnc.h

Your driver installation method is equally correct. 
$ sudo -E env PATH=$PATH litexcnc install_driver

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

More
10 Feb 2024 13:27 #292990 by uba100
Then everything should be up to date for me now.
I have compiled and flashed the JSON once with 2 PWM generators + 6 step generators and then again without PWM generators.
Neither variant brought any improvement with regard to the fifth axis.
Here again the output when calling Linuxcnc and attempting to home the axes.


cnc@raspberrypi:~$ linuxcnc
LINUXCNC - 2.9.2
Machine configuration directory is '/home/cnc/linuxcnc/configs/test1'
Machine configuration file is 'test1.ini'
Starting LinuxCNC...
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./test1.hal

identityKinematicsSetup: coordinates:XYYZA
Joint 0 ==> Axis X
Joint 1 ==> Axis Y
Joint 2 ==> Axis Y
Joint 3 ==> Axis Z
Joint 4 ==> Axis A

litexcnc: Loading Litex CNC driver version 1.1.0
litexcnc: Loading and registering default modules:
litexcnc: Registered module gpio
litexcnc: Registered module pwm
litexcnc: Registered module encoder
litexcnc: Registered module step
litexcnc: Setting up board drivers:
litexcnc: Registered driver eth
LitexCNC-eth: connected to board on '10.0.0.10:1234'
litexcnc: Setting up modules...
litexcnc: Reading 28 bytes
litexcnc: - Watchdog
litexcnc: - Wallclock
litexcnc: - gpio ... done!
litexcnc: - encoder ... done!
litexcnc: - step ... done!
litexcnc: Creating read and write buffers...
litexcnc: Base addresses: init: 00000000, reset: 0000003C, config: 00000040, write: 00000044, read: 0000008C
litexcnc: - Write buffer: 72 bytes
litexcnc: - Read buffer: 96 bytes
litexcnc: Exporting functions...
Found file(REL): ./custom.hal
litexcnc/5A-75B:V8.0: Watchdog timeout (3000000 ns) is dangerously short compared to litexcnc_write() period (2400000 ns)
note: MAXV max: 25.000 units/sec 1500.000 units/min
note: LJOG max: 25.000 units/sec 1500.000 units/min
note: LJOG default: 2.500 units/sec 150.000 units/min
note: AJOG max: 25.000 units/sec 1500.000 units/min
note: AJOG default: 25.000 units/sec 1500.000 units/min
Warning: Forward kinematics must handle duplicate coordinate letters:yy
note: jog_order='XYZA'
note: jog_invert=set()
task: main loop took 0.128303 seconds
joint 4 following error
emc/task/taskintf.cc 976: Error on joint 4, command number 136
Cannot unhome while homing, joint 4Cannot unhome while homing, joint 4
task: main loop took 0.141973 seconds
Shutting down and cleaning up LinuxCNC...
task: 6506 cycles, min=0.000033, max=0.141973, avg=0.010151, 2 latency excursions (> 10x expected cycle time of 0.010000s)
litexcnc: LitexCNC driver unloaded
Note: Using POSIX realtime

Ps: I did not reinstall the toolchain, as this was not explicitly requested

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

More
10 Feb 2024 15:18 #292998 by Mecanix
Presumably you've seen that Peter is aware and investigating the issue. Just in case you've missed it, here's the link so you can follow-up on the progress:

github.com/Peter-van-Tol/LiteX-CNC/issues/79

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

More
10 Feb 2024 15:59 #293000 by uba100
Yes, I know . He had written that it might work if I remove all PWM generators and it would help if I could post the result of that test here.
The following user(s) said Thank You: TOLP2, Mecanix

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

More
10 Feb 2024 20:34 - 10 Feb 2024 21:27 #293034 by TOLP2
The help is appreciated!

The toolchain does not influence its behavior. Going to check the behavior module by module. 

EDIT:
The culprit has been found. As soon as the encoder module is removed, the joint following error will occur. Solution for now is to remove the encoder module from the JSON. Next step is to investigate why this module is misbehaving. The number of registers reported is correct, so while writing is does not progress the required number of registers. 
Last edit: 10 Feb 2024 21:27 by TOLP2.

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

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