Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?

More
1 year 7 months ago #324124 by bnet
That's what I'm starting to realize! Thanks for adding to my confidence on this route.

I have found some good encoders - I'm thinking of going with 10000 PPR for X and Z and 800 PPR for the turret and the live tooling motor as the latter won't need much in terms of resolution, while the Z and especially X will need as much as I can get/afford (maximum count rates of A-B Ultra3000 2.5 mHz).

 

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

More
1 year 3 weeks ago #336282 by bnet
I have removed and disassembled the Fanuc encoders, retaining the central shaft that mounts to the tapered encoder mount on the motor's shaft. I turned down a section of this shaft to 15mm which is the bore size of the clamping collar of the new encoders. The encoders are hollow all the way through so I can still tighten the screw that mounts the encoder shaft to the motor. 

 

Turns out that the new encoder mount flanges happen to line up with some holes on the old Fanuc encoder bearing housing, so I repurposed those to serve as the encoder mounts. All mounted on the machine now, everything fits under the original red caps, with one tight fit under the smaller turret motor.

 

Unfortunately I have been unsuccessful in configuring the drives (AB Ultra3000) to engage in self-sensing commutation. I have tried everything I can think of including: 

-swapping motor phases (every possible combination) to ensure motor direction phase relationship and encoder direction match
-adjusting self-sensing current
-swapping A / B encoder phases to see if they were backwards with relation to the motor while also trying the various motor phase connections in this A / B swapped configuration
-double checking and experimenting with Pulses Per Revolution and the corresponding Lines Per Revolution data at the drive. Encoder is listed as PPR while drive data input is LPR as it counts the rising and falling edges therefore PPR*4=LPR

Now I'm wondering if my motor configuration settings have something to do with it (within the Ultraware configurator, some numbers such as Inductance had to be guessed as I do not know how to measure that and havent found info on that yet), but it seems like an unlikely cause. 

No matter what I do I get E39 (self-sensing startup error) a short period of self-sensing testing upon enabling the drive. 

The motor in question is free to spin for the self-sensing routine. 

Which brings me to another problem: the X-axis is HEAVILY loaded as it is a slant bed without counter spring. Currently a brake is on, so if I were to figure out this self-sensing and make it work, or even generate commutation pulses from the incremental encoder data, any startup sensing would have to take place with the X-Axis brake released and have the motor engaged in holding torque so that the whole thing doesnt come crashing down. 

I think I should have bought encoders with commutation outputs image missing /media/kunena/emoticons/pinch.png I assumed that the self-sensing commutation would work as perscribed but for some reason I cant get it to work. 

Now I'm starting to wonder if I should run the the buffered encoder outs (that the Ultra3000 provides) into LinuxCNC via the extra Mesa cards I got and use BLDC to generate commutation pulses, send them out to the drives. The only issue is the startup sensing: how would BLDC command the Step/Dir drives to move in order to find the index pulse if the step/dir drives need the commutation signals to run in the first place? 

If anyone has any ideas, even half-baked, I'd love to hear them. 

The Conquest continues. 



 

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

More
1 year 2 weeks ago #336338 by andypugh

Now I'm starting to wonder if I should run the the buffered encoder outs (that the Ultra3000 provides) into LinuxCNC via the extra Mesa cards I got and use BLDC to generate commutation pulses, send them out to the drives. The only issue is the startup sensing: how would BLDC command the Step/Dir drives to move in order to find the index pulse if the step/dir drives need the commutation signals to run in the first place?


 You are right, the bldc comp can only help where the commutation is under linuxcnc software control.
