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

More
1 year 11 months ago - 1 year 11 months ago #314627 by bnet
Firmware flash successful.

All wired up to the RS-422 connector. I will see if I can figure out how to put an instance of Fanuc Encoder on the .hal.

Any tips welcomed.
Last edit: 1 year 11 months ago by bnet.

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

More
1 year 11 months ago #314630 by bnet
I have created a basic .hal and declared the Fanuc channel, see attached .hal.

I am getting an error on startup of linux cnc:
 

When I watch the corresponding hal pins and turn the encoder I am not seeing any activity.

Any tips on what to check or adjust next will be greatly appreciated.

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

More
1 year 11 months ago #314633 by PCW
In addition to the two polarities that need to be right
(TX to REQ and RX to data) The DPLL needs to be setup to
start the transfer _before_ LinuxCNC reads the data

I'll try and dig up a sample FANUC hal file Monday
 

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

More
1 year 11 months ago #314703 by bnet
Thanks, I have experimented with the polarity of the data and request lines with no changes. Here's where I left off in the .hal based on what I could find here on the forum. I think I have added the initialization of DPLL but not sure about setting the timer.
Code:
# Fanuc Encoder Test .hal # kinematics loadrt [KINS](KINEMATICS) # motion controller loadrt [EMCMOT](EMCMOT) servo_period_nsec=[EMCMOT](SERVO_PERIOD) num_joints=[KINS](JOINTS) # hostmot2 driver loadrt hostmot2 loadrt [HM2](DRIVER) board_ip=[HM2](ADDRESS) config="num_dplls=-1 fanuc_chan_0=AA64 sserial_port_0=00000000" setp hm2_[MESA](BOARD).0.watchdog.timeout_ns 5000000 setp hm2_7i97.0.dpll.01.timer-us -100 loadrt pid names=pid.x # THREADS addf hm2_[MESA](BOARD).0.read servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf pid.x.do-pid-calcs servo-thread addf hm2_[MESA](BOARD).0.write servo-thread # amp enable net motion-enable <= motion.motion-enabled # Global PWM setup setp hm2_[MESA](BOARD).0.pwmgen.pwm_frequency 48000 # Board: 7i97 # Axis: X Joint: 0 Output: 0 # PID Setup setp pid.x.Pgain [JOINT_0](P) setp pid.x.Igain [JOINT_0](I) setp pid.x.Dgain [JOINT_0](D) setp pid.x.bias [JOINT_0](BIAS) setp pid.x.FF0 [JOINT_0](FF0) setp pid.x.FF1 [JOINT_0](FF1) setp pid.x.FF2 [JOINT_0](FF2) setp pid.x.deadband [JOINT_0](DEADBAND) setp pid.x.maxoutput [JOINT_0](MAX_OUTPUT) setp pid.x.error-previous-target True # joint-0 enable chain net joint-0-index-enable <=> pid.x.index-enable net joint-0-index-enable <=> joint.0.index-enable net joint-0-index-enable <=> hm2_[MESA](BOARD).0.encoder.00.index-enable net joint-0-enable <= joint.0.amp-enable-out net joint-0-enable => pid.x.enable net joint-0-enable => hm2_[MESA](BOARD).0.pwmgen.00.enable # PWM Generator setup setp hm2_[MESA](BOARD).0.pwmgen.00.output-type 1 #PWM pin0 setp hm2_[MESA](BOARD).0.pwmgen.00.offset-mode 1 # offset mode so 50% = 0 setp hm2_[MESA](BOARD).0.pwmgen.00.scale [JOINT_0]SCALE # ---Encoder feedback signals/setup--- setp hm2_[MESA](BOARD).0.encoder.00.counter-mode 0 setp hm2_[MESA](BOARD).0.encoder.00.filter 1 setp hm2_[MESA](BOARD).0.encoder.00.index-invert 0 setp hm2_[MESA](BOARD).0.encoder.00.index-mask 0 setp hm2_[MESA](BOARD).0.encoder.00.index-mask-invert 0 setp hm2_[MESA](BOARD).0.encoder.00.scale  [JOINT_0]ENCODER_SCALE # position command and feedback net joint-0-pos-cmd <= joint.0.motor-pos-cmd net joint-0-pos-cmd => pid.x.command net joint-0-pos-fb <= hm2_[MESA](BOARD).0.encoder.00.position net joint-0-pos-fb => joint.0.motor-pos-fb net joint-0-pos-fb => pid.x.feedback # PID Output net joint.0.output <= pid.x.output net joint.0.output => hm2_[MESA](BOARD).0.pwmgen.00.value # Encoder Setup setp hm2_[MESA](BOARD).0.encoder.00.scale  [JOINT_0](ENCODER_SCALE) setp hm2_[MESA](BOARD).0.encoder.00.counter-mode 0 setp hm2_[MESA](BOARD).0.encoder.00.filter 1 setp hm2_[MESA](BOARD).0.encoder.00.index-invert 0 setp hm2_[MESA](BOARD).0.encoder.00.index-mask 0 setp hm2_[MESA](BOARD).0.encoder.00.index-mask-invert 0 # Standard I/O Block - EStop, Etc # create a signal for the estop loopback net estop-loopback iocontrol.0.emc-enable-in <= iocontrol.0.user-enable-out

Thanks!

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

More
1 year 11 months ago #314704 by PCW
You need to also set the FANUC interface timer to  timer you  have setup
(like timer 1) I don't know the name of the pin off hand but listing
all the fanuc pins should find it. Do you have a oscilloscope available?

With the AA64 setup you should get a 8 usec request pulse (+ to REQ+ and - to REQ-)
at the servo thread rate, The encoder should respond with 77 bits of data on the +/-
DATA lines

Note that the default AA64 setup is for a 64K count/turn encoder so wont be right
but should show some data. The correct setup for your 1m count/turn encoder
would need the appropriate setup string

 

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

More
1 year 11 months ago - 1 year 11 months ago #314768 by bnet
Yes I have a digital oscilloscope, set it up at the machine today so that should be helpful. Looking at the pins, here's what's available.

 

Also, unsurprisingly no output from the serial port  with the current configuration.
Last edit: 1 year 11 months ago by bnet.

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

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