Mesa 5i20 servo configuration

More
19 Jan 2010 01:19 #1555 by Zig
I may have said this prior posts but here goes again..


:cheer: YIPPIIII

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

More
22 Jan 2010 08:34 #1584 by Zig
Well...

An interesting week.

The linear motor has fired up.
Glass scale is indicating position.

Other than an accidental loss of control during which the motor slammed against the mechanical endstop ( and cut the highly flexible cable between glass scale reader head and control card.. everything is almost perfect... except...


The mechanical system exhibits very high gain. The servo amp is working in current mode and the linear motor tends to buzz hiss cog and in general carry on.
I went through a series of phasing ( hall and motor phases ) and have settled on the least bothersome combination ( one of two motor phase combinations with fixed hall phasing ).

Now comes the loop tunig problem. Initial guestimates have produced a loop which is noisy ( acoustically and positionally) The loop wanders about setpoint by approx +/- 0.1mm.

Any advice on how to tune the loop would be welcome.

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

More
22 Jan 2010 15:37 #1592 by PCW
If you have a linear motor, (and torque mode so no local velocity feedback) you may need to run the servo thread at higher than
the default 1 KHz. I would suggest 4 KHz as a start.

With torque mode control, damping (KD) depends entirely on EMCs velocity estimation. It might be worth hacking EMCs PID component so it can use HostMot2s velocity estimation instead of the (noisy) DelCounts/DelT that the PID component currently uses. You need the
development version to do this, as it has an important fix in HostMot2s velocity estimator.

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

More
24 Jan 2010 07:02 #1615 by Zig
PCW,

Thanks for the input.

tried taking the thread from 1 000 000 nano seconds down to 250 000nano seconds.

Started getting realtime error. 500 000 seems to be a better choice from the point of view of realt ime performance.


Had some success by playing with trajectory planner section of the .INI file. Setting the acceleration to 9000m per second per second has mad the motor a deal sight quiter.

Also setting the amplifier to minimum gain, the control voltages in the range of +/- 5 volts or there abouts asopposed to milivolts at maximum gain.

The amplifier has input terminals for a tacho connection. Will look into the possibility of sampling encoder signal to generate an analog voltage representative of movement velocity. ( ie analog voltage swinging about zero volts).

Presently need to establish why my encoder loses positional information. This was observed by marking a refference position on the machine and executing ( G00 ) forward movement and return movement. The table does not return to the same spot.

Oh the maximum speed of the high speed traverse movement is 18000mm/second

I am still experimenting with PID coefficients but getting there slowly.

Will keep You all appraised of the progress.

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

More
24 Jan 2010 15:17 #1619 by PCW
Are you using differential encoder inputs? small position errors may be noise related,
usually motor drive PWM coupling into the encoder inputs.
What is your maximum count rate? at 18000 mm/S sounds like it could be pretty high...
Theres an encoder quadrature error bit in the encoder control register that the driver doesn't look
at but you could read via the raw-read facility. That bit might help diagnose encoder count problems
(the register and bit are documented in the HostMot2 regmap file)

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

More
25 Jan 2010 05:32 #1628 by Zig
Yes, I agree.

EMI is probably the culprit.

My test procedure is home motor at some x position, mark line of job platten against fixed machineframe and then send out the platten on its merry way..

g00 x140
g00 x-140
g00x0


And i end up with about 10 mm difference between starting mark and finishing mark.
High speed traverse speed 18000 mm/min

Glass scale rated at 2m/s max speed, well capable of supporting 18 m/min.
Scale basic resolution 20 micron or 50 pulses per mm. At 18000 mm/min = 300mm/s the scales generates 300 x50 pulses a second or 15kiloherz. Well within ( I would hope ) the capability of mesa's gear.

So back to EMI.
I may have to place the servo amp inside a shielding box..

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

More
25 Jan 2010 10:28 #1629 by Zig
The motor is now running as expected.

Quiet , smooth, responsive to changes in PID coeeficients.

Major problem was I.. quickly followed by EMI.

The encoder cable has a braided shield which is connected to the reader head case.

I had not connected the shield at the PC end. Did not want to endup with classic earth loop problems. Instead ended up with a susceptible shielding.

Once the shield connection was made everything fell into place.

Pesently a g00x140 movement at transit speed of 18000mm/min ( approx a foot a second) and acceleration rate of 1500mm/s/s ends up about six or so encoder counts off the mark.

Over a period of a second or so audible clicks are emitted ( by the motor) and the error is reduced by an encoder count for each click.

I guess the next thing to do is spend a bit more effort on the tuning of the PID coefficients.

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

More
25 Jan 2010 15:28 #1631 by PCW
At that low of a count rate you can apply some fairly heavy filtering of the encoder inputs to reject input noise.
Unfortunately this feature is not yet settable by the driver but can be accessed via the raw-write facility
the default encoder input filter on the 5I20 (with filter=on) is 15 counts of the 33 MHz clock = 30 nSX15 = 450 ns
so noise pulses shorter than 450 nS will be rejected. The sample clock (33 MHz ) of the encoders can be changed
by writing the QfilterRate register:

0x3400 QfilterRate 12 bit Quadrature counter filter rate
count rate is ClockLow/(QFilterRate+2).
Any divisor with MSb set = divide by 1

Default QfilterRate is 0x800h = divide by one so 33 MHz on 5I20
So for example if you use raw-write and set QfilterRate to say 0x0008 (divide by 10)
the basic encoder filter will run at 3.3 MHz instead of 33 MHz This means that input noise
pulses less than 4.5 uS will be rejected (but you will have reduced the maximum count rate to to about 440 KHz)

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

More
25 Jan 2010 22:10 #1636 by Zig
PCW,

Thanks for the interesting bit of information.

Can You please point me in the direction of more info on the subject of reconfigurin/ rawwriting of registers?

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

More
26 Jan 2010 01:45 #1637 by PCW
The hostmot2 manual page, raw mode section (you need to enable raw-mode)
man hostmot2
Don't know if there's a HAL example of using raw-write but here's an approximation:

setp hm2_[HOSTMOT2](BOARD).0.write-address 13312 # (0x3400)
setp hm2_[HOSTMOT2](BOARD).0.write-data 8
setp hm2_[HOSTMOT2](BOARD).0.write-strobe TRUE

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

Moderators: PCWjmelson
Time to create page: 0.114 seconds
Powered by Kunena Forum