HAL M19 Orient dont work

More
27 Mar 2023 13:17 - 27 Mar 2023 13:19 #267600 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
Hello, thanks for the tips, unfortunately I'm not that good at programming. But I have new results.

First, one spindle revolution corresponds to 1.0. Thus, the encoder number is correct.

The next thing I noticed was that the spindle-pos-err always responds in the opposite case. So if rev says 2 then my pos-err says -2.

I also found out today that the pin spindle is orient was true.

What i have noticed in the last few days and again today, especially when i look at the rev, that the spindle continues to run and so emotionally runs past it at the end. If I do G33.1 and the spindle moves out again, the end position is higher than the start position. after completing the g33.1, the machine quickly moves back to the starting position. that looks strange and is irritating. after that back to orient and 1.0 due to the overrun, the spindle then comes to example: 1.375.

I'll attach the current ini and hal in the attachment maybe you'll notice an error, I just don't have an eye for it yet.
Attachments:
Last edit: 27 Mar 2023 13:19 by Stefan321.

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

More
27 Mar 2023 13:39 #267602 by andypugh
Replied by andypugh on topic HAL M19 Orient dont work
One thing that does puzzle me is the offset component that is between spindle-orient.command and the PID command.
Do you remember why that is there?

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

More
27 Mar 2023 15:22 #267609 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
can't say. only the positioning is saved between. moreover, it is routed from cmd to cmd1. I might try throwing that out.

I'm not sure if it solves my problem

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

More
27 Mar 2023 18:00 #267617 by andypugh
Replied by andypugh on topic HAL M19 Orient dont work

moreover, it is routed from cmd to cmd1. 

Yes, but then cmd1 is what is connected as the input to the PID:
net orient-angle     spindle-orient.angle => spindle.0.orient-angle

net spindle-pos        => spindle-pid.feedback     => spindle-orient.position
net spindle-pos            <= spindle.0.revs      <= [HMOT](CARD0).encoder.04.position

setp offset.0.offset 1
net spindle.orient-cmd  spindle-orient.command      => offset.0.in
net spindle-orient-cmd1  offset.0.out     => spindle-pid.command
 

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

More
28 Mar 2023 13:24 #267697 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
unfortunately I don't have time to continue testing until the weekend.

I'll definitely throw out the delay part. since my spindle is also very sluggish. whether m19 or g33.1.
With the automatically generated per wizard, that was not.

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

More
01 Apr 2023 18:01 #268024 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
So I still haven't gotten any further, but now I understand the offset, it's like this, it's referenced once at the beginning and then not anymore. if the spindle is now, for example, at 1.8787 revolutions, the 1 is stored in the cmd + the offset, which is a 1 here, you could also write 2 or whatever, so we would be at 1+1=2 so it must/should keep spindle at 2 with m19 r0.

unfortunately it doesn't do that for me, it lags behind / sluggishly. the orient-pid continues to print a step.

# pwm signal from either motion or orient
net pwm-switch-in0 spindle-pwm-switch.in0 <= spindle-ramp.out
net pwm-switch-in1 spindle-pwm-switch.in1 <= spindle-pid.output
net pwm-switch-out spindle-pwm-switch.out => [HMOT](CARD0).stepgen.04.velocity-cmd


i think here

# If the target position is the same as the actual position, then move the bit in motion from near
net spindle-pos-err spindle-at-pos.in2 <= spindle-pid.error
net spindle-at-pos spindle-at-pos.out =>
net spindle-on0 spindle.0.on => spindle-active-delay.in
net spindle-on1 spindle-active-delay.out => or2.0.in0 => not.0.in
net spindle-on2 and2.0.in0 <= not.0.out

# Enable orient and pid
net orient-active and2.0.out => or2.0.in1 => spindle-pwm-switch.sel
net orient-active => spindle-pid.enable => spindle-orient.enable
net spindle enable or2.0.out => [HMOT](CARD0).stepgen.04.enable

the worm must be inside somewhere. spindle-on2 is my orient. This actually has to be deactivated when the position is reached. spindle itself, i.e. spindle-enable, must remain active. so that the spindle remains fixed. But how do I do that?

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

More
07 Apr 2023 17:53 #268536 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
so I got a little further, first I had the problem that my spindle with g33.1 runs behind for an extremely long time, so I have net
spindle-pos-rowcounts <= [HMOT](CARD0).encoder.04.rawcounts

inserted, now the g33.1 runs very clean again.

to the m19, it doesn't work the way it should
have now
net spindle-pos-err spindle-at-pos.in2 <= spindle-pid.error
net spindle-at-pos spindle-at-pos.out =>
net spindle-on0 spindle.0.on => spindle-active-delay.in
net spindle-on1 spindle-active-delay.out => or2.0.in0 => not.0.in
net spindle-on2 and2.0.in0 <= not.0.out

into changed

net spindle-pos-err spindle-at-pos.in2 <= spindle-pid.error
net spindle-at-pos spindle-at-pos.out => not.0.in
net spindle-on0 spindle.0.on => spindle-active-delay.in
net spindle-on1 spindle-active-delay.out => or2.0.in0 => #not.0.in
net spindle-on2 and2.0.in0 <= not.0.out

. the spindle stops, however, if it skips the sweet point, it needs an extra round

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

More
15 Apr 2023 08:47 #269074 by andypugh
Replied by andypugh on topic HAL M19 Orient dont work
Sorry, just trying to catch up with the forum. Is this working yet?

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

More
15 Apr 2023 14:07 - 15 Apr 2023 14:10 #269107 by Stefan321
Replied by Stefan321 on topic HAL M19 Orient dont work
so, talla83 made a new video about linux 2.8 +, 5 days ago. With the new setup, things are looking pretty good. However, once I have the problem that the spindle wobbles back and forth with the P500. my other problem is that by turning the spindle quickly, the index is lost. So I would either have to build an encoder directly on the spindle, which then replaces the npn sensor, or I have to set index to enable. preferably by S50 m3
g33.1 k0.1 z0. That is enough.which is also another problem if I cut thread g33.1 z-5 k1 then the spindle moves me 2mm lower and when driving out again also 2mm higher koriegirt but then down the 2mm again. more speed the worse


emotionally, the spindle has become very sluggish since orient has been available. I made the comparison again with the auto config. everything was very direct
Last edit: 15 Apr 2023 14:10 by Stefan321.

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

More
15 Apr 2023 18:34 #269141 by andypugh
Replied by andypugh on topic HAL M19 Orient dont work
Do you have both a position and a velocity PID now? You probably need to tune the velocity PID. Firstly by using an FF0 of 1.0, I would imagine. (Basically zero everything except FF0 first, then adjust FF0 to give the correct speed in the middle of the range.

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

Time to create page: 0.102 seconds
Powered by Kunena Forum