Rc Pwm Servo Spindle setting

More
16 Oct 2013 05:16 #39927 by sandro_cnc
Hello I hope that now is running wheel. In the picture enc you can see the module running and after i go to post the hal file.
On the other picture you can see on the startup the configuration change for the loading (emc2) to the end of load (emc1) why ??
And last one question is possible control the spindle speed with a bar like the velocity? I try to do my best but I new so you need to be patient
Thanks :whistle:
Attachments:

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

More
16 Oct 2013 05:33 #39928 by sandro_cnc
loadrt hal_parport cfg="0x0378"
addf parport.0.read base-thread 1
addf parport.0.write base-thread -1
linksp Xstep => parport.0.pin-03-out
linksp Xdir => parport.0.pin-02-out
linksp Ystep => parport.0.pin-05-out
linksp Ydir => parport.0.pin-04-out
linksp Zstep => parport.0.pin-07-out
linksp Zdir => parport.0.pin-06-out
linkpp iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared
linkpp iocontrol.0.tool-change iocontrol.0.tool-changed
newsig spindle-on bit
linkps motion.spindle-on => spindle-on
linksp spindle-on => parport.0.pin-01-out
setp parport.0.pin-01-out-invert 1
loadrt pwmgen output_type=0
setp pwmgen.0.min-dc 0.06
setp pwmgen.0.max-dc 0.24
setp pwmgen.0.scale 1120.00
setp pwmgen.0.pwm-freq 100.00
setp pwmgen.0.enable TRUE
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-on motion.spindle-on => pwmgen.0.enable
net spindle-pwm pwmgen.0.pwm => parport.0.pin-13-out
newsig homeswitches0 bit
linkps axis.0.home-sw-in => homeswitches0
linksp homeswitches0 => parport.0.pin-10-in
newsig homeswitches1 bit
linkps axis.1.home-sw-in => homeswitches1
linksp homeswitches1 => parport.0.pin-11-in
newsig homeswitches2 bit
linkps axis.2.home-sw-in => homeswitches2
linksp homeswitches2 => parport.0.pin-12-in
linksp Xen => parport.0.pin-17-out

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

More
16 Oct 2013 05:43 #39929 by andypugh
[quote="sandro_cnc" post=39927On the other picture you can see on the startup the configuration change for the loading (emc2) to the end of load (emc1) why ??[/quote]

I am not sure what you are asking, but if it is why the spindle controls are greyed-out, it is because the machine is turned off.

You can only control something with one thing at a time in LinuxCNC. SO you can control the spindle _either_ with a slider, or with the spindle speed controls.

If you _really_ want to, you can set up a pyvcp or gladevcp panel with a slider and a checkbox to enable the slider, then use a mux2 in HAL to choose between the two methods on the basis of the checkbox.
The following user(s) said Thank You: sandro_cnc

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

More
16 Oct 2013 18:50 #39954 by sandro_cnc
you are right, I try to explain better.
1)Now with the HAL configuration post before the EMC is running. when the program is loading is visible in the red circle on the picture emc2.jpg other choice like Aria , Liquido in light grey and when the program is load in the emc1.jpg don't appear, i have wrong something in the configuration or is normal?
2) In the picture emc.jpg i have try to test the pwm and something is running i hope well if i use the the button + or - the value that in the picture is 26 increase or decease i have try the oscilloscope but I'm not so expert so maybe i have wrong some setting.
3) use the button + or - to control the spindle speed si boring can i use a slide bar like speed for example to control the PWM period ?

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

More
16 Oct 2013 19:05 #39958 by andypugh

1)Now with the HAL configuration post before the EMC is running. when the program is loading is visible in the red circle on the picture emc2.jpg other choice like Aria , Liquido in light grey and when the program is load in the emc1.jpg don't appear, i have wrong something in the configuration or is normal?

It is normal. Axis hides any controls that don't do anything. If your hal file contained (for example) "net coolant-flood iocontrol.0.coolant-flood" then the controls would stay there.

2) In the picture emc.jpg i have try to test the pwm and something is running i hope well if i use the the button + or - the value that in the picture is 26 increase or decease i have try the oscilloscope but I'm not so expert so maybe i have wrong some setting.

If you are using the Halscope oscilloscope then you would need to look at the pwmgen.0.pwm pin, and the Halscope would need to be sampling in the base thread.
If you are using a real oscilloscope, then you need to have the pwmgen.0.pwm pin connected to a parallel port pin (if the oscilloscope is connected to a parallal port pin).

3) use the button + or - to control the spindle speed si boring can i use a slide bar like speed for example to control the PWM period ?

Normally the spindle speed is set by the "S" command in G-code. I think you probably want to keep this ability.
You can open the MDI tab (F5) and type "M3 S1000" if you want.
The following user(s) said Thank You: sandro_cnc

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

More
16 Oct 2013 19:10 #39959 by sandro_cnc
In your opinion the configuration hal posted is ok ?

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

More
16 Oct 2013 19:20 #39961 by andypugh

In your opinion the configuration hal posted is ok ?


It looks OK.
The newsig / linkps / linksp format is a little old-fashioned, you can do it all in one "net" line now, but that is just a point of style.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum