mesaCT, 7i95t and SPINx

More
22 Jan 2024 17:54 - 25 Jan 2024 21:53 #291351 by DK8DE
Hello,I'm new to LinuxCNC and come from an electronics background, with good familiarity in C. I installed the MesaCT tool and managed to get the three steppers for XYZ working. However, in the spindle tab of the tool, I can't select anything; all buttons are greyed out. I would like to connect the SPINx to channel 5, where I assume the PWM signal is. What settings do I need to adjust in MesaCT to implement this? Writing the .hal file still confuses me a bit. Does anyone have a sample configuration, or can anyone advise what settings I need to adjust in MesaCT to get the spindle running?
Best regards, Jörg 
Edit:

File Attachment:

File Name: 7i95t_xyz.ini
File Size:4 KB
 

File Attachment:

File Name: main.hal
File Size:7 KB
On channel 5, the Dir signal switches with the change of direction, but I don't have a PWM output on Step. I have attached the configuration.Best regards, Jörg
Attachments:
Last edit: 25 Jan 2024 21:53 by DK8DE.

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

More
28 Jan 2024 16:10 #291814 by DK8DE
Replied by DK8DE on topic mesaCT, 7i95t and SPINx
Problem has been resolved. Here are the parts from the INI and HAL:

#### INI
[SPINDLE_0]
TYPE = pwm
PWM_TYPE = 1
PWM_FREQUENCY = 5000
SCALE = 24000



#### HAL
# hostmot2 driver
loadrt hostmot2

loadrt [HM2](DRIVER) board_ip=[HM2](IPADDRESS)
setp hm2_[MESA](BOARD).0.watchdog.timeout_ns 5000000

# THREADS
addf hm2_[MESA](BOARD).0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.0.do-pid-calcs servo-thread
addf pid.1.do-pid-calcs servo-thread
addf pid.2.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf hm2_[MESA](BOARD).0.write servo-thread
# Spindle Connections
net spindle-vel-cmd <= spindle.0.speed-out
net spindle-vel-cmd => pid.s.command
net spindle-pid-out <= pid.s.output
net spindle-pid-out => hm2_[MESA](BOARD).0.pwmgen.00.value

########################......

#Spindel

# Spindle PWM Setup
setp hm2_[MESA](BOARD).0.pwmgen.00.output-type [SPINDLE_0](PWM_TYPE)
setp hm2_[MESA](BOARD).0.pwmgen.pwm_frequency [SPINDLE_0](PWM_FREQUENCY)
setp hm2_[MESA](BOARD).0.pwmgen.00.scale [SPINDLE_0](SCALE)

# Spindle Feedback
setp spindle.0.at-speed true

# Spindle Command Pins
net spindle-on <= spindle.0.on
net spindle-on => pid.s.enable
net spindle-on => hm2_7i95.0.ssr.00.out-00
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake

# Spindle Enable
net spindle-on <= spindle.0.on
net spindle-on => hm2_[MESA](BOARD).0.pwmgen.00.enable

# standard components
loadrt pid names=pid.0,pid.1,pid.2,pid.s
The following user(s) said Thank You: Sergiy_J_S_Automatic

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

More
30 Jan 2024 15:45 #291988 by Sbvr4
Replied by Sbvr4 on topic mesaCT, 7i95t and SPINx
Hi Jorg,

How did you go about solving the issue? I am experiencing the same problem.

Thank you,
Sean

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

More
28 Feb 2024 19:18 #294715 by Sergiy_J_S_Automatic
Your configuration files helped me. I suffered with this problem for 2 weeks.

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

More
28 Feb 2024 19:20 #294717 by Sergiy_J_S_Automatic
If you haven't solved your question, I can try to help.

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

More
29 Apr 2024 16:34 - 29 Apr 2024 16:36 #299325 by DK8DE
Replied by DK8DE on topic mesaCT, 7i95t and SPINx
Hello,All my issues are resolved. The spindle is running, and the end stops and stepper motors are also functioning. For those looking for an example, I have attached the files.
 

File Attachment:

File Name: io.hal
File Size:1 KB

 

File Attachment:

File Name: custom.hal
File Size:0 KB

 

File Attachment:

File Name: handrad.hal
File Size:10 KB
 
 

File Attachment:

File Name: spindel_alt_neu.hal
File Size:6 KB

File Attachment:

File Name: spindel_alt_neu.ini
File Size:7 KB
Attachments:
Last edit: 29 Apr 2024 16:36 by DK8DE.

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

Time to create page: 0.325 seconds
Powered by Kunena Forum