Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
- PCW
- Online
- Moderator
Less
More
- Posts: 18041
- Thank you received: 4860
16 Nov 2024 20:45 - 16 Nov 2024 20:51 #314623
by PCW
Replied by PCW on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
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
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
Last edit: 16 Nov 2024 20:51 by PCW.
Please Log in or Create an account to join the conversation.
- Bennett
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 3
16 Nov 2024 20:49 #314624
by Bennett
Replied by Bennett on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
Yup, worked. Thanks. I will now proceed with the rest.
Please Log in or Create an account to join the conversation.
- Bennett
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 3
16 Nov 2024 21:39 - 16 Nov 2024 22:21 #314627
by Bennett
Replied by Bennett on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
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.
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: 16 Nov 2024 22:21 by Bennett.
Please Log in or Create an account to join the conversation.
- Bennett
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 3
16 Nov 2024 23:04 #314630
by Bennett
Replied by Bennett on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
Please Log in or Create an account to join the conversation.
- PCW
- Online
- Moderator
Less
More
- Posts: 18041
- Thank you received: 4860
17 Nov 2024 00:12 #314633
by PCW
Replied by PCW on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
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
(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.
- Bennett
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 3
17 Nov 2024 23:10 #314703
by Bennett
Replied by Bennett on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
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.
Thanks!
# 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.
- PCW
- Online
- Moderator
Less
More
- Posts: 18041
- Thank you received: 4860
17 Nov 2024 23:34 #314704
by PCW
Replied by PCW on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
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
(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.
- Bennett
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 3
18 Nov 2024 16:25 - 18 Nov 2024 16:43 #314768
by Bennett
Replied by Bennett on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
Attachments:
Last edit: 18 Nov 2024 16:43 by Bennett.
Please Log in or Create an account to join the conversation.
- PCW
- Online
- Moderator
Less
More
- Posts: 18041
- Thank you received: 4860
18 Nov 2024 16:46 #314772
by PCW
Replied by PCW on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
The timer number setup is via a parameter
probably something with "fanuc" and "timer" in it's name
probably something with "fanuc" and "timer" in it's name
Please Log in or Create an account to join the conversation.
- Bennett
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 3
18 Nov 2024 19:37 #314790
by Bennett
Replied by Bennett on topic Fanuc Serial Pulse Coders - Red cap servos, mesa 7i76e, how to?
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:
Here's where I made it to with the .hal thus far for those who may be on a similar path:
Here's where I made it to with the .hal thus far for those who may be on a similar path:
# 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
Attachments:
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.116 seconds