Need help with the orient component for spindle activation (M19)

More
08 Feb 2022 12:35 - 08 Feb 2022 12:37 #234338 by jpg
Hello ,I modified spindle hal and ini ( I had forgotten DEADBAND & MAX_OUTPUT ) but no change in orient mode (the relay triggers, but no rotation for the engine )
Attachments:
Last edit: 08 Feb 2022 12:37 by jpg.

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

More
11 Feb 2022 12:08 - 12 Feb 2022 15:17 #234564 by jpg
Hello, after several inconclusive attempts for a week (no spindle rotation in M19 RXX; I think that there is not much missing to get there..), I would like to ask you for help on this port configuration // because I want to make the whole thing work before switching to a MESA card; thank you for your patience.

I found this (that's Andy  who developed it).
www.forum.linuxcnc.org/24-hal-components...l-questions?start=90
I attach an extract of the modified HAL, I wonder how to hang up my spindle entries:

net spindle-fwd abs.0.is-positive parport.0.pin-14-out
net spindle-rev abs.0.is-negative parport.0.pin-16-out



addf pid.0.do-pid-calcs servo-thread #Velocity
addf pid.1.do-pid-calcs servo-thread #Position

loadrt orient
addf orient.0 servo-thread

loadrt mux2 count=1 #This has already been loaded in the sim_vmc.hal
addf mux2.0 servo-thread #chooses which pid output goes to the spindle speed control

net spindle-vel pid.0.feedback
net spindle-vel-cmd-rps motion.spindle-speed-out-rps pid.0.command
net spindle-vel-pid pid.0.output mux2.0.in0
net spindle-pos pid.1.feedback orient.0.position
net spindle-pos-cmd orient.0.command pid.1.command
net spindle-angle motion.spindle-orient-angle orient.0.angle
net spindle-pos-pid pid.1.output mux2.0.in1
net spindle-in-pos orient.0.is-oriented => motion.spindle-is-oriented

setp orient.0.tolerance 1

# this switches modes
net orient-mode motion.spindle-orient orient.0.enable pid.1.enable mux2.0.sel
net velocity-mode motion.spindle-on pid.0.enable

#for a real spindle run by a VFD
loadrt or2 count=1 #turn on spindle in both orient & velocity mode
addf or2.0 servo-thread
net orient-mode or2.0.in0
net velocity-mode or2.0.in1
net spindle-either-cmd or2.0.out hm2_5i25.0.7i77.0.1.spinena
net spindle-cmd mux2.0.out hm2_5i25.0.7i77.0.1.analogout5

# Tune the PID from the INI values
setp pid.0.Pgain [SPINDLE]PGAIN_V
setp pid.0.Igain [SPINDLE]IGAIN_V
setp pid.0.Dgain [SPINDLE]DGAIN_V
setp pid.0.FF0 [SPINDLE]FF0_V
setp pid.0.FF1 [SPINDLE]FF1_V
setp pid.1.Pgain [SPINDLE]PGAIN_P
setp pid.1.Igain [SPINDLE]IGAIN_P
setp pid.1.Dgain [SPINDLE]DGAIN_P
setp pid.1.FF0 [SPINDLE]FF0_P
setp pid.1.FF1 [SPINDLE]FF1_P

#Original spindle conf made by Pncconf
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.1.analogout5-scalemax [SPINDLE]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout5-minlim [SPINDLE]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout5-maxlim [SPINDLE]OUTPUT_MAX_LIMIT

# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.03.counter-mode 0
setp hm2_5i25.0.encoder.03.filter 1
setp hm2_5i25.0.encoder.03.index-invert 0
setp hm2_5i25.0.encoder.03.index-mask 0
setp hm2_5i25.0.encoder.03.index-mask-invert 0
setp hm2_5i25.0.encoder.03.scale [SPINDLE]ENCODER_SCALE

net spindle-pos <= hm2_5i25.0.encoder.03.position
net spindle-vel <= hm2_5i25.0.encoder.03.velocity
net spindle-index-enable <=> hm2_5i25.0.encoder.03.index-enable

# ---setup spindle control signals---
net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-vel-cmd <= motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-brake <= motion.spindle-brake
net spindle-pos => motion.spindle-revs
net spindle-at-speed => motion.spindle-at-speed
net spindle-vel => motion.spindle-speed-in
net spindle-index-enable <=> motion.spindle-index-enable

sets spindle-at-speed true
Last edit: 12 Feb 2022 15:17 by jpg.

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

More
More
08 Mar 2022 20:06 - 08 Mar 2022 20:17 #236706 by jpg
Good evening to all, after some tests, I manage to make orient (I keep the variable speed and the display) with the configuration "gm" (it is functional) on Chinese BOB, but I still can't do the same thing with the configuration "ANDY" this last one seems to me however more evolving because in orient mode, the relay declenches in the 2 directions (CW /CCW) but not the motor (there must not be much missing but there is no example with the parallel port. .), ;-( , I would be really happy if someone can help me




 
Attachments:
Last edit: 08 Mar 2022 20:17 by jpg.

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

More
09 Mar 2022 23:48 #236794 by andypugh
There is more than one INI in the zip file, which one are you asking about?

How do you drive your spindle motor?

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

More
10 Mar 2022 12:33 - 10 Mar 2022 17:05 #236838 by jpg
Hi Andy, I took out the HAL, INI, and SPINDLE files of your vismach version (it's the one I find the most advanced, the splindle turns in both directions in orient mode, like your video) my spindle is in PWM (Altivar 31) and the problem, in this configuration, the relay triggers in both directions, but not the motor (in orient mode)
....
setp parport.0.pin-17-out-invert 1
net spindle-pwm pwmgen.0.pwm parport.0.pin-17-out
net spindle-fwd abs.0.is-positive parport.0.pin-14-out
net spindle-rev abs.0.is-negative parport.0.pin-16-out .... ( I searched in these lines, but nothing concrete :-( )

On the "GM" configuration no worries, everything works, but always in only 1 direction (in orient mode, of course)

 
Attachments:
Last edit: 10 Mar 2022 17:05 by jpg.

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

More
11 Mar 2022 00:13 #236909 by andypugh
I think you need to use halmeter to track the signals through the HAL (which is a little bit complicated)

It might just be that your position PID function needs calibrating. (though it looks plausible)

Does the mux "sel" change in orient mode, for example. Do the two PID components turn on at the right times, with plausible outputs.

Is it just that a "motor on" signal is missing from the config?

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

More
11 Mar 2022 05:48 #236918 by jpg
I think your last option is the most plausible, but I don't know how to send this information to linuxcnc

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

More
11 Mar 2022 09:52 #236925 by andypugh
Does the motor turn under normal conditions?

What are the various parallel port pins connected to?

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

More
11 Mar 2022 16:46 - 11 Mar 2022 17:23 #236944 by jpg
the motor turns normally (PWM), when I type M3/M4 S200 or other and stop (M5), I think only that it does not have the information to turn when I launch a M19 R45 or other; the most vexing for me, it is that the relay starts and stops when I turn the encoder (by hand, I did not connect it to the spindle, for now)
this is what I try to show on the video (at 2mn 11) sorry for the schema, I did it quickly ;-)


 

 
Attachments:
Last edit: 11 Mar 2022 17:23 by jpg.

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

Time to create page: 0.588 seconds
Powered by Kunena Forum