Lagunmatic 3516-SX Retrofit

More
8 years 2 months ago #115818 by giz
Replied by giz on topic Lagunmatic 3516-SX Retrofit
Awesome - thanks for the confirmation andy. I did use that line of code at some point last night but I didn't see movement at the spindle, hence the question about the PID.

I'm fairly certain I checked the status of spindle-enable in both situations but I'll double-check.

If nothing else, this particular struggle has really helped me understand the structure and syntax of LinuxCNC. Definitely feeling more comfortable about what is actually happening

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

More
8 years 2 months ago #115840 by giz
Replied by giz on topic Lagunmatic 3516-SX Retrofit
Best update of the night is that I remeasured the height of the machine and, as long as I take off the Z-axis servo, it turns out I will be able to fit this machine into the new house. The garage has 8ft doors the tallest permanent hard spot is about 88". YES!!

Ok - so Andy was right about the spindle enable preventing movement. However, I cannot for the life of me figure out how to incorporate it into the logic. Because I have the velocity-mode signal connected to motion.spindle-on I don't seem to be able to drive hm2_5i25.0.7i77.0.1.spinena with motion.spindle-on (through the spindle-enable signal that is standard).

I've racked my brain over and over but I can't come up with a solution - advice?

To keep progressing, I started my config using the .hal below and used halcmd to sets spindle-enable true. This gave me signal on analogout5 in both modes (success) but only resulted in movement when I was in velocity mode.

So once I can get the spindle enabled in both modes, then I need to:

1) determine why there is no motion in orient mode
2) scale the spindle speed correctly

The two might be related? I found a diagram that shows a similar logic setup for position vs. velocity mode that incorporates some scaling but I haven't fully digested it yet. It seems to be setup differently than how I have it now (where 1 spindle revolution = +1 encoder position).

spindle hal section below. It's been cleaned up, I left my attempt at using an or2 component to flip the spindle-enable but, again, I run into the issue of the pins already being in use.
Code:
#******************* # SPINDLE S #******************* setp pid.s.Pgain [SPINDLE]P setp pid.s.Igain [SPINDLE]I setp pid.s.Dgain [SPINDLE]D setp pid.s.bias [SPINDLE]BIAS setp pid.s.FF0 [SPINDLE]FF0 setp pid.s.FF1 [SPINDLE]FF1 setp pid.s.FF2 [SPINDLE]FF2 setp pid.s.deadband [SPINDLE]DEADBAND setp pid.s.maxoutput [SPINDLE]MAX_OUTPUT setp pid.s.error-previous-target true setp pid.1.Pgain [SPINDLE]PGAIN_P setp pid.1.Igain [SPINDLE]IGAIN_P setp pid.1.Dgain [SPINDLE]DGAIN_P setp pid.1.FF0 [SPINDLE]FF0_P setp pid.1.FF1 [SPINDLE]FF1_P # ---PWM Generator signals/setup--- setp hm2_5i25.0.7i77.0.1.analogout5-scalemax [SPINDLE]OUTPUT_SCALE setp hm2_5i25.0.7i77.0.1.analogout5-minlim [SPINDLE]OUTPUT_MIN_LIMIT setp hm2_5i25.0.7i77.0.1.analogout5-maxlim [SPINDLE]OUTPUT_MAX_LIMIT net spindle-index-enable <=> pid.s.index-enable net spindle-enable => hm2_5i25.0.7i77.0.1.spinena ##### net spindle-pos pid.1.feedback orient.0.position net spindle-vel pid.s.feedback hm2_5i25.0.encoder.05.velocity net spindle-vel-cmd motion.spindle-speed-out pid.s.command #net spindle-vel-cmd motion.spindle-speed-out-rps pid.s.command net spindle-vel-pid pid.s.output mux2.0.in0 net spindle-pos pid.1.feedback orient.0.position near.0.in1 hm2_5i25.0.encoder.05.position net spindle-pos-cmd orient.0.command pid.1.command near.0.in2 net spindle-angle motion.spindle-orient-angle orient.0.angle net spindle-pos-pid pid.1.output mux2.0.in1 setp near.0.difference 0.0005 net spindle-in-pos-raw near.0.out edge.0.in #not needed v2.8+, use orient.0.is-oriented net spindle-in-pos edge.0.out motion.spindle-is-oriented # this switches modes net orient-mode motion.spindle-orient orient.0.enable pid.1.enable mux2.0.sel net velocity-mode motion.spindle-on pid.s.enable #hm2_5i25.0.7i77.0.1.spinena net orient-dir motion.spindle-orient-mode orient.0.mode ##### # ---Encoder feedback signals/setup--- setp hm2_5i25.0.encoder.05.counter-mode 0 setp hm2_5i25.0.encoder.05.filter 1 setp hm2_5i25.0.encoder.05.index-invert 0 setp hm2_5i25.0.encoder.05.index-mask 0 setp hm2_5i25.0.encoder.05.index-mask-invert 0 setp hm2_5i25.0.encoder.05.scale [SPINDLE]ENCODER_SCALE net spindle-cmd mux2.0.out hm2_5i25.0.7i77.0.1.analogout5 net spindle-index-enable <=> hm2_5i25.0.encoder.05.index-enable #loadrt or2 #addf or2.0 servo-thread #net velocity-enable or2.0.in0 pid.s.enable #net position-enable or2.0.in1 pid.1.enable #net spindle-enable or2.0.out # ---setup spindle control signals--- #net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs #net spindle-vel-cmd-rpm <= motion.spindle-speed-out net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs #net spindle-enable <= motion.spindle-on net spindle-cw <= motion.spindle-forward net spindle-ccw <= motion.spindle-reverse net spindle-brake <= motion.spindle-brake net spindle-pos => motion.spindle-revs net spindle-at-speed => motion.spindle-at-speed net spindle-vel => motion.spindle-speed-in net spindle-index-enable <=> motion.spindle-index-enable # ---Setup spindle at speed signals--- sets spindle-at-speed true

