Mesa modbus and pktUart

More
31 Aug 2023 13:13 #279469 by PCW
Replied by PCW on topic Mesa modbus and pktUart
Does setting update-hz to a large number (say 1000) work?

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

More
31 Aug 2023 14:50 - 01 Sep 2023 08:31 #279483 by MennilTossFlykune
1000 as well as a much larger number also works. It gets rid off the following error but it turns out there are still other issues.
If I set the value of update-hz to 1 in my hal file and start LinuxCNC the following error is still there. I have to set it to 0 in halshow and then back to 1 again in before I can home the machine. However, when it's set to 1 I can't control my VFD. If I set the speed and the rotation nothing happens.
When I set the update-hz value to 0 the spindle motor immediately starts spinning and the following error appears again.
Last edit: 01 Sep 2023 08:31 by MennilTossFlykune.

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

More
31 Aug 2023 15:03 - 31 Aug 2023 15:56 #279484 by PCW
Replied by PCW on topic Mesa modbus and pktUart
There is a known bug where if you set the update-hz to 0 it cannot be set again
can you try setting it to a high value in your hal file?

Also can you post your .mod file?

Also a plot of the commanded position and feedback position might help isolate the issue


 
Last edit: 31 Aug 2023 15:56 by PCW.

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

More
01 Sep 2023 21:59 #279616 by Donno
Replied by Donno on topic Mesa modbus and pktUart
I am trying to compile .mod file using modcompile but keep getting error
[color=#5454ff]~/linuxcnc-dev/bin[/color][color=#000000]$ sudo ./modcompile mesa_modbus_A5_Driver.mod [/color]
/tmp/tmpwmbs48kd/mesa_modbus.c
make: *** No rule to make target 'mesa_modbus.c', needed by 'mesa_modbus.o'.  Stop.

I build linuxcnc on kubuntu 22.04 using the following commands
git clone git://github.com/linuxcnc/linuxcnc.git linuxcnc-devcd linuxcnc-dev/debian
./configure uspace no-docs
cd ..
dpkg-buildpackage -b -uc

I then copied modcompile from linuxcnc-dev/bin/ to linuxcnc else i get following error because of wrong path :
[color=#000000]mesa_modbus.c:21:10:[/color][color=#000000] [/color][color=#ff5454]fatal error: [/color][color=#000000]rtapi.h: No such file or directory [/color]
  21 | #include [color=#ff5454]"rtapi.h"[/color][color=#000000] [/color]
     |          [color=#ff5454]^~~~~~~~~[/color]

If i try and compile it now i get the following :
[color=#000000]sudo ./modcompile mesa_modbus_A5_Driver.mod [/color]
/tmp/tmp31lc1kki/mesa_modbus.c
make: *** No rule to make target 'mesa_modbus.c', needed by 'mesa_modbus.o'.  Stop.

Here is my driver file :
// Lichuan A5 AC Servo Drive Driver
#define MAX_MSG_LEN 16   // may be increased if necessary to max 251
#define DEBUG 1

static const hm2_modbus_chan_descriptor_t channels[] = {
/*  {TYPE,     FUNC, ADDR,   COUNT, pin_name} */
    {HAL_U32,   3,   0x9C8, 1,     "speed-actual"},
    {HAL_U32,   3,   0x9C9, 1,     "speed-instruction"},
    {HAL_U32,   3,   0x9CA, 1,     "torque-instruction"},
    {HAL_U32,   3,   0x9D4, 1,     "avg-load-rate"},
    {HAL_U32,   3,   0x9E0, 1,     "phase-current"},
    {HAL_U32,   3,   0x9E2, 1,     "bus-voltage"},
    {HAL_U32,   6,   0x9E3, 1,     "tempreture"},
};

Any help please ?

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

More
01 Sep 2023 22:14 #279618 by PCW
Replied by PCW on topic Mesa modbus and pktUart
Have you tried building LinuxCNC from source the normal RIP way?
That works for me with master and the modbus component

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

More
01 Sep 2023 22:30 #279619 by Donno
Replied by Donno on topic Mesa modbus and pktUart
Can you maybe give instructions please ?

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

More
01 Sep 2023 22:35 #279621 by PCW
Replied by PCW on topic Mesa modbus and pktUart
Just the standard build from source instructions:

linuxcnc.org/docs/devel/html/code/building-linuxcnc.html
 

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

More
01 Sep 2023 23:20 - 01 Sep 2023 23:21 #279629 by Donno
Replied by Donno on topic Mesa modbus and pktUart
That manage to do the trick

I deleted ~/linuxcnc-dev and did the following command:
git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-dev
cd linuxcnc-dev/src
./autogen.sh
./configure --with-realtime=uspace
make
sudo make setuid
source ../scripts/rip-environment
cd ~/linuxcnc-dev/bin
./modcompile
mesa_modbus_A5_Driver.mod
Last edit: 01 Sep 2023 23:21 by Donno. Reason: code tag breaks when copying

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

More
01 Sep 2023 23:57 - 01 Sep 2023 23:58 #279631 by Donno
Replied by Donno on topic Mesa modbus and pktUart
I am running into another problem :

 

I modcompile mesa_modbus_A5_Driver driver on x64 PC and copy the mesa_modbus_A5_Driver.so file to the raspberry Pi

added to .HAL file

loadrt mesa_modbus_A5_Driver ports=hm2_7i92.0.pktuart.0
addf mesa_modbus_A5_Driver servo-thread


I get error image as attached, but the file is in directory as shown.

Is there anther directory the mesa_modbus_A5_Driver.so has to be in ?
Attachments:
Last edit: 01 Sep 2023 23:58 by Donno. Reason: typo

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

More
02 Sep 2023 00:11 #279632 by tommylight
Replied by tommylight on topic Mesa modbus and pktUart
Make the file executable after copying.

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

Time to create page: 0.121 seconds
Powered by Kunena Forum