Category: Driver Boards
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.
# =======================================================
# 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