Current spindle PID section for reference. Just playing with numbers right now to see if they affected the motion:
Code:
#******************** # Spindle #******************** [SPINDLE] P = 5 I = 0 D = 0.0 FF0 = 1 FF1 = 0.0 FF2 = 0.0 PGAIN_P = 60 IGAIN_P = 0 DGAIN_P = 0 FF0_P = 1 FF1_P = 0 BIAS = 0.0 DEADBAND = 0.0 MAX_OUTPUT = 10000.0 ENCODER_SCALE = -4096.0 OUTPUT_SCALE = 10000 OUTPUT_MIN_LIMIT = -10000 OUTPUT_MAX_LIMIT = 10000

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

More
8 years 2 months ago #115841 by giz
Replied by giz on topic Lagunmatic 3516-SX Retrofit
The lack of movement may also be related to some setting in my VFD. I have noticed that the minimum spindle speed to initiate movement is lower than I expected. As far as the VFD is concerned, it thinks it is running in open loop between a min and max frequency

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

More
8 years 2 months ago #115855 by giz
Replied by giz on topic Lagunmatic 3516-SX Retrofit
Here is the schematic I found last night that may be helpful. It seems to address the spindle enable and scaling. I haven't fully digested it yet.

This browser does not support PDFs. Please download the PDF to view it: Download PDF

Attachments:
The following user(s) said Thank You: Becksvill

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

  • raglanlittlejohn
  • Offline
  • Senior Member
  • Senior Member
More
8 years 2 months ago #115878 by raglanlittlejohn
Replied by raglanlittlejohn on topic Lagunmatic 3516-SX Retrofit
giz,
I did the schematic earlier this year. I was struggling to understand how the orient component worked, and found it easier to follow a schematic. I did get this working using a new Huangyang vfd which had sensorless vector control. The idea was to orient a lathe spindle. It worked well, getting the position within about 1 degree.
There is no pid for the normal speed, that is controlled by a variable voltage output to the vfd. I planned to use a disc with say 12 holes on the spindle, and a pin that would be engaged in the appropriate hole, when the spindle orientated signal came in. I think that would work, but I have not finished that part of the project yet.

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

More
8 years 2 months ago #115890 by giz
Replied by giz on topic Lagunmatic 3516-SX Retrofit
Awesome, thanks John. Funny you mention it - my plan today is to switch the VFD over to closed-loop vector control. It's running v/f right now and I think that might be why I don't see any movement during the M19 cycle (or at least, it isn't helping).

Im looking into how I can possibly use your scaling and logic components to make my current Hal work as intended.

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

Time to create page: 1.826 seconds
Powered by Kunena Forum