trouble getting hal_hscale1 value in py handler

More
12 years 11 months ago #41251 by cmorley

btvpimill wrote: now for my next question, I see how to send some spindle commands using linuxcnc.command and

spindle(SPINDLE_FORWARD) ...

but I have yet to find how to set the speed. is there a way or do I need to

halcomp[motion.spindle-speed-out] = my_speed_value

which also I have not figured out how to make work :(


Not sure if your using 2.5.3 or master.
If using master you can set the RPM within linuxcnc.command

self.linuxcnc.command.spindle(direction, rpm);

direction would be 0, 1 or -1

Chris M

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

More
12 years 11 months ago #41252 by btvpimill
more stuff I forgot to tell.

I am using 2.5.3

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

More
12 years 11 months ago - 12 years 11 months ago #41269 by eszyman
Humm,
another way to look at this is our spindle is controlled directly via a hal signal linked off the spindle-cmd and spindle-enable pins.
in our hal file we have:
# spindle on / off
net spindle-enable <= motion.spindle-on => ourbox.0.pin-25-out
# spindle speed control
net conv1 conv-float-u32.0.in motion.spindle-speed-out
net c-spindle-cmd <= conv-float-u32.0.out => ourbox.0.spindle-speed-out

So our spindle-speed-out accepts values from 0 to 20000. The issue we have here is that the spindle will not start until we have a minimum value of 5000.
Now we are trying to creating our own glade spindle button much like that of Axis, because when we click the axis spindle start button we need to click the '+' button at least 50 times... haha!

It would seem a trivial task to make a python interface layer to set out spindle speed out to 5k to 20k via our slider to turn on our spindle. If we go the MDI route axis complains the machine must be in MDI mode to turn on / off the spindle and looks kinda clunky. Perhaps not.

Maybe there is an easier work around to better configure the axis buttons?
(This solution is not ideal however because we have the same issue for hot wire control, only in this case the axis button does not exist)
Last edit: 12 years 11 months ago by eszyman.

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

More
12 years 10 months ago #41291 by eszyman
Can anyone point me in a direction to see an example where a hal float style pin is set to a given vale or changed through python? is this even possible?

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

More
More
10 years 11 months ago #65135 by markder13
Hi

can you please share your code on getting the hscale value. I have the same problem.

regards

mark

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

Moderators: HansU
Time to create page: 0.361 seconds
Powered by Kunena Forum