Connect manual RPM command to spinout pin

More
06 Nov 2018 11:35 #120096 by Nitram
Hi.

I have a lathe lathe I am converting to CNC. It is nearly done but I have reached an interim snag.

I have set up dual MPGs located on the saddle so that it can easily be used manually as in the past (basically in jog mode).
On the saddle I also have the jog speed selector to keep it close to hand whilst using manually as well as a 3 position fwd/reverse (center off) switch for manual spindle fwd/off/rev control.

Via some other HAL components and signals (eg. spindle latched off after pushing foot brake etc.), I ultimately have the saddle spindle fwd and reverse switch hooked up to:
halui.spindle.forward
halui.spindle.reverse
and this config is working fine.

I also have a potentiometer on the saddle to be able to command spindle rpm when working manually without having to turn away to the pc. I am having some difficulty in HAL connecting the potentiometer.

In brief, I have the output of the pot connected to a scale component to scale output to a float value correctly for the maximum RPM of the spindle.
I’m having trouble connecting the output of that signal to the pin ultimately commanding spindle speed.

Basically for the pot and scale output I have:

net saddle-spindle-pot hm2_7i76e.0.7i76.0.0.analogin3
net saddle-spindle-pot scale.manual-spindle.in
net saddle-spindle-scaled scale.manual-spindle.out
setp scale.manual-spindle.gain 230

Where the issue lies is in tying the output signal (saddle-spindle-scaled) in to the spindle RPM command pin/signal as I keep getting debugs that the appropriate pins already have other pins connected. As such I’m unsure of what component (mux?) or HAL syntax to use to bring this in.

Currently, this controls the spindle:

net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-vel-cmd-rpm-abs hm2_7i76e.0.7i76.0.0.spinout

But as I said earlier, every time I use a component (mux or otherwise) to connect signal “saddle-spindle-scaled” to signal “spindle-vel-cmd-rpm-abs” or to hm2_7i76e.0.7i76.0.0.spinout, I am met with a roadblock telling me it cannot be done.

If possible, could you please help with either the correct syntax or the correct component to join the scaled potentiometer output to the spindle rpm command pin (spinout).

Many thanks for the help.

Cheers,
Marty.

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

More
06 Nov 2018 18:10 #120111 by alan_3301
Post your hal file and if possible the error it gives, I can try to help. Basically you can't have two signals going to the spinout pin. If you were trying to use a mux it should work, maybe it just needs some tweaking.

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

More
07 Nov 2018 15:31 #120175 by andypugh
You need a mux2 component.

Here is a diagram of what the HAL would look like.

Attachments:

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

More
07 Nov 2018 23:13 #120219 by Nitram
Thanks Andy.

I ended up doing pretty much exactly as you've said, works correctly, and have all safety devices (foot brake, spindle cover) integrated to do their thing.
I did end up using an estop-latch component en-route so that whenever the foot-brake is pressed it commands off the spindle and latches it off until the M3/M4 switch on the saddle is moved back to the off position and thus resets.
I suspect it is not the ideal component to be sure, but I couldn't find any other latching component to use in lieu.

Is there a latching component other than an estop-latch component available that you are aware of?

Thanks again,
Marty.

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

More
07 Nov 2018 23:31 #120223 by alan_3301
Just in case you didn't already know, you can read about all of the common components here: linuxcnc.org/docs/html/man/man9/ I didn't see any other latches there though.

Also, you can load more than one of each component with the count or names parameter. If you want to make a custom component based off an existing one, you can get the source from github, make your changes, and compile with "sudo comp --install example.comp"

However, if what you have works and doesn't interfere with any other operation I would call it good.

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

Time to create page: 0.293 seconds
Powered by Kunena Forum