Mesa modbus and pktUart

More
3 years 3 months ago #276396 by andypugh
Replied by andypugh on topic Mesa modbus and pktUart

On the Huanyang GT series, to turn the motor on, you write 0x01 to register 0x1000. To turn it off, you write 0x05 to register 0x1000.

You might find this HAL component useful, in that case:
linuxcnc.org/docs/2.9/html/man/man9/enum.9.html

The docs state "In addition to the pins configured in the definition file, each module will create the following pins for each instance of the driver:"
I find that those HAL pins are not created.


fault and last-err should be created as pins. The others are parameters. These can still be "setp" to values but can't be netted. The manual page needs an update. you should see them with halcmd show param ?

There's something it doesn't like about retval in the rtapi_app_main function.


In that case it won't load at all?

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

More
3 years 3 months ago #276406 by persei8
Replied by persei8 on topic Mesa modbus and pktUart
So I removed all the nets for those extra pins and set values via setp. This means they can no longer be set programmatically. Not sure that's really a problem but it does set them in stone, so to speak. This brings me to a couple other questions.
Why does the module want a motor pin when I set the motor on/off by writing a modbus register? What does it do?
Is the last-error pin an index to a list of error messages? If not, what is it?
Jim
 

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

More
3 years 3 months ago #276408 by andypugh
Replied by andypugh on topic Mesa modbus and pktUart
Generally LinuxCNC provides a bit-type output to turn on and off the spindle.

It seems that your Modbus driver doesn't really support that, so I think what you currently have it probably OK for the driver.

To send the 0x1 / 0x5 to the modbus driver you can either use the enum component I mentioned, (loadrt enum enums=E;;start;;;;stop should probably work) or maybe use a mux component if you prefer.

Are there any other values that can be sent to that register to do other things?

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

More
3 years 3 months ago - 3 years 3 months ago #276413 by persei8
Replied by persei8 on topic Mesa modbus and pktUart
I'm using a user space HAL component to drive the mesa_modbus component. It receives spindle.0.on from linuxcnc and converts it to 1 or 5 for the modbus register. Register 0x1000 does other things, none of which I need. It would be easy enough to replace the userspace component with the enum component. I'm beginning to think this mesa_modbus component is intended to run as a standalone modbus vfd driver? 
Last edit: 3 years 3 months ago by persei8. Reason: Confusion

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

More
3 years 3 months ago #276414 by andypugh
Replied by andypugh on topic Mesa modbus and pktUart

I'm beginning to think this mesa_modbus component is intended to run as a standalone modbus vfd driver? 
I am not sure what you mean by that. All that it does is convert HAL pins to Modbus messages and Modbus messages into HAL pins. 

Which (along with the enum component) should be enough for most VFDs. 

There is also the dedicated component for the HY GT VFD but that can't use the Mesa UART connection. 

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

More
3 years 3 months ago #276416 by persei8
Replied by persei8 on topic Mesa modbus and pktUart
Actually, I need to keep my user space component because there's another register operation that needs to be done and there's probably no prebuilt component for that. To set the motor speed on this VFD, you set the percentage of the programmed maximum speed. It also checks that the commanded speed is within the specified range between a minimum and a maximum. All that aside, I think it's working. I just need to switch the modbus wires over to the 7i96.

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

Time to create page: 0.207 seconds
Powered by Kunena Forum