7i96 Spindle PWM
- BigJohnT
- Topic Author
- Offline
- Administrator
Less
More
- Posts: 7330
- Thank you received: 1177
19 Aug 2018 20:29 #116344
by BigJohnT
7i96 Spindle PWM was created by BigJohnT
I'm drawing a blank on how to set up a spindle on the 7i96, well not a complete blank I've flashed the card with 4 stepgens and 1 pwm.
Here are the pins I found:
And the parameters I found:
Is there a way to get encoder feedback from the spindle into the 7i96?
Thanks
JT
Here are the pins I found:
hm2_7i96.0.pwmgen.00.enable
hm2_7i96.0.pwmgen.00.value
And the parameters I found:
hm2_7i96.0.pwmgen.00.out0.invert_output
hm2_7i96.0.pwmgen.00.out0.is_opendrain
hm2_7i96.0.pwmgen.00.out1.invert_output
hm2_7i96.0.pwmgen.00.out1.is_opendrain
hm2_7i96.0.pwmgen.00.output-type
hm2_7i96.0.pwmgen.00.scale
hm2_7i96.0.pwmgen.pdm_frequency
hm2_7i96.0.pwmgen.pwm_frequency
Is there a way to get encoder feedback from the spindle into the 7i96?
Thanks
JT
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17905
- Thank you received: 4774
19 Aug 2018 21:12 - 19 Aug 2018 21:14 #116347
by PCW
Replied by PCW on topic 7i96 Spindle PWM
A relatively basic PWM spindle setup would be something like:
setp hm2_7i96.0.pwmgen.00.output-type 0 # 0=standard PWM/DIR mode)
setp hm2_7i96.0.pwmgen.00.scale (full_scale_rpm)
setp hm2_7i96.0.pwmgen.pwm_frequency (desired_PWM_frequency)
net spindle-on motion.spindle-on => hm2_7i96.0.pwmgen.00.enable
and
net spindle-speed-abs motion.spindle-speed-out-abs hm2_7i96.0.pwmgen.00.value
for unsigned output
or
net spindle-speed motion.spindle-speed-out hm2_7i96.0.pwmgen.00.value
for signed output (dir pin will follow sign)
The 7I96 has a single encoder input that can be used for spindle feedback if desired
if you mean for closed loop spindle speed control that's possible also
pncconf does a clever thing here in that closed and open loop spindle control are setup identically
(they always use a PID component) but the default spindle PID setup has only FF0=1 and all other pins
0 which means the PID provides no feedback and just passes the commanded velocity directly to the PID output (FF0=1 does this)
Simple using non 0 P or I terms changes the mode to closed loop
setp hm2_7i96.0.pwmgen.00.output-type 0 # 0=standard PWM/DIR mode)
setp hm2_7i96.0.pwmgen.00.scale (full_scale_rpm)
setp hm2_7i96.0.pwmgen.pwm_frequency (desired_PWM_frequency)
net spindle-on motion.spindle-on => hm2_7i96.0.pwmgen.00.enable
and
net spindle-speed-abs motion.spindle-speed-out-abs hm2_7i96.0.pwmgen.00.value
for unsigned output
or
net spindle-speed motion.spindle-speed-out hm2_7i96.0.pwmgen.00.value
for signed output (dir pin will follow sign)
The 7I96 has a single encoder input that can be used for spindle feedback if desired
if you mean for closed loop spindle speed control that's possible also
pncconf does a clever thing here in that closed and open loop spindle control are setup identically
(they always use a PID component) but the default spindle PID setup has only FF0=1 and all other pins
0 which means the PID provides no feedback and just passes the commanded velocity directly to the PID output (FF0=1 does this)
Simple using non 0 P or I terms changes the mode to closed loop
Last edit: 19 Aug 2018 21:14 by PCW.
Please Log in or Create an account to join the conversation.
- BigJohnT
- Topic Author
- Offline
- Administrator
Less
More
- Posts: 7330
- Thank you received: 1177
19 Aug 2018 21:30 #116350
by BigJohnT
Replied by BigJohnT on topic 7i96 Spindle PWM
Thanks for the help. I was so busy looking at the pins etc I missed the encoder input.
JT
JT
Please Log in or Create an account to join the conversation.
- BigJohnT
- Topic Author
- Offline
- Administrator
Less
More
- Posts: 7330
- Thank you received: 1177
19 Aug 2018 22:03 - 19 Aug 2018 22:16 #116352
by BigJohnT
How does the encoder get connected to the PID? I don't see any encoder pins. Never mind I forgot to select number of encoders...
Would you connect hm2_7i96.0.encoder.00.velocity to pid.3.feedback?
JT
Replied by BigJohnT on topic 7i96 Spindle PWM
Would you connect hm2_7i96.0.encoder.00.velocity to pid.3.feedback?
JT
Last edit: 19 Aug 2018 22:16 by BigJohnT.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17905
- Thank you received: 4774
19 Aug 2018 22:59 #116354
by PCW
Replied by PCW on topic 7i96 Spindle PWM
There's a scale issue, the encoder velocity is in RPS but the spindle commanded velocity is in RPM
I guess the options are to scale everything in RPS (using motions RPS speed pins)
or to scale the encoder feedback velocity to RPM using the scale component
The latter has the advantage of providing a actual RPM number for display
I guess the options are to scale everything in RPS (using motions RPS speed pins)
or to scale the encoder feedback velocity to RPM using the scale component
The latter has the advantage of providing a actual RPM number for display
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.453 seconds