Mesa 5i25 7i77 0-10v spindle output Dual spindles

More
29 Aug 2014 18:14 #50452 by ArcEye
Hi

This is the code for M103:
#!/bin/bash
#Set spindle2 cw output
halcmd setp hm2_[HOSTMOT2](BOARD).0.7i77.0.0.output-04 True
halcmd setp hm2_[HOSTMOT2](BOARD).0.7i77.0.0.output-05 False
exit 0


You cannot use the notation

hm2_[HOSTMOT2](BOARD).0.7i77.0.0.output-04

outside of hal files, because it relies upon being able to read the ini file and substitute [HOSTMOT2](BOARD) for what appears in the ini file under that heading.

Just use hm2_5i25.0.7i77.0.0.output-04 or whatever applies

Also what is the #!/bin/bash for?


The Bourne Again SHell is the command interpreter shell which actually runs the commands in your M103 file, the same as if you typed them into a terminal.

regards

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

More
29 Aug 2014 18:38 #50455 by jeeybee
Thanks that fixed that problem but now I got another.
When no M3 command has been issued it seem that no S value is given to the analog outputs and I would like to have the normal spindle on M3 and the secondary at M103.
Is it possible to enable the S output from the M103 file?

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

More
29 Aug 2014 19:00 #50457 by ArcEye
halcmd setp halui.mdi-command-01 1 (with coresponding setting in ini file

or

axis-remote --mdi 'S600'

are 2 possible ways, unless you can set the pin directly

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

More
29 Aug 2014 19:21 #50459 by jeeybee
What kind of settings are required in the INI file?
And what exactly what does this command do?

Just to be clear, I dont want to issue an M3 as that will start the wrong spindle.
I will issue a S24000 and M103 when I want the second spindle to start at 24000rpm

The axis-remote......s600 is only isuing an s600 from the MDI right?

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

More
29 Aug 2014 19:50 #50460 by ArcEye

What kind of settings are required in the INI file?
And what exactly what does this command do?


www.linuxcnc.org/docs/devel/html/gui/halui.html

The axis-remote......s600 is only isuing an s600 from the MDI right?


Correct. The first method is probably better than using an external program.

You can only have one speed set, unless the speed of the second spindle is determined by something other than the S setting.

Which means effectively that only one spindle can be on at a time, or that they both rotate at the same speed if using the gcode S parameter

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

More
29 Aug 2014 21:21 #50471 by jeeybee
I have two analog outputs with different scales and then I start the spindles with different digital outputs.
So if I want spindle one to start at 3000 rpm I write S3000 and then M3
And if I want the second spindle to start at 24000rpm i write S24000 and then M103
The problem is that I also have to issue a M3 to get the pin motion.spindle-speed-out to give any value at all.

I have been playing around with this now and I cant see how this helps, the only way to get the S command to work is when I issue a M3 but then it starts the first spindle so that is no good.

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

More
29 Aug 2014 21:43 #50475 by ArcEye
You can connect motion.spindle-speed-out to whatever you want

You could connect it in your hal file to the normal signal and IN pin

net spindle-vel-cmd motion.spindle-speed-out => hm2_5i25.0.7i77.0.0.spinout

net spindle-vel-cmd2 => [second spindle speed input]

which would pass to spindle 1 by default

Then in your M103

halcmd unlinkp motion.spindle-speed-out
halcmd net spindle-vel-cmd2 motion.spindle-speed-out

Next time you enter M3 the vel-cmd will pass to your second spindle

I do not know exactly what you are doing, so this is an example not cut and paste

See this
www.linuxcnc.org/docs/devel/html/hal/basic_hal.html

regards

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

More
29 Aug 2014 23:19 #50486 by jeeybee
The main thing remaining is the swap the forward and reverse outputs in a smart way, first I thought I could control the first spindle with M3 and the second with M103 but as I cant get the speed output to work without issuing a M3 I will have to do something like you wrote.
So I have been trying to unlinkp and net a number of different pins but I only managed to unlink the first spindle output but the other outputs did not net correctly.

This is what I have done

#Spindle on/off CW/CCW
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-cw => hm2_[HOSTMOT2](BOARD).0.7i77.0.0.output-02
net spindle-ccw => hm2_[HOSTMOT2](BOARD).0.7i77.0.0.output-03

#Spindle2 on/off cw/ccw
net spindle2-cw => hm2_[HOSTMOT2](BOARD).0.7i77.0.0.output-04
net spindle2-ccw => hm2_[HOSTMOT2](BOARD).0.7i77.0.0.output-05

and then to swap outputs I have done this in M101

#!/bin/bash
#Unlink spindle1 and link spindle 2 outputs
halcmd unlinkp motion.spindle-forward
halcmd unlinkp motion.spindle-reverse
net spindle2-cw <= motion.spindle-forward
net spindle2-ccw <= motion.spindle-reverse
#Analogout5 enable
halcmd setp hm2_5i25.0.7i77.0.1.spinena True
exit 0

I also tried to unlinkp the digital output but got no succes there either?

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

More
29 Aug 2014 23:42 #50487 by ArcEye
The error message will tell you what is wrong

Run linuxcnc and start your config

Open a terminal, and unlinkp and net as per your script, the error will tell you why it fails.
(use halcmd show pin between commands and you can check if pins unlinked or linked sucessfully from the last command)

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

More
30 Aug 2014 01:24 #50491 by jeeybee
Ok, I did as you said ant whent thorough the commands in terminal and get the following error:

The unlinkp commands seem to work fine but not the below code:

halcmd net spindle-cw => hm2_5i25.0.7i77.0.0.output-04
<commandline>:0: 'net' requires at least one pin, none given

Or if I try like this:

halcmd net spindle2-cw <= motion.spindle-forward
bash: =: No such file or directory

???

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

Time to create page: 0.078 seconds
Powered by Kunena Forum