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

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 or Create an account 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:

 

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 or Create an account to join the conversation.

More
1 year 9 months ago #318988 by bnet
Back from holidays, finally got to dig a little deeper with the oscilloscope. I managed to figure out the polarity of the connections and alas, I am now receiving the response from the encoder!

Some values are showing up on my HAL Show and now I need to figure out if everything is working correctly and whether or not I need to create a custom setup string.

After a slight turn (a few degrees) of the motor shaft in the reverse direction my HAL show reads:

 

Suggestions for next steps are encouraged.

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

More
1 year 9 months ago #318990 by PCW
What is the counts per turn value for the encoder?

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

More
1 year 9 months ago - 1 year 9 months ago #318991 by bnet
I have not found any formal documentation on the encoders or any note in the machine’s schematics, so I don’t know.

You did say in a previous response that you thought my encoders are 1M units per revolution, in response to a post where I provided the model number.

Tomorrow I will do more testing - I will try to verify one complete rotation and see how the counts check out.
Last edit: 1 year 9 months ago by bnet.

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

More
1 year 9 months ago #319135 by bnet
I'm under the impression that the encoders are 1 million counts per rev. I did a crude test where I rotated the pully associated with the motor one full turn as marked by a sharpie line on the face of the pulley. Seemed to deliver around 2 million raw counts, and the pulley appears like it could be 1:2 ratio. 



I also observed 4 cycles of the commutation output from the HAL Fanuc Encoder pin for one rotation (if I remember correctly!). 

These computer-side details can be adjusted as I setup the system. Now I need to figure out what extra hardware I need to talk to 4 of these at once, and also how to output either commutation to the Allen-Bradley Ultra-3000 drives or incremental encoder signals. I'm fully out of inputs and outputs on my 7i76e used on the machine so I will need to get some expansion hardware. 

Expansion needs: 
-4x serial ports (maybe just 3 if I can also use the one in the 7i76e, but Mesa seems to sell them in breakout boards of 4 or 6). 
-8 or more outputs to communicate encoder or commutation information to the Ultra3000 (still figuring out what the drives will need) 

Wondering what the most cost effective Mesa solution would be to add onto my system. 

Or maybe someone knows if there is there setup that does not require sending encoder or commutation information to the Ultra3000s. Can't seem to find whether or not these drives can be run 'open-loop' or/ with feedback only being taken care of on the LCNC side (doubtful?). 
 

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

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