- Posts: 18115
- Thank you received: 5334
Pimping the mini-lathe
- PCW
- Offline
- Moderator
-
but the on board I/O like stepgen pins and isolated inputs have a fixed direction so can only
be used in their designed directions and may have other limitations like maximum speed.
For example the 7I96 stepgen outputs are driven by 5V buffer chips to get a full
5V signal that can drive 24 mA. This buffer only works as an output. Similarly
the isolated input pins can only function as inputs, and are speed limited by
the Optocouplers used for isolation to about 5KHz maximum input frequency.
Please Log in or Create an account to join the conversation.
- Clive S
- Offline
- Platinum Member
-
- Posts: 2204
- Thank you received: 486
RotarySMP wrote: Given that my lathe only uses a fraction of the 7i96's capacity (2 Stepgen, 1 ENC and 1 Pwmgen) at present, would it be possible to add a further encoder through mesaflash to read a jog wheel? I looked through the bit files, and see there is one that looks like it converts to six ENC (7i96_6enc_d.bit). What would I need to do to make a 1pwmgen+ 1 addition ENC bitfile?
Actually given that jogwheels are only 100 PPR, and the normal input pins are read at 1kHz, I can't hand jog at 10 RPS anyway, so there is probably no disadvantage of puttnig the jog wheel onto general I/O except that they need a few pins.
Bonus question, would it be possible to reconfigure both the two unused Stepgens to ENC? With two stepgens, 1 pwmgen, and 3 Enc (the existing one plus two more), I could add linear encoders to the two axis, and run the jog wheel off I/O. That would be awsome for a lathe.
Mark
This is what I have used on a mill using a 7i96 for jogging 3 axis
If you want the hal file as well just shout
Please Log in or Create an account to join the conversation.
- RotarySMP
- Offline
- Platinum Member
-
- Posts: 1635
- Thank you received: 595
Please Log in or Create an account to join the conversation.
- RotarySMP
- Offline
- Platinum Member
-
- Posts: 1635
- Thank you received: 595
Motion at last!
By the way, does anyone have an aswer to a question I posted a couple of days go?
Just playing around, what is the syntax to use natural constants like Pi or "e" in gcode?
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
-
- Posts: 12170
- Thank you received: 4153
tsapps.nist.gov/publication/get_pdf.cfm?pub_id=823374
indicates e exists as EXP but does not explain the usage
I think it will be EXP(n) or EXP[n]
as for pi, I think you would need to define it as a variable.
Please Log in or Create an account to join the conversation.
- RotarySMP
- Offline
- Platinum Member
-
- Posts: 1635
- Thank you received: 595
net spindle-enable <= spindle.0.on
net spindle-enable => hm2_7i96.0.ssr.00.out-00
net spindle-cw <= spindle.0.forward
net spindle-cw => hm2_7i96.0.ssr.00.out-01
net spindle-ccw <= spindle.0.reverse
net spindle-cww => hm2_7i96.0.ssr.00.out-02
When I push Gmoccapy spindle fwd button, both out-00 and out-01 go true. Spindle starts correctly.
When I push the rev rotation button, spindle enable out-00 goes high, but out-02 stay false. I can't see the error.
Second issue:
I am a bit lost with the spindle closed loop connection. I have the following generated by PNCConf
#*******************
# SPINDLE
#*******************
setp pid.s.Pgain [SPINDLE_0]P
setp pid.s.Igain [SPINDLE_0]I
setp pid.s.Dgain [SPINDLE_0]D
setp pid.s.bias [SPINDLE_0]BIAS
setp pid.s.FF0 [SPINDLE_0]FF0
setp pid.s.FF1 [SPINDLE_0]FF1
setp pid.s.FF2 [SPINDLE_0]FF2
setp pid.s.deadband [SPINDLE_0]DEADBAND
net ratio_select.out pid.s.maxoutput
setp pid.s.error-previous-target true
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-pid-out pid.s.output => scale.gear.in
net gear-ratio ratio_select.out-f => scale.gear.gain
setp ratio_select.in00 0.000405
setp ratio_select.in01 0.000175
net gear-select-a => ratio_select.sel0
net spindle-output <= scale.gear.out
# ---Encoder feedback signals/setup---
setp [HMOT](CARD0).encoder.00.counter-mode 0
setp [HMOT](CARD0).encoder.00.filter 1
setp [HMOT](CARD0).encoder.00.index-invert 0
setp [HMOT](CARD0).encoder.00.index-mask 0
setp [HMOT](CARD0).encoder.00.index-mask-invert 0
setp [HMOT](CARD0).encoder.00.scale [SPINDLE_0]ENCODER_SCALE
net spindle-revs <= [HMOT](CARD0).encoder.00.position
net spindle-vel-fb-rps <= [HMOT](CARD0).encoder.00.velocity
net spindle-index-enable <=> [HMOT](CARD0).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
I added
net spindle-vel-cmd-rpm-abs => hm2_7i96.0.pwmgen.00.value
but it does respond to a change in command S word.
Thanks for assistance.
Mark
Please Log in or Create an account to join the conversation.