Spindle (stepper motor) stopping too fast.

More
15 Nov 2023 12:50 - 15 Nov 2023 13:04 #285500 by timo
In the other thread it was suggested by andypugh to change one line in the .hal The attached .hal file is the changed version.
This now behaves as I would have expected with M3S0 and M5 both slowing down the stepper motor. If I did not overlook something it solved the problem.

forum.linuxcnc.org/10-advanced-configura...-stop-command#205319 Instead of "spindle-enable" the stepgen.02.enable is connected to "machine-is-on" (whatever that means, I still get confused with hal terminology :-) ) It is around line 180 in the hal file.

  [attachment=57374]drehmaschine2.hal[/attachment ]

Greetings and thank everyone for fixing my issue.
Attachments:
Last edit: 15 Nov 2023 13:04 by timo.

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

More
15 Nov 2023 13:05 #285503 by timo
Was the attachment "broken"?

File Attachment:

File Name: drehmaschi...1-15.hal
File Size:11 KB
Attachments:

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

More
15 Nov 2023 13:18 #285507 by timo
I feel like not knowing what I am doing here. Somehow I copy/paste my way through the configs and hal files. Thank you for support!

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

More
15 Nov 2023 16:02 #285522 by spumco

I feel like not knowing what I am doing here. Somehow I copy/paste my way through the configs and hal files. 

Everyone feels that way.  Eventually you'll become familiar enough with terminology and LCNC that you'll get better at self-educating when you encounter a problem and need to search for help.

And be patient with the forum editor - it has issues with attachments and editing posts.

Very happy to hear the fix worked out for you.  To give you some context on what you (somewhat blindly) edited:

HAL file is basically a list of connections for LCNC to make when it starts up.  Sort of a 'here's how the network is wired/configured' idea.

HAL is made up of components, each of which is like a little program that does something specific.  Examples of components are "and2.comp", "logic.comp", "mux2.comp", "motion.comp", and "halui.comp".  When the components are created during the first HAL scan (LCNC startup) some 'pins' are also created specific to that component.

Think of these pins just like the physical pins on your stepper drive: the "STEP+" pin does something specific, the "DIR-" pin also does something specific.  Imagine you have a magic wand and created a "stepper drive"...it would come with STEP & DIR pins, right? Your magic drive would likely also have some other input & output pins, as well as some status LED's and similar.

If you look at the HAL file, the "loadrt" statement is you waving your wand and creating a magic component (like your pretend stepper drive).

The "addf" statement puts that component to work - i.e. starts LCNC checking the component every thread cycle.  So:

loadrt magic_stepper_drive  count=3 (creates 3 instances of your magic drive component)
addf magic_stepper_drive.0  servo-thread
addf magic_stepper_drive.1  servo-thread
addf magic_stepper_drive.2  servo-thread  (starts all three components so they can do things)

Now you have three magic drives, and each one has a number of step & direction pins, as well as the other stuff.  Those pins are connected to other pins from other components in HAL.  And they are connected using 'signals' - much like physical pins are connected with wires.

Components ('comps') can be simple or complicated - and "halui.comp" & "motion.comp" are a couple of the more complicated, or at least extensive, components available in LCNC's HAL library.  What you edited was how the stepgen component is controlled by substituting a pin from motion.comp for halui.comp.

At the bottom of the user manual front page is a section "Man pages", with sub-groups of "userspace components" & "Realtime components & kernel modules".  Halui.comp is located in the 'userspace' sub-page.

If you're a Windows person, the concept of Man pages will be utterly foreign - sorry.  Regardless, when you come across a HAL component you don't know (i.e. all of them right now), I suggest opening up the Man page for that component and reading it.  Some of the pages are very helpful, some are accurate but provide zero context, and a few are simply terrible as there's no context or example of use.  But if you read enough Man pages, and your hal file, and about a million forum posts.... it'll sink in.

If you read the halui page, you'll see one of the pins created when halui is started is halui.machine-is-on.  That's one pin you fiddled with.  The other pin is in 'stepgen', and that is on a different Man page (under realtime components).  And the way you did it was unplug one end of the signal (wire) "spindle-enable" and plug "machine-is-on" in to the stepgen enable pin.

What you did, in essence, is disconnect the pin that was telling the stepper signal generator to be enabled only when the spindle was supposed to be spinning, and you plugged in a different pin that tells the stepper signal generator to stay enabled as long as LCNC is turned on.

Keep in mind that everything I've written is a major oversimplification, but hopefully helps you start to digest what you just did in the HAL file.
The following user(s) said Thank You: timo

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

More
15 Nov 2023 19:39 #285538 by PCW
I just added a LinuxCNC issue for this pncconf issue,
and will ask JT if this has been addressed in MesaCT.
The following user(s) said Thank You: spumco, JT

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

Time to create page: 0.080 seconds
Powered by Kunena Forum