(It might have helped with the original encoders, as it can convert Fanuc 4-wire into simulate Hall sensor outputs. But you didn't want to hear that)

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

More
1 year 2 weeks ago - 1 year 2 weeks ago #336357 by bnet
The problem with the setup with the Fanuc encoders in my case was that I couldn't find a way to return quadrature encoder pulses back to the Ultra3000 drives which it requires to run. They need both, encoder and commutation pulses. Had I been using a motor drive that was controlled by LinuxCNC on a lower lever [such as the Mesa ones?] it would have worked (I think?) with BLDC component and original encoders. That would have been a slick setup. Also by the time I bought the Ultra3000's and the new encoders I am probably close to the price of those Mesa drives. Next time. 

Now onto generating commutation signals for the drives now that they have the encoder connected to them. ChatGPT seems to think its possible to do with BLDC. I've already spotted one error which is that the ultra3000s don't have an option to set low torque mode via the digital inputs.. So that leaves me unsure of if the rest of it will work.


Code:
# ======================================================= #  Fanuc Redcap → Ultra3000 setup (X axis) #  Mesa 7i76e + 7i85 + 7i84 # ======================================================= # --- Load required components --- loadrt bldc cfg=qiH loadrt oneshot count=1 loadrt toggle count=1 addf bldc.0 servo-thread addf oneshot.0 servo-thread addf toggle.0 servo-thread # ======================================================= #  Encoder Input (7i85) # ======================================================= # Encoder channel 0 on 7i85 → 800 counts per rev net x-rawcounts     hm2_7i85.0.encoder.00.rawcounts => bldc.0.rawcounts net x-index-enable  hm2_7i85.0.encoder.00.index-enable => bldc.0.index-enable net x-index-pulse   hm2_7i85.0.encoder.00.index => oneshot.0.in setp oneshot.0.width 0.1 net x-index-detected oneshot.0.out => toggle.0.toggle net x-index-found    toggle.0.state # ======================================================= #  BLDC synthetic Hall generation # ======================================================= setp bldc.0.scale           800          # encoder counts per mechanical rev setp bldc.0.poles           4            # 8-pole motor = 4 pole pairs setp bldc.0.encoder-offset  0.0          # adjust once aligned setp bldc.0.output-pattern  25 # Output Hall states to Ultra3000 (7i84) net hall1 bldc.0.hall1-out => hm2_7i84.0.output-00 net hall2 bldc.0.hall2-out => hm2_7i84.0.output-01 net hall3 bldc.0.hall3-out => hm2_7i84.0.output-02 # ======================================================= #  Step/Dir setup (X Axis) # ======================================================= # Step/Dir on 7i76e output 0 setp hm2_7i76e.0.stepgen.00.dirsetup   5000 setp hm2_7i76e.0.stepgen.00.dirhold    5000 setp hm2_7i76e.0.stepgen.00.steplen    2500 setp hm2_7i76e.0.stepgen.00.stepspace  2500 setp hm2_7i76e.0.stepgen.00.position-scale 10000 setp hm2_7i76e.0.stepgen.00.maxvel     60 setp hm2_7i76e.0.stepgen.00.maxaccel   300 net x-pos-cmd axis.x.motor-pos-cmd => hm2_7i76e.0.stepgen.00.position-cmd net x-pos-fb  hm2_7i76e.0.stepgen.00.position-fb => axis.x.motor-pos-fb net x-enable  axis.x.amp-enable-out => hm2_7i76e.0.stepgen.00.enable # ======================================================= #  Torque Limit Select control (7i84 output-04) # ======================================================= # Before index found, TorqueLimitSelect = ON (low current) # After index found, TorqueLimitSelect = OFF (normal torque) # This drives a digital input on the Ultra3000. net torque-low hm2_7i84.0.output-04 net torque-low <= not-x-index-found # Use toggle to remember index found across servo cycles net not-x-index-found toggle.0.state # (If logic inverted, swap TRUE/FALSE below) setp toggle.0.state 0   # default = index not found # ======================================================= #  Auto jog-to-index at startup # ======================================================= # At boot: torque low active, start slow jog setp hm2_7i76e.0.stepgen.00.velocity-cmd 0.05 net torque-low hm2_7i76e.0.stepgen.00.enable # Once index found: stop motion, switch torque to normal net x-index-found => hm2_7i76e.0.stepgen.00.enable-not net x-index-found => hm2_7i76e.0.stepgen.00.velocity-cmd 0  
Last edit: 1 year 2 weeks ago by bnet.

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

More
1 year 2 weeks ago #336358 by bnet
Here's a version that uses the digitally settable preset velocity mode to seek for the index of the encoder:
Code:
# ===================================================== #  LinuxCNC HAL — Ultra3000 preset velocity index seek #  Board: 7i76e main + 7i84 (outputs) + 7i85 (encoder) #  Axis: X # ===================================================== loadrt threads name1=servo-thread period1=1000000 # --- Load components --- loadrt bldc count=1 loadrt encoder num_chan=1 loadrt mux2 count=1 loadrt and2 count=1 loadrt not count=1 loadrt timedelay count=1 loadrt oneshot count=1 addf encoder.update servo-thread addf bldc servo-thread addf timedelay servo-thread addf oneshot servo-thread # ===================================================== #  Encoder setup (7i85) # ===================================================== setp hm2_7i85.0.encoder.00.scale 800 setp hm2_7i85.0.encoder.00.counter-mode 0 setp hm2_7i85.0.encoder.00.filter 1 net x-enc-a     hm2_7i85.0.encoder.00.input-a net x-enc-b     hm2_7i85.0.encoder.00.input-b net x-enc-z     hm2_7i85.0.encoder.00.input-index # ===================================================== #  BLDC Hall synthesis (for Ultra3000 commutation) # ===================================================== # 8-pole motor = 4 pole pairs setp bldc.0.pole-pairs 4 setp bldc.0.encoder-scale 800 setp bldc.0.hall-offset 0      # will be updated after index alignment net x-enc-pos       hm2_7i85.0.encoder.00.position => bldc.0.enc-pos net hall-u          bldc.0.hall-u => hm2_7i84.0.output-00 net hall-v          bldc.0.hall-v => hm2_7i84.0.output-01 net hall-w          bldc.0.hall-w => hm2_7i84.0.output-02 # ===================================================== #  Preset Velocity Control Output (7i84) # ===================================================== # Choose an available output (here output-03) net preset-vel-enable => hm2_7i84.0.output-03 # ===================================================== #  Step/Dir control enable (7i76e stepgen 0) # ===================================================== net stepgen-enable => hm2_7i76e.0.stepgen.00.enable # ===================================================== #  State control logic for startup alignment # ===================================================== # --- Delay after power-up before preset allowed --- setp timedelay.0.on-delay 0.25 net startup-delay timedelay.0.out => preset-allow net always-true timedelay.0.in <= true # --- Oneshoot from encoder index detection --- setp oneshot.0.width 0.05 net x-enc-index hm2_7i85.0.encoder.00.index => oneshot.0.in net index-found oneshot.0.out # --- Preset velocity enable logic --- # When not yet found index and startup delay done -> enable preset rotation loadrt and2 count=1 net not-found-delay and2.0.in0 <= preset-allow net not-found-delay and2.0.in1 <= not-index-found net preset-active and2.0.out => hm2_7i84.0.output-03 # --- index found logic --- loadrt not count=1 net index-found oneshot.0.out => not.0.in net not-index-found not.0.out # --- On index detection, disable preset and enable stepgen --- net index-found stepgen-enable # (this ties directly; optionally route through another delay)

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

More
1 year 2 weeks ago #336525 by andypugh
The question is whether the drives can do preset velocity with no commutation.

ChatGPT (or any AI) is going to do very poorly with anything that hasn't been done before.

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

Moderators: PCW, jmelson
Time to create page: 0.430 seconds
Powered by Kunena Forum