Spindle encoder setup probelms with mesa 7133

More
08 Jul 2012 20:07 #21699 by jbunch
I am working on the spindle encoder for my lathe. I am having problems with the "hm2_5i20.0.encoder.02.index-enable" the doc says it resets the hm2_5i20.0.encoder.02.count (and therefore also position) are reset to zero on the next Index. I am using an omron encoder and pullup resistors for the open collector outputs. my wires are connected to the _not input on the card. I have used setp to set "hm2_5i20.0.encoder.02.index-enable 1" I have checked my pulse from the encoder with an oscope and all is good.
Any ideas. I have been working on this for about a month off and on.

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

More
08 Jul 2012 20:43 #21700 by andypugh
jbunch wrote:

Any ideas. I have been working on this for about a month off and on.


What isn't happening?

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

More
08 Jul 2012 20:57 #21701 by jbunch
As far as I can tell I am unable to calculate RPM because the output that you derive RPM from depends on output "hm2_5i20.0.encoder.02.position" This output derives its data from "hm2_5i20.0.encoder.02.counts / 500" Which is supposed to be reset to 0 after every pulse from "hm2_5i20.0.encoder.02.index-enable" . I have another 7i33 board from another machine. I get the same result.

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

More
09 Jul 2012 04:26 #21707 by cmorley
Why not use hm2_5i20.0.encoder.02.velocity ?
It is in RPS so will need to be scaled to RPM

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

More
09 Jul 2012 04:45 - 09 Jul 2012 04:48 #21708 by jbunch
That is what I ended up using. Now I am trying to close the loop between the VFD and the encoder. That is a whole new can of worms.

My VFD will not take - input for reverse. but it will put a center point at +5 So greater then +5 forward Les then +5 rev. and I am still not sure if the loop is closed. When start the spindle the PWM goes straight to +10 volts. Any knolage you have on this would begreat.

Jim
Last edit: 09 Jul 2012 04:48 by jbunch.

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

More
09 Jul 2012 10:43 #21711 by andypugh
jbunch wrote:

My VFD will not take - input for reverse. but it will put a center point at +5 So greater then +5 forward Les then +5 rev. and I am still not sure if the loop is closed. When start the spindle the PWM goes straight to +10 volts. Any knolage you have on this would begreat.


Offset PWM is very rarely a good idea, so I wouldn't recommend doing that. (the main problem being that PWM-off is full speed reverse)

The actual PWM component does not output a negative PWM on the output pins (because no such thing exists). What happens is that the "dir" pin is set, and a normal PWM output happens.
Generally, with a VFD, you ignore the "dir" pin completely and connect the VFD "fwd" and "rev" contacts to GPIO using motion.spindle-fwd and motion.spindle-rev

This generally works, though there is scope for an issue where the system can get stuck on the "wrong" side of zero.

If your spindle is running straight to full speed then it may be that the relative signs of the spindle speed command and feedback are wrong.

What PID settings are you using? I would begin by getting the speed as close as possible using _just_ FF0 before adding a small amount of I for load compensation and non-linearity.

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

More
15 Jul 2012 01:21 - 15 Jul 2012 01:23 #21956 by jbunch
So I have played with closed loop spindle :) . On my machine Where I have an older gearbox. I get alot of hunt and gear slap :( . I think that if I had my motor directly connected to the spindle this would be great. Also my encoder is not directly connected to the spindle it is connected to what used to be the lead screw gears. This is where it was connectd for the Anilam and AhHa conversion. I am going to move it to the spindle and try closed loop again. I need the machine to run smooth so I can make the parts for the spindle encoder. So off to another configuration with just spindle speed control. It dosen't get any better then this....


Jim
Last edit: 15 Jul 2012 01:23 by jbunch.

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

More
15 Jul 2012 10:04 #21957 by andypugh
jbunch wrote:

So I have played with closed loop spindle :) . On my machine Where I have an older gearbox. I get alot of hunt and gear slap :(

You possibly have the PID rather too active.

A spindle speed control probably works best based around mainly FF0 supplemented by I. Pgain isn't really right for this application, as you don't want zero-output when up to speed.

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

More
15 Jul 2012 21:55 #21970 by jbunch
Andy,

I decided to play with closed loop a bit more. What I ended up with was stable performance with tese settings.

setp pid.2.Pgain 0.000
setp pid.2.Igain 0.0
setp pid.2.Dgain 0.000
setp pid.2.bias 0.0
setp pid.2.FF0 0.00000199
setp pid.2.FF1 0.0
setp pid.2.FF2 0.0
setp pid.2.deadband 0.1
setp pid.2.maxoutput 10.00

The motor runs up to speed based on this output and that is it. If I add and "I" even in realy small amounts I get overrun and hunting. So based on what I see FF0 is just scaling my RPM to output voltage.


Jim

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

More
15 Jul 2012 22:26 #21974 by andypugh
jbunch wrote:

setp pid.2.FF0 0.00000199
The motor runs up to speed based on this output and that is it. If I add and "I" even in realy small amounts I get overrun and hunting. So based on what I see FF0 is just scaling my RPM to output voltage.

I would expect Igain to be at most 1/1000th of FF0. And maybe 100x smaller than that.
I am assuming you have a very high-speed spindle?

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

Time to create page: 0.093 seconds
Powered by Kunena Forum