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

More
1 year 11 months ago #314623 by PCW
set W17 up, power cycle  the 7I97 and try again

W16/W17 is 192.168.1.121
so ping of 10.10.10.10 will fail because there's no device with that address
and ping of  192.168.1.121 will fail because there's no route because of the host setup

Please Log in to join the conversation.

More
1 year 11 months ago #314624 by bnet
Yup, worked. Thanks. I will now proceed with the rest.

Please Log in to join the conversation.

More
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.

Please Log in 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:
 

Attachment not found



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 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 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 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 to join the conversation.

More
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.

 

Attachment not found



Also, unsurprisingly no output from the serial port  with the current configuration.

Please Log in to join the conversation.

More
1 year 11 months ago #314772 by PCW
The timer number setup is via a parameter
probably something with "fanuc" and "timer" in it's name

Please Log in to join the conversation.

More
1 year 11 months ago #314790 by bnet
Ah yes I see it now. I have assigned it to a timer, now I'm seeing the 8us request pulse on the scope at 3 volts (is that correct?). No response from the encoder yet and I'm getting this error, I'll have to check the wiring:

 

Attachment not found



Here's where I made it to with the .hal thus far for those who may be on a similar path:
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 num_encoders=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 -200 setp hm2_[MESA](BOARD).0.fanuc.00.timer-number 1 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

 

Please Log in to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum