PathPilot and Modbus

More
03 Apr 2016 14:04 #72625 by smgvbest
Has anyone worked on getting a MODBUS devices working with PathPilot, example VFS Spindles? or PLC's for Digital In/Out?
Wondering what would be entailed in doing so?

my best guess is getting full linuxcnc ~2.6.3 compiling. but then can you just copy the modules to /home/operator/tmc/bin and/or lib and use them?

TIA
Sandra

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

More
03 Apr 2016 17:51 #72636 by cncbasher
Replied by cncbasher on topic PathPilot and Modbus
as far as i can see looking at the sources Modbus is installed , so you should not have any problems
just treat it exactly the same as Linuxcnc .

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

More
03 Apr 2016 20:57 #72652 by smgvbest
Replied by smgvbest on topic PathPilot and Modbus
Thank you
I did try it and added to my tormach_lathe_sim.hal
loadusr -W mb2hal config=mb2hal.ini
with jsut a default sample config

Immediately got a error. checking the log I say mb2hal not found
went to the sources directory and cp mb2hal ~/tmc/bin

Rebooted, quicker actually

Came up ok this time except excessive logging so tweaked the debug settings in the sample (doesn't actually have anything it's connecting to at this point)
Loaded HAL Components:
ID      Type  Name                                      PID   State
    30  User  halcmd2687                                 2687 ready
    34  RT    milljogtranslator                               ready
    33  User  shuttlexpress4                             2682 ready
    31  RT    time                                            ready
    28  User  tormach                                    2672 ready
    26  User  inihal                                     2671 ready
    25  RT    near                                            ready
    24  RT    scale                                           ready
    23  RT    lowpass                                         ready
    22  RT    limit2                                          ready
    21  RT    sim_encoder                                     ready
    20  RT    encoder                                         ready
>>  19  User  mb2hal                                     2657 ready
    17  User  usbio                                      2656 ready
    15  RT    not                                             ready
    14  RT    tormachltc                                      ready
    13  RT    pwmgen                                          ready
    12  RT    abs                                             ready
    11  RT    estop_latch                                     ready
    10  RT    stepgen                                         ready
     9  RT    motmod                                          ready
     8  RT    trivkins                                        ready
     7  User  halui                                      2644 ready
     5  User  iocontrol                                  2642 ready

and I can see the hal variables showing up
19  float OUT             0  mb2hal.XDrive01.00.float
    19  s32   OUT             0  mb2hal.XDrive01.00.int
    19  float OUT             0  mb2hal.XDrive01.01.float
    19  s32   OUT             0  mb2hal.XDrive01.01.int
    19  u32   OUT    0x00000000  mb2hal.XDrive01.num_errors

now to make it work

I do want to write a custom VFD Driver for the Teco EV101 but figure using mb2hal would be quickest way to get a spindle going.
also have some Modbus Relays to use which for mb2hal should be simple to implement.

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

More
04 Apr 2016 10:35 #72693 by racedirector
Replied by racedirector on topic PathPilot and Modbus
I had to install libmodbus on my PathPilot install to get mb2hal to work properly. I'll go out and check what version I installed. Yes, mb2hal had to be in ~/tmc/bin as you found out. I run an Hitachi X200 VFD via mb2hal so it is possible.

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

More
04 Apr 2016 11:19 #72697 by Swapper
Replied by Swapper on topic PathPilot and Modbus
racedirector any chance you can share the config for the Hitachi X200 VFD ?

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

More
05 Apr 2016 00:51 - 05 Apr 2016 00:59 #72755 by racedirector
Replied by racedirector on topic PathPilot and Modbus
No problem, attached.

Used like this:
# Blacksheep Woodworks Addition for x200 VFD
loadusr -Wn x200 mb2hal config=x200vfd.ini

loadrt scale count=1
addf scale.0 servo-thread
setp scale.0.gain .16666667


net spindle-speed-out scale.0.in motion.spindle-speed-out tormach.spindle-speed-out 
net x200-freq x200.frequency.00 <= scale.0.out

net x200-run x200.run.00 <= motion.spindle-on
net spindle-at-speed x200.at-speed.00 <= motion.spindle-at-speed

setp x200.direction.00 0

I don't currently use all the definitions in the ini yet, got sidetracked getting PathPilot working :)

This line connects the spindle speed to the PathPilot display. Took me a while to figure that one out!
net spindle-speed-out scale.0.in motion.spindle-speed-out tormach.spindle-speed-out 

Cheers
Attachments:
Last edit: 05 Apr 2016 00:59 by racedirector. Reason: Added PathPilot specifics

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

More
10 Apr 2016 00:08 #73017 by smgvbest
Replied by smgvbest on topic PathPilot and Modbus
Cool, Thank you for the information, I'm still setting things up on the Lathe Side. got the PathPilot PC running.
Will try running the pncconf for the mesa card and get the steppers working first, then then work on the spindle.
Good to know I can get the spindle working and my relays should follow with no problems, or so I hope.

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

Moderators: cncbasher
Time to create page: 0.120 seconds
Powered by Kunena Forum