Mesa modbus and pktUart

More
3 years 1 month ago #280127 by PCW
Replied by PCW on topic Mesa modbus and pktUart
Debug should print the sent data in any case

Did you try different parity options?

EDIT:
Actually the commands in your .mod file don't make sense to me:

Function 3 is read multiple registers...

// Lichuan A5 AC Servo Drive Driver
#define MAX_MSG_LEN 16   // may be increased if necessary to max 251
#define DEBUG 3

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"},
};
 

Please Log in to join the conversation.

More
3 years 1 month ago #280175 by Donno
Replied by Donno on topic Mesa modbus and pktUart
Ok I did a clean install with linuxcnc 2.10pre, rebuild my driver
Code:
// Lichuan A5 AC Servo Drive Driver #define MAX_MSG_LEN 16   // may be increased if necessary to max 251 #define DEBUG 3 static const hm2_modbus_chan_descriptor_t channels[] = { /*  {TYPE,     FUNC, ADDR,   COUNT, pin_name} */     {HAL_U32,   4,   0x0000, 1,     "test1"},     {HAL_U32,   4,   0x0001, 1,     "test2"},     {HAL_U32,   4,   0x9C8, 1,     "speed-actual"},     {HAL_U32,   4,   0x9C9, 1,     "speed-instruction"},     {HAL_U32,   4,   0x9CA, 1,     "torque-instruction"},     {HAL_U32,   4,   0x9D4, 1,     "avg-load-rate"},     {HAL_U32,   4,   0x9E0, 1,     "phase-current"},     {HAL_U32,   4,   0x9E2, 1,     "bus-voltage"},     {HAL_U32,   4,   0x9E3, 1,     "tempreture"},     {HAL_U32,   6,   0x4CB, 1,     "set-speed"}, };

I run linuxcnc in terminal and started from parity 0..2 and for each change i ran through the 4 options on my servo drive waited a min or two then went to next option but get the same on all options :

 

Attachment not found



A and B signals still looks good :

 

Attachment not found


 

Please Log in to join the conversation.

More
3 years 1 month ago #280206 by PCW
Replied by PCW on topic Mesa modbus and pktUart
Where did you get the function numbers from?
Are all except the last read functions?

Also looks like you lost the pulldown on B
 

Please Log in to join the conversation.

More
3 years 1 month ago #280215 by Donno
Replied by Donno on topic Mesa modbus and pktUart
I decided to make video too long to write :



Feedback would be appreciated.

Please Log in to join the conversation.

More
3 years 1 month ago #280217 by PCW
Replied by PCW on topic Mesa modbus and pktUart
How did you get the function numbers?
(they were 3 initially except for the last=6 and then 4 in your later .mod file)

Please Log in to join the conversation.

More
3 years 1 month ago #280218 by Donno
Replied by Donno on topic Mesa modbus and pktUart
As you pointed out 3 is for Reading multiple holding registers i changed to 4 to read each individual register to get a hal varible. 6 is for writing single register 1227 controls my spindle that is 0x4cb in hex

Please Log in to join the conversation.

More
3 years 1 month ago #280219 by PCW
Replied by PCW on topic Mesa modbus and pktUart
Actually, looking at earlier scope shots, I think you have an issue with
your firmware:

(baud rate is ~16X too low)

This may mean you are using relative current source but don't have the
latest pktuart versions (2) in the pinout file

Please Log in to join the conversation.

More
3 years 1 month ago #280220 by Donno
Replied by Donno on topic Mesa modbus and pktUart
Can help me with "pktuart versions (2)" please ?

Please Log in to join the conversation.

More
3 years 1 month ago #280223 by Donno
Replied by Donno on topic Mesa modbus and pktUart
Do i have to change the pin description ?
Code:
        IOPortTag & x"00" & PktUARTRTag & PktURDataPin,         -- I/O 20             IOPortTag & x"00" & PktUARTTTag & PktUTDataPin,           -- I/O 21         IOPortTag & x"00" & PktUARTTTag & PktUTNDrvEnPin,        -- I/O 22

Please Log in to join the conversation.

More
3 years 1 month ago #280224 by PCW
Replied by PCW on topic Mesa modbus and pktUart
No, the module description section needs to change:
                                
(PktUARTTTag,            x"02",    ClockLowTag,        x"01",    PktUARTTDataAddr&PadT,            PktUARTTNumRegs,        x"00",    PktUARTTMPBitMask),
(PktUARTRTag,            x"02",    ClockLowTag,        x"01",    PktUARTRDataAddr&PadT,            PktUARTRNumRegs,        x"00",   PktUARTRMPBitMask),

 

Please Log in to join the conversation.

Time to create page: 0.583 seconds
Powered by Kunena Forum