Questions on PID tunning using Mesa 8i20 drive

More
14 Dec 2017 12:32 #103107 by Henk
Hi Andy
I was also under the impression that this would be risky but gave it a shot anyway and it seems to be working OK. The linear scales are Heidenhein LSxxx with EXE converters so they should be quite reliable.

There is no Encoder on the motor, only a 3-phase tacho-generator and the hall-sensor vane. I ran the motor in "h" mode and couldn't really see a difference.

Ill let you know if I pick up problems.

Setsserial worked without problems, thanks

Henk

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

More
26 Nov 2018 14:51 #121371 by Henk
Hi
i used another 8i20 for a 4th axis build to use on my MAHO MH600C. This time im using a fanuc red-cap motor but replaced the serial pulsecoder with a normal ABZ incremental encoder and running BLDC in qi mode.

I am having issues initializing BLDC. Sometimes it will act as expected and rotate slowly until index is found and in that case all is well and works fine.
Most of the time though the init-done pin will go high at the same time that the init pin goes high and no initializing sequence takes place. In this case the motor commutation is incorrect and it does not function.

I am at a loss here and considering noise on the index from the i=encoder but in halscope all seems ok (at the highest sampling rate)

Attached my ini and hal files

Any input is appreciated

thanks
Attachments:

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

More
26 Nov 2018 15:11 #121372 by PCW
I'm not sure why you would replace the serial pulsecoder with a standard encoder since the serial pulsecoder already has a absolute commutation track and is supported by HostMot2

In any case if you have noise on the index, you could try:

1. Turning on the encoder filter bit for the affected channel
2. Possibly lower the encoder sample rate

If the encoder filter bit is on, all signals (A,B,I) must be present 15 sample periods to be recognized. If the filter bit is off, the encoder inputs must be present for only 3 sample periods to be recognized

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

More
26 Nov 2018 15:21 #121373 by Henk
Hi PCW.

I didnt have the original pulsecoder. I got the motor without one so i fitted a 1000ppr ABZ as second best.

The encoder filter bit is set to 1. Not sure how to alter the sampling rate thouh....

What is strange is that when i comment out the index-enable connection to bldc, and leave it in qi mode, the motor rotates endlessly in search of the index which is expected.

But with that line active, it is as if the index or a false index is found immediately.

???

Thanks for the quick reply

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

More
26 Nov 2018 15:25 - 26 Nov 2018 15:27 #121374 by PCW
Did you try inverting the index polarity?

You can also verify index hardware operation by "setsing" the signal that carries the index enable
and then had rotating the shaft to verify the the signal is only cleared at the index position
Last edit: 26 Nov 2018 15:27 by PCW.

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

More
26 Nov 2018 16:18 #121375 by Henk
Hi.
Index enable is low as soon as lcnc is launched. Setting this signal high in halshow and rotating the encoder works as it should. It goes low as soon as the index is detected.

If i initialize after setsing index enable true the motor homes as it should and runs with acceptable performance.

So. How do i make sure index enable is true before init pin goes high? Adding sets a-index-enable 1 to the hal file doesnt seem to work.

Henk

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

More
26 Nov 2018 16:37 #121378 by PCW
It looks like the thread order is wrong
Normally you should have:

hardware read
all processing
hardware write

but you have the BLDC component before any of this

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

More
26 Nov 2018 17:58 #121384 by Henk
Hi Again

ok, so i have changed the first part of the .hal file to have the following:


loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hostmot2
loadrt [HOSTMOT2](DRIVER) config=[HOSTMOT2](CONFIG)
setp hm2_[HOSTMOT2](BOARD).0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.y,pid.z,pid.s,pid.a
loadrt classicladder_rt numPhysInputs=50 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10 numBits=50 numWords=50
loadrt oneshot names=machine-on,machine-off
loadrt toggle names=mode,blockdel
loadrt mux16 names=foincr,raincr,spincr
loadrt gearbox
loadrt scale names=spindle-cl-in,spindle-cl-out,selected-jog-incr-cl-out
loadrt or2 names=x-pos,x-neg,y-pos,y-neg,z-pos,z-neg
loadrt message names=slideway-lub messages="Slideway Lubrication pressure not reached"
#loadrt sp_encoder_z


# for 4th axis#######


loadrt bldc cfg=qi

loadrt sum2
loadrt timedelay





####################################################


addf hm2_7i92.0.read servo-thread
addf bldc.0 servo-thread
addf sum2.0 servo-thread
addf timedelay.0 servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.y.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf pid.a.do-pid-calcs servo-thread
addf classicladder.0.refresh servo-thread

addf machine-on servo-thread
addf machine-off servo-thread
addf foincr servo-thread
addf raincr servo-thread
addf spincr servo-thread
addf mode servo-thread
addf blockdel servo-thread
addf gearbox servo-thread
addf spindle-cl-out servo-thread
addf spindle-cl-in servo-thread
addf selected-jog-incr-cl-out servo-thread
addf x-pos servo-thread
addf x-neg servo-thread
addf y-pos servo-thread
addf y-neg servo-thread
addf z-pos servo-thread
addf z-neg servo-thread
addf slideway-lub servo-thread
#addf sp-encoder-z servo-thread
addf hm2_7i92.0.write servo-thread





But, a-index-enable stays false after startup.

It works if i add the sets a-index-enable in the postgui hal file though

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

More
26 Nov 2018 19:00 #121389 by andypugh
pin in bit init if (personality & 0x05) == 4
"""A rising edge on this pin starts the motor alignment sequence. This pin
should be connected in such a way that the motors re-align any time that
encoder monitoring has been interrupted. Typically this will only be at machine
power-off.
The alignment process involves powering the motor phases in such a way as to
put the motor in a known position. The encoder counts are then stored in the
\\fBoffset\\fP parameter. The alignment process will tend to cause a following
error if it is triggered while the axis is enabled, so should be set before the
matching axis.N.enable pin. The complementary \\fBinit-done\\fP pin can be used
to handle the required sequencing.

net init4ax <= classicladder.0.out-14 => bldc.0.init

At what point in the sequence doe bldc.0.init get set?

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

More
27 Nov 2018 05:24 #121450 by Henk
The init pin is set after powering up the drive DC power. The 8i20 enable is also asserted at the same time, but a-enable (pid) is left low until init-done is high.

I managed to solve the problem last night. When lcnc starts up, a-index-latch is low, and in this case BLDC seems to detect the index immediately after init goes high without successfully homing the rotor.

When I sets a-index-enable true in halshow before initiating, the rotor homing works as it should and all is well.

Adding the sets a-index-enable true to the main hal file did not result in a high signal directly after launching lcnc, but adding this line to the postgui hal file did.

I have the following line in the hal file
"net a-index-enable bldc.0.index-enable"
Maybe this should have been :
"net a-index-enable <=> bldc.0.index-enable"
I did not try this though but it is working as it should now.

Thanks for steering me in the right direction. problem solved.

Much appreciated.

Henk

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

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