BLDC with 8i20 and Fanuc Encoder

More
10 Aug 2018 14:43 #115863 by Dave3891
Hi,
I have a 8i20 drive connected to a Fanuc motor with a a64 serial encoder connected to a 7i44 board.
I have communication with the absolute encoder working, but I my question is with what signals to use with BLDC

The HAL Fanuc encoder module has a .comm pin that outputs a 0-1 float signal 4 times per motor rotation. This is the phase position and should be used to drive the motor.

But I am not sure how to get the 0-1 signal in to the BLDC module and what config mode to use.


Any help would be appreciated.
More
16 Aug 2018 10:54 #116119 by andypugh
You probably don't even need bldc.

Try netting the 0-1 float pin directly to 8i20.0.angle

You should then find that the 8i20 runs the motor one way for positive current and the other way for negative.
If it doesn't then you can try swapping the motor wires around, one combination ought to work.

Only then is it worth putting the bldc comp in the chain, and all it is likely to do is insert an angular offset.

Snippets of my HAL where one motor has an aligned and correct pole-count resolver, and one motor doesn't. So one uses blddc and one doesn't
net x-counts		hm2_5i24.0.resolver.00.rawcounts => bldc.0.rawcounts
setp bldc.0.scale -16777216
setp bldc.0.poles 8
setp bldc.0.encoder-offset 1700000
net x-angle 		bldc.0.rotor-angle hm2_8i20.008d.angle
net x-output 		hm2_8i20.008d.current
...
net z-angle 		hm2_5i24.0.resolver.01.angle hm2_8i20.0003.angle
net z-output 		hm2_8i20.0003.current

I think that your situation will look a lot more like my Z than my X

Note that I am using the hostmot2 "use_serial_numbers" option that identifies smart-serial devices by part of their serial number rather than by the socket they are plugged in to, so my pin names might look different to yours
More
16 Aug 2018 14:32 #116163 by Dave3891
I tried netting the comm pin to the angle before, but I didn't think about changing the motor wires.
But this still doesn't seem to work. Every wiring combo just make the motor have a slight hiss when running.

Here is the HAL file that I am trying to test the motor with
loadrt threads name1=thread1 period1=1000000
loadrt hostmot2
loadrt hm2_eth board_ip="192.168.1.121" config="fanuc_chan_0=AA64 sserial_port_1=00000000"

addf hm2_7i80.0.read          thread1
addf hm2_7i80.0.write         thread1

net hm2_7i80.0.fanuc.00.encoder.comm => hm2_7i80.0.8i20.1.0.angle
setp hm2_7i80.0.8i20.1.0.current 5.0

start

I have also tried playing around with the BLDC encoder offset / poles settings for a few days now and the best I have had is the motor vibrating.
I am really at a loss here on what to do to make this work, and I still have 5 more motors to connect to this system...
More
16 Aug 2018 14:42 #116166 by PCW
Does the motor angle change from 0 to 1 every 1/2 turn? (for 4 pole) or every 1/4 turn (for 8 pole)?

Is the 8I20 enable asserted?

I assume this is a typo since

net hm2_7i80.0.fanuc.00.encoder.comm => hm2_7i80.0.8i20.1.0.angle

is not a valid net statement

net mototcom0 hm2_7i80.0.fanuc.00.encoder.comm =>hm2_7i80.0.8i20.1.0.angle

or similar would be valid
More
16 Aug 2018 14:48 #116168 by andypugh
The 8i20 thinks that zero is the rotor position when the A / U phase is connected to +V and the B/C/V/W phases are connected to -V.

So initially I would suggest setting that up with a generic PSU or even a battery to get a reference. (this probably coincides with the keyway pointing to the face of the motor where the connectors are.

Then check that this (and all the other possible "zero" positions around the 4 poles) coincide with the encoder .comm output being zero.

You can then try using "setp" to alter the 8i20 phase angle to try to work out if the 8i20 and the encoder agree about direction.

When a motor like this won't spin it is generally a "disagreement" about direction such that the phase angle and rotor run towards each other rather than away.
More
16 Aug 2018 14:51 #116169 by andypugh

PCW wrote: I assume this is a typo since

net hm2_7i80.0.fanuc.00.encoder.comm => hm2_7i80.0.8i20.1.0.angle

is not a valid net statement


Actually, it _is_ a valid statement, but one that won't work (it creates a signal called net hm2_7i80.0.fanuc.00.encoder.comm)

Good spot, that might be the problem.
More
16 Aug 2018 15:04 - 16 Aug 2018 15:05 #116171 by PCW
Its not valid if hm2_7i80.0.fanuc.00.encoder.comm is a pin name which I think was the intent

Actually I think it might be good to allow this type of connection in hal to reduce namespace clutter:

net pinX => pinY makes sense for anonymous signals (used in interconnecting components)
Last edit: 16 Aug 2018 15:05 by PCW.
More
16 Aug 2018 15:08 #116173 by Dave3891
The motor changes 4 times per rotation, so 8 pole. Enable is asserted on the physical pins

Good catch on the typo, changed it and now the motor runs!
All this frustration and it was something so simple haha


Thank you for the help, it is much appreciated

PCW wrote: Does the motor angle change from 0 to 1 every 1/2 turn? (for 4 pole) or every 1/4 turn (for 8 pole)?

Is the 8I20 enable asserted?

I assume this is a typo since

net hm2_7i80.0.fanuc.00.encoder.comm => hm2_7i80.0.8i20.1.0.angle

is not a valid net statement

net mototcom0 hm2_7i80.0.fanuc.00.encoder.comm =>hm2_7i80.0.8i20.1.0.angle

or similar would be valid

Time to create page: 0.100 seconds
Powered by Kunena Forum