7i80-DB + 7I76 - PWM Spindle ?

More
7 years 3 months ago - 7 years 3 months ago #139965 by PCW
Replied by PCW on topic 7i80-DB + 7I76 - PWM Spindle ?
freeby.mesanet.com/7i80db_16_7i76x3D3p.bit

Bitfile for 7I80DB-16 with up to 3 7I76's
Each 7I76 has the last stepgen replaced with a pwmgen
Last edit: 7 years 3 months ago by PCW.

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

More
7 years 3 months ago #139966 by mjoconr
That's cool, does this need the hal line configured as per my message from before ?

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

More
7 years 3 months ago #139975 by PCW
Replied by PCW on topic 7i80-DB + 7I76 - PWM Spindle ?
Yes, you would need to enable at least one pwmgen in the driver command line

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

More
7 years 3 months ago #140042 by mjoconr
So how would I change the following config to configure and connect the PWM to this.
Note I had to comment out and bypass the spindle gain as config as it caused a load error
Code:
loadrt [KINS]KINEMATICS #autoconverted trivkins loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS loadrt hostmot2 loadrt hm2_eth board_ip="10.10.10.10" config=" num_encoders=1 num_pwmgens=1 num_stepgens=4 sserial_port_0=00xxxx" setp hm2_7i80.0.watchdog.timeout_ns 5000000 loadrt pid names=pid.x,pid.y,pid.z,pid.s addf hm2_7i80.0.read servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf pid.x.do-pid-calcs servo-thread addf pid.y.do-pid-calcs servo-thread addf pid.z.do-pid-calcs servo-thread addf pid.s.do-pid-calcs servo-thread addf hm2_7i80.0.write servo-thread setp pid.s.Pgain [SPINDLE_9]P setp pid.s.Igain [SPINDLE_9]I setp pid.s.Dgain [SPINDLE_9]D setp pid.s.bias [SPINDLE_9]BIAS setp pid.s.FF0 [SPINDLE_9]FF0 setp pid.s.FF1 [SPINDLE_9]FF1 setp pid.s.FF2 [SPINDLE_9]FF2 setp pid.s.deadband [SPINDLE_9]DEADBAND setp pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT setp pid.s.error-previous-target true setp pid.s.maxerror .0005 net spindle-index-enable <=> pid.s.index-enable net spindle-enable => pid.s.enable net spindle-vel-cmd-rpm-abs => pid.s.command net spindle-vel-fb-rpm-abs => pid.s.feedback net spindle-output <= pid.s.output # ---digital potentionmeter output signals/setup--- setp hm2_7i80.0.7i76.0.0.spinout-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT setp hm2_7i80.0.7i76.0.0.spinout-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT setp hm2_7i80.0.7i76.0.0.spinout-scalemax [SPINDLE_9]OUTPUT_SCALE #net spindle-vel-cmd-abs => hm2_7i80.0.7i76.0.0.spinout net spindle-vel-cmd-rpm-abs => hm2_7i80.0.7i76.0.0.spinout net machine-is-enabled => hm2_7i80.0.7i76.0.0.spinena net spindle-ccw => hm2_7i80.0.7i76.0.0.spindir # ---Encoder feedback signals/setup--- setp hm2_7i80.0.encoder.00.counter-mode 1 setp hm2_7i80.0.encoder.00.filter 1 setp hm2_7i80.0.encoder.00.index-invert 0 setp hm2_7i80.0.encoder.00.index-mask 0 setp hm2_7i80.0.encoder.00.index-mask-invert 0 setp hm2_7i80.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE net spindle-revs <= hm2_7i80.0.encoder.00.position net spindle-vel-fb-rps <= hm2_7i80.0.encoder.00.velocity net spindle-index-enable <=> hm2_7i80.0.encoder.00.index-enable # ---setup spindle control signals--- net spindle-vel-cmd-rps <= spindle.0.speed-out-rps net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs net spindle-vel-cmd-rpm <= spindle.0.speed-out net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs net spindle-enable <= spindle.0.on net spindle-cw <= spindle.0.forward net spindle-ccw <= spindle.0.reverse net spindle-brake <= spindle.0.brake net spindle-revs => spindle.0.revs net spindle-at-speed => spindle.0.at-speed net spindle-vel-fb-rps => spindle.0.speed-in net spindle-index-enable <=> spindle.0.index-enable # ---Setup spindle at speed signals--- sets spindle-at-speed true # Use ACTUAL spindle velocity from spindle encoder # spindle-velocity bounces around so we filter it with lowpass # spindle-velocity is signed so we use absolute component to remove sign # ACTUAL velocity is in RPS not RPM so we scale it. #setp scale.spindle.gain 60 #setp lowpass.spindle.gain 1.000000 #net spindle-vel-fb-rps => scale.spindle.in #net spindle-fb-rpm scale.spindle.out => abs.spindle.in #net spindle-fb-rpm-abs abs.spindle.out => lowpass.spindle.in #net spindle-fb-rpm-abs-filtered lowpass.spindle.out

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

More
7 years 3 months ago #140582 by andypugh
Probably change
Code:
net spindle-vel-cmd-rpm-abs => hm2_7i80.0.7i76.0.0.spinout
to
Code:
net spindle-vel-cmd-rpm-abs => hm2_7i80.0.7i76.0.0.pwmgen.00.value
linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html#pwmgen
You will also need to enable the pwmgen and set the scale using the appropriate pins.

Have you flashed the new firmware?

You can get a list of the actual pin names by typing this at the command line. (You might recognise some of it)
Code:
halrun loadrt hostmot2 loadrt hm2_eth board_ip="10.10.10.10" config=" num_encoders=1 num_pwmgens=1 num_stepgens=4 sserial_port_0=00xxxx" show pin show param show funct exit
Copy and paste the output to a text file for reference

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

More
7 years 3 months ago #140601 by mjoconr
Thanks Andy

Yes I've flashed the firmware and updated the hal with the correct loadrt.

I do recognise the commands, but did not know I could do this by hand. Very useful.

Thanks for the reference page for the pwmgen.

Will take a little testing to work out what the frequency should be.

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

Time to create page: 0.236 seconds
Powered by Kunena Forum