Simple MPG HAL's

  • my1987toyota
  • my1987toyota's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
27 Jun 2021 16:30 - 29 Mar 2023 11:22 #213027 by my1987toyota
Simple Lcnc 2.8.# MPG HAL's was created by my1987toyota
FOR  VERSION 2.8.# ONLY !!!!

After being frustrated by the PNCconf not being able to generate a working MPG in the main Hal. I had to figure out how to do my own. I had found a few examples on this site and on the internet but not directly usable in my case. I then figured their has got to be many like me looking for an MPG solution but not savvy enough yet to write one on their own. This is my first posting of  HAL files. Keep in mind I am still very much a nooby when it comes to this sort of thing. USE AT YOUR OWN RISK.
  Now that that's out of the way I have HAL files for 3 axis, 4 axis , and 5 axis as well as ones with Feed and Spindle overrides. let me know if their is anything I need to address. ( I'm sure their is ). Please review the READ ME files before slapping one of these HAL's in your folder and saying they don't work. This is the main READ ME and the 3 axis HAL.
 

File Attachment:

File Name: READMEfirst.txt
File Size:4 KB


the version 1 hal file has been superseded see version 2

version 2
 

File Attachment:

File Name: mpg_3readm...9-06.txt
File Size:1 KB

 

File Attachment:

File Name: mpg_3.hal
File Size:3 KB






 
Attachments:
Last edit: 29 Mar 2023 11:22 by my1987toyota. Reason: updating info
The following user(s) said Thank You: BigJohnT, phillc54, tommylight

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

  • my1987toyota
  • my1987toyota's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
27 Jun 2021 16:36 - 06 Sep 2021 15:49 #213030 by my1987toyota
Replied by my1987toyota on topic Simple MPG HAL's
 Now the 4 axis version 1 hal has been superseded see version 2
version 2
 

File Attachment:

File Name: mpg_4readme.txt
File Size:2 KB


 

File Attachment:

File Name: mpg_4.hal
File Size:4 KB
Attachments:
Last edit: 06 Sep 2021 15:49 by my1987toyota. Reason: updating info

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

  • my1987toyota
  • my1987toyota's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
27 Jun 2021 16:37 - 06 Sep 2021 15:52 #213031 by my1987toyota
Replied by my1987toyota on topic Simple MPG HAL's
5 axis version 1 hal has been superseded see version 2
version 2
 

File Attachment:

File Name: mpg_5readm...9-06.txt
File Size:2 KB

 

File Attachment:

File Name: mpg_5_2021-09-06.hal
File Size:5 KB


    I am not sure why the mpg_5 hal keeps showing up with the date. After downloading just remove the date so that it will actually work. That said it doesn't seem to cause a problem.
Attachments:
Last edit: 06 Sep 2021 15:52 by my1987toyota. Reason: updating info

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

  • my1987toyota
  • my1987toyota's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
27 Jun 2021 16:41 - 06 Sep 2021 15:56 #213032 by my1987toyota
Replied by my1987toyota on topic Simple MPG HAL's
 Now for the one's with the Feed and Spindle overrides
the 3 axis with feed and spindle override version 1 hal has been superseded  see version 2 
version 2 
 

File Attachment:

File Name: mpg_3FSreadme.txt
File Size:2 KB

 

File Attachment:

File Name: mpg_3FS.hal
File Size:4 KB
Attachments:
Last edit: 06 Sep 2021 15:56 by my1987toyota. Reason: updating info

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

  • my1987toyota
  • my1987toyota's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
27 Jun 2021 16:42 - 06 Sep 2021 15:58 #213033 by my1987toyota
Replied by my1987toyota on topic Simple MPG HAL's
The 4 axis with F and S this version 1 hal has been superseded see version 2  
version 2 
 

File Attachment:

File Name: mpg_4FSreadme.txt
File Size:2 KB
 

File Attachment:

File Name: mpg_4FS.hal
File Size:5 KB
Attachments:
Last edit: 06 Sep 2021 15:58 by my1987toyota. Reason: updating info

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

  • my1987toyota
  • my1987toyota's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
27 Jun 2021 16:44 - 06 Sep 2021 16:00 #213034 by my1987toyota
Replied by my1987toyota on topic Simple MPG HAL's
And finally the 5 axis with F and S overrides. the version 1 hal has been superseded see version 2  
version 2 
 

File Attachment:

File Name: mpg_5FSreadme.txt
File Size:2 KB

 

File Attachment:

File Name: mpg_5FS.hal
File Size:5 KB

 
Attachments:
Last edit: 06 Sep 2021 16:00 by my1987toyota. Reason: updating info
The following user(s) said Thank You: andypugh, tommylight, spumco

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

  • my1987toyota
  • my1987toyota's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
05 Sep 2021 13:11 - 06 Sep 2021 16:06 #219667 by my1987toyota
Replied by my1987toyota on topic Simple MPG HAL's
After running into some issues with the version 1 4th and 5th axis turning very very slowly I re-wrote the hals.
When the 4th and 5th axis is selected they wont rotate at 0.0001 and 0.001 of a degree, they will be
set to 1.0, 0.1, and 0.01 degree. The best part is the hardware change. It will be using 1N4148
diodes depending on how many axis will be utilized. ( 1 for a 4 axis. 2 for a 5 axis ) The hal. changes will be using
more of the already used MUX16. The version 2 hal's are up loaded and ready . Please let me know if something
isn't working as it should . I will do my best to address the problem.
enjoy
 
