Need help to orient spindle with analog VFD

More
10 Sep 2016 10:47 #80291 by backtime
My spindle is controlled by an analog (0-10V) VFD driver connected to Mesa 7i76 SPINDLEOUT, I'm using classic configuration with one pid and encoder feedback, spindle is controlled in velocity and works correctly. For an interval between 40 and 6000 RPM mesa spindle output is scaled has shown:

setp hm2_5i25.0.7i76.0.3.spinout-minlim    40
setp hm2_5i25.0.7i76.0.3.spinout-maxlim    6000
setp hm2_5i25.0.7i76.0.3.spinout-scalemax  6000

Now, for tool change, I need to orient spindle in a specific position, I was trying orient component, so I added a new pid and started to configure the orient component as shown in the documentation.
But reading orient.comp source I realized that command output is a position in spindle rounds, obviously I can't use orient pid output directly to drive hm2_5i25.0.7i76.0.3.spinout because the scale, and I don't understand how I can change configuration to make things work.

Any help would be appreciated.

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

More
10 Sep 2016 14:30 - 10 Sep 2016 14:30 #80297 by PCW
With a separate PID for position mode, the scaling would be taken care of by the (very) different tuning parameters
of the two PID components

The (normal velocity mode and orient position mode) PIDs will both have to be disabled when inactive (using orient-enable and its complement) and the appropriate PID output selected via a mux component

The orient PID probably also wants a max_output of some safe speed.
Last edit: 10 Sep 2016 14:30 by PCW.

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

More
10 Sep 2016 16:29 - 10 Sep 2016 16:31 #80299 by backtime
Replied by backtime on topic Need help to orient spindle with analog VFD
I already configured the two PIDs (velocity and orient) enable inputs using motion.spindle-orient and is complement and configured a mux to select the right PID outputs for SPINDLEOUT,

For what I know the velocity PID command input receive a value in RPM (in my case absolute value) and try to maintain stable this value using encoder velocity as feedback, actually the command is a value in RPM from 0 to 6000, then the output will be value in RPM from 0 to 6000 and the SPINDLEOUT scale allow to generate a voltage from 0 to 10V (because I have 0V on SPINDLE- and 10V on SPINDLE+), is this correct?

Now, orient PID command input can be any float number, positive and negative, calculated adding the desired position in fraction of turn to actual spindle position in revolutions (the encoder position output). The value sent to orient PID command pin maybe for example 300000 or -240000 (in spindle revolutions), but then what value should I expect from orient PID output? I thought it was close to command value, but you say that I can scale this value using PID tuning parameters. This is completely new for me, can you better explain the concept?

Thank you for your support.
Last edit: 10 Sep 2016 16:31 by backtime.

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

More
10 Sep 2016 16:52 - 10 Sep 2016 16:52 #80301 by PCW
I think most orient schemes use index so the count is always bounded to +- 1 turn
Last edit: 10 Sep 2016 16:52 by PCW.

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

More
10 Sep 2016 17:50 #80303 by backtime
Replied by backtime on topic Need help to orient spindle with analog VFD

I think most orient schemes use index so the count is always bounded to +- 1 turn


Looking at source code of orient.comp I don't see any pin to connect to encoder index-enable, without this the counter is not reset at all, but even if the counter was reset the output of the PID values would not be adequate to drive the mesa spinout because I would have values in the range +-1 that is equals to ask the spindle to run at +-1RPM.

May be I'm losing something trivial, I hope that someone with a similar configuration can give me some hints.

Thanks for your help.

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

More
10 Sep 2016 18:12 - 10 Sep 2016 18:14 #80305 by PCW
The few hal configs I have seen that do spindle orientation have specific spindle index enable wiring
LinuxCNCs motion component deals with spindle index enable but I dont know if it has any smarts regarding spindle orient

As far as scaling goes, Imagine a spindle position PID loop with a P term of 6000
This would request a velocity of +-6000 RPM with a +-1 turn error (probably way too much gain)
so PID output scaling is simply done by scaling the PID parameters
Last edit: 10 Sep 2016 18:14 by PCW.

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

More
10 Sep 2016 20:30 #80314 by backtime
Replied by backtime on topic Need help to orient spindle with analog VFD

The few hal configs I have seen that do spindle orientation have specific spindle index enable wiring
LinuxCNCs motion component deals with spindle index enable but I dont know if it has any smarts regarding spindle orient


I can't find more example of orient comp use, but is clear that command output is within +-1 the actual position so the error magnitude is well known.

As far as scaling goes, Imagine a spindle position PID loop with a P term of 6000
This would request a velocity of +-6000 RPM with a +-1 turn error (probably way too much gain)
so PID output scaling is simply done by scaling the PID parameters


Ok, now I understand the point, this is true for a known magnitude error and because P is the linear term, I can do some experiment with the other PID term setting provided that the max_output is set at safe speed. I'll try this configuration with a more safe P value.

Many thanks for clarifications.

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

More
13 Sep 2016 09:57 #80383 by andypugh
Replied by andypugh on topic Need help to orient spindle with analog VFD
The orient comp does not need the spindle index to be triggered.

I think the trick in your case is to alter the velocity PID to use the motion.spindle-speed-out-rps outputs, and work in revs-per-second throughout. Then the spindle encoder is scaled at one unit per revolution, and everything works out.

I made a schematic for spindle orient logic, I don't know if you have seen it:
wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient

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

More
13 Sep 2016 14:16 #80398 by backtime
Replied by backtime on topic Need help to orient spindle with analog VFD

The orient comp does not need the spindle index to be triggered.


Yes, this is clear reading source code, the trigger is on the positive edge of the enable signal.

I think the trick in your case is to alter the velocity PID to use the motion.spindle-speed-out-rps outputs, and work in revs-per-second throughout. Then the spindle encoder is scaled at one unit per revolution, and everything works out.


I can work in RPS, in this case the orient output (that will always be +-1) will result in +-60RMP, Is that your proposed solution?
It may work but I don't understand what do you mean with "reduce the encoder scale to one unit per rev". I have a 500ppr encoder, and encode scale is set to 500, so i have the right velocity and position of spindle.

I made a schematic for spindle orient logic, I don't know if you have seen it:
wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient


This is actually very close to my configuration, the problem was to have the two PID output too different to correctly driver the mesa spinout pin. Using RPS may be I can resolve the problem, I'll give it a try.

Thanks to all

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

More
13 Sep 2016 14:19 #80399 by andypugh
Replied by andypugh on topic Need help to orient spindle with analog VFD

This is actually very close to my configuration, the problem was to have the two PID output too different to correctly driver the mesa spinout pin.


I don't understand what you mean. The whole point of having two independent PID components is that you can tune them both to be correct for their tasks.

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

Time to create page: 0.102 seconds
Powered by Kunena Forum