Spindle control woes

More
13 Oct 2017 22:36 #100336 by babinda01
Hi Guys
I am setting up a Fadal machining centre with closed loop spindle speed control. I am using a Mesa 5i24, and a 7i47s is in charge of my spindle control. My spindle encoder has differential signals, but only A and B channel - no index pulse at all - these signals are fed into my 7i47s board.

My first problem is that my spindle speed is not at the correct ratio, but I'm not overly worried with that at the moment, as I can play with that at a later date. I am also running my spindle pwm on the servo thread and so I understand my scaling will not be quite linear (7i47s manual suggests 5Khz). I was hoping that by running the spindle in closed loop mode the pwm would change to produce the correct revs, and so my non linear problem would disappear.
My main problem is that the revs creep up - for example, I command S10, the actual spindle speed is 12RPM and it is stable for about 5-10 seconds and then it just slowly creeps up exponentially until after a minuteor so im doing about 1000RMP.
As I mentioned a bit earlier, I am only using A & B phases from the encoder and all the examples I have dug up use the index pulse.

Can anyone please suggest what I should be trying to do.

Thanks
Andrew
Attachments:

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

More
13 Oct 2017 22:48 #100337 by PCW
Replied by PCW on topic Spindle control woes
You have the spindle setup for closed loop (PID) control which will require tuning

I would verify that open loop control works properly first by temporarily changing

net spindle-output => hm2_5i24.0.pwmgen.04.value
to
net spindle-vel-cmd-rpm => hm2_5i24.0.pwmgen.04.value

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

More
14 Oct 2017 00:14 #100338 by babinda01
Replied by babinda01 on topic Spindle control woes
Thanks for the info. I will try it as you suggested in open loop mode first.
The next thing I need to get going will be rigid tapping. Will that be possible with only the A&B signals, or will it require the Z pulse also.
The machine does have a one pulse per rev (Prox switch) mounted on the spindle - not on the motor which has a belt reduction. The encoder is on the actual motor.

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

More
14 Oct 2017 01:05 #100339 by PCW
Replied by PCW on topic Spindle control woes
You will need an index for rigid tapping, the proximity switch should work
but you may need some level shifting (a couple resistors) to drive the 7I47S inputs.

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

More
15 Oct 2017 21:00 #100414 by babinda01
Replied by babinda01 on topic Spindle control woes
Thanks.

Now for the next one......... Once the zpulse was wired in, I now have the spindle tuned and running perfectly in both direction,
I now need to get rigid tapping working. Since the encoder is mounted on the spindle motor, and the motor is attached to the spindle by a 2:1 belt drive, it now means that the "actual" spindle will have 2 possible zpulses per rev. So how can I use this for my rigid tapping cycle? I do have a prox switch wired into a 7i84, that give me one pulse per rev of the spindle - currently I am only using this for my orient command (remapped MCode). Can this prox switch be used some how in conjunction with the spindle encoder for the tapping cycle?


Andrew

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

More
15 Oct 2017 23:22 #100418 by PCW
Replied by PCW on topic Spindle control woes
One option would be to take the proximity switch hardware signal
and convert it into a signal that would drive the 7I74S index input
Perhaps with an OPTO coupler

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

More
15 Oct 2017 23:37 #100420 by babinda01
Replied by babinda01 on topic Spindle control woes
Hi Peter
Thanks, I had a spare ENC422 board, so I put my prox through that, and now I have my Z pulse working.

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

More
15 Oct 2017 23:58 #100421 by babinda01
Replied by babinda01 on topic Spindle control woes
On the 7i47s, the there are termination jumpers on the encoder inputs. Am I correct in setting these to the left for differential encoders?

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

More
16 Oct 2017 00:35 #100422 by PCW
Replied by PCW on topic Spindle control woes
Yes, Left for terminated

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

More
16 Oct 2017 10:55 - 16 Oct 2017 11:01 #100429 by Nitram
Replied by Nitram on topic Spindle control woes
Hi Peter and thanks for the reply. For this Fadal I have been Andrew's (Babinda01) helper. He busy tonight and asked whether I could post this query.

Andrew was able to get the spindle to run correctly in open loop and thus we went back to see if we could then configure the spindle correctly for closed loop (we thought we were having a win, which is why we quickly jumped ahead to ask questions about rigid tapping etc before you and others in other parts of the world went to bed i.e. your night being our day...).

As it turns out though, closed loop didn't pan out and we spent the entire day chasing our tails. Regardless of tuning, we get a spindle which is either running at a steady speed or slowly climbing in RPM, but in either case never locking on to the commanded speed.

I have taken some photos with numerous HAL meter and HAL signals on the screen with the spindle running to help diagnose and will also attach HAL and INI files to provide as much collective diagnostic detail as possible in one place.

Firstly though, just a quick recap on the setup. The motor drives the spindle with a 2:1 pulley ratio (spindle RPM 2 x motor RPM). The encoder is on the motor. The proximity sensor is on the spindle. The encoder has A+,A-,B+ and B- going into a 7i47s. The proximity sensor is being used as the index pulse so we have it attached to an ENC 422, to output as Z+,Z- and this then goes into the same 7i47s. The 7i47s feeds back to the spindle VFD for speed control. The 7i47s connects to a 5i24. One of the questions we have is what parameter Linuxcnc uses as the target for RPM for closed loop? spindle-revs / spindle-vel-fb-rps / spindle-output / hm2_5i24.0.encoder.04.velocity etc??? And whichever one it is, which 7i47s datum does it use i.e. Z pulses, A pulses, all pulses etc??

Even though there is a gearing ratio going on, regardless of what we try we cannot close the loop and have linuxcnc lock the spindle onto a commanded RPM or a logical ratio of the commanded RPM (i.e something which would relate to gearing ratio or encoder count etc...) As mentioned, in fact subject to settings the spindle may experience an ongoing acceleration. Interestingly as well, the spindle-at-speed HAL signal is always "true" throughout.

If I had to guess I would hint at an addressing issue, i.e. there is a parameter we are not bringing into the HAL or have linked the incorrect parameter into the closed loop, expecting to maintain a commanded speed, but with an incorrect or incorrectly addressed parameter hence the attachment of the HAL file and the question as to which feedback parameter is referenced to target for speed control.

I've included a picture called Spindle Hal Disagree showing HAL meters indicating command RPM of 300 (5 RPS) but spindle feedback at 51 RPS, spindle output at 584 and spindle revs at 3178. As such, it apparently "sees" the feedback exceeding commanded speed, but does not act upon it. In this case, the spindle had a gradual acceleration beyond the commanded speed.

Either way, your help is much appreciated given we really seem to be chasing our tails on this one.
Regards,
Marty.

File Attachment:

File Name: Fadal_1.hal
File Size:19 KB

File Attachment:

File Name: Fadal_1.ini
File Size:4 KB
Attachments:
Last edit: 16 Oct 2017 11:01 by Nitram.

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

Time to create page: 0.563 seconds
Powered by Kunena Forum