Last edit: 06 Sep 2021 16:06 by my1987toyota. Reason: updating info

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

More
29 Dec 2021 21:08 #230278 by Dustin.Davis
Replied by Dustin.Davis on topic Simple MPG HAL's
I am trying to use your 3 axis mpg Hal and I am having difficulties with making it work. I finally got all the switches and the encoder counting but it wouldn’t move anything. I used the Hal meter to check that all connection were working. I would appreciate any help or advice. 

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

  • ALittleOffTheRails
  • ALittleOffTheRails's Avatar
  • Visitor
  • Visitor
30 Dec 2021 03:36 - 30 Dec 2021 03:48 #230312 by ALittleOffTheRails
Replied by ALittleOffTheRails on topic Simple MPG HAL's
I found it just easier to create a monolithic component and that takes the MPG counts and switches and just presents the signals for the joints & axis. Should be really easy to customise for for more joints and movement selections.

Below is a how my hal is setup. I use a 7i92 and a 7i73 for the MPG hardware.

loadrt mpg_pendant
addf mpg-pendant.0 servo-thread
loadrt ilowpass
addf ilowpass.0 servo-thread

setp ilowpass.0.scale 1000
setp ilowpass.0.gain 0.01

setp mpg-pendant.0.mpg-scale0 .001
setp mpg-pendant.0.mpg-scale1 .0001
setp mpg-pendant.0.mpg-scale2 .00001

#net encoder-counts  <= ilowpass.0.out

# Encoder count inputs
net jog_counts_in ilowpass.0.in <= hm2_7i92.0.7i73.0.1.enc0.count
net jog_counts_out mpg-pendant.0.encoder-counts <= ilowpass.0.out

# Axis/Joint select inputs 
net jora_x_0_select_in mpg-pendant.0.axis0 <= hm2_7i92.0.7i73.0.1.input-10-not
net jora_y_1_select_in mpg-pendant.0.axis1 <= hm2_7i92.0.7i73.0.1.input-12-not
net jora_z_2_select_in mpg-pendant.0.axis2 <= hm2_7i92.0.7i73.0.1.input-14-not

# Scale inputs
net scale_select_0_in mpg-pendant.0.scale0 <= hm2_7i92.0.7i73.0.1.input-11-not
net scale_select_1_in mpg-pendant.0.scale1 <= hm2_7i92.0.7i73.0.1.input-13-not
net scale_select_2_in mpg-pendant.0.scale2 <= hm2_7i92.0.7i73.0.1.input-15-not

# Axis Jogging
# Axis encoder outputs
net axis_counts_out <= mpg-pendant.0.axis-encoder-counts
net axis_counts_out => axis.x.jog-counts
net axis_counts_out => axis.y.jog-counts
net axis_counts_out => axis.z.jog-counts

# Axis x-y-z select
net axis_x_enable_out axis.x.jog-enable <= mpg-pendant.0.enable-axis-x
net axis_y_enable_out axis.y.jog-enable <= mpg-pendant.0.enable-axis-y
net axis_z_enable_out axis.z.jog-enable <= mpg-pendant.0.enable-axis-z

# Axis scale
net axis_scale_out <= mpg-pendant.0.axis-mpg-scale
net axis_scale_out => axis.x.jog-scale
net axis_scale_out => axis.y.jog-scale
net axis_scale_out => axis.z.jog-scale


# Joint Jogging
# Joint encoder outputs
net joint_counts_out <= mpg-pendant.0.joint-encoder-counts
net joint_counts_out => joint.0.jog-counts
net joint_counts_out => joint.1.jog-counts
net joint_counts_out => joint.2.jog-counts


# Joint 0-1-2 select
net joint_0_enable_out joint.0.jog-enable <= mpg-pendant.0.enable-joint-0
net joint_1_enable_out joint.1.jog-enable <= mpg-pendant.0.enable-joint-1
net joint_2_enable_out joint.2.jog-enable <= mpg-pendant.0.enable-joint-2

# Joint scale
net joint_scale_out <= mpg-pendant.0.joint-mpg-scale
net joint_scale_out => joint.0.jog-scale
net joint_scale_out => joint.1.jog-scale
net joint_scale_out => joint.2.jog-scale

 
Attachments:
Last edit: 30 Dec 2021 03:48 by ALittleOffTheRails.

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

  • my1987toyota
  • my1987toyota's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
30 Dec 2021 23:52 #230372 by my1987toyota
Replied by my1987toyota on topic Simple MPG HAL's

I am trying to use your 3 axis mpg Hal and I am having difficulties with making it work. I finally got all the switches and the encoder counting but it wouldn’t move anything. I used the Hal meter to check that all connection were working. I would appreciate any help or advice. 
 

A little more information about your system would help.
What board are you using ?
What version of linuxcnc are you using?
Are you trying to use the MPG before homing ?
ECT. ECT

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

Time to create page: 0.101 seconds
Powered by Kunena Forum