LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.79k stars 1.15k forks source link

carousel.comp jog problem #2871

Closed Hexagone51 closed 7 months ago

Hexagone51 commented 8 months ago

Here are the steps I follow to reproduce the issue:

30-pocket ATC, controlled using carousel.comp
carousel set to index mode
driven by AC motor and Mesa 5i25-7i77x2
Index pin sensor set to carousel.0.sens-0
Pocket pin sensor connected to carousel.0.sens-1

This is what I expected to happen:

After first enable and homing, when jog-fwd or jog-rev is pressed the carousel must Jog the carousel fwd/rev one tool position

This is what happened instead:

when jog-fwd or jog-rev is pressed, the carousel does not move.

The tests carried out will try to identify the problem.

1-control the correct operation of the jog-fwd or jog-rev inputs on halshow

2-install the latest version of carousel.comp

3-control the value of carousel.0.state on halshow during the process.

result : before home = 0 during home = 11 after home = 0 when jog is press = 20 and still 20 even if jog is release

4-check whether the carousel responds to a tool change request after the jog button has been pressed. The carousel responds to this request.

https://forum.linuxcnc.org/10-advanced-configuration/51496-offset-home-and-jog-caroussel?start=0

It worked properly before this:

First time testing ATC & carousel after fixing some hardware/electrical issues.

Information about my hardware and software:

Debian GNU/linux 10 (buster) - Release 10 LinuxCNC 4.19.0-21-rt-amd64 SMP PREEMPT RT AXIS interface Mesa 5i25-7i77x2 last version of carousel.comp

andypugh commented 8 months ago

Can you clarify which version of LinuxCNC you are running? (2.8.4 / 2.9.2 / Master) Have you compiled a version of carousel from a different version?

Hexagone51 commented 8 months ago

i use linuxcnc/AXIS version 2.8.4-1-gb7824717b I tried on the carousel.comp of the version I installed, so the the carousel.comp of version 2.8.4-1 and the latest version.

andypugh commented 8 months ago

There have been quite a few improvements to the carousel comp since 2.8.4 (if you look here you can see them, https://github.com/LinuxCNC/linuxcnc/commits/v2.9.2/src/hal/components/carousel.comp The last one in 2.8 is "fix homing bug" a8bc2eae567c4c666e730bfb87adc019abae7fb1 Can you try upgrading to 2.9.2 ? You shouldn't need to change anything in the config, and it runs fine on Buster. See: http://linuxcnc.org/docs/stable/html/getting-started/updating-linuxcnc.html

Hexagone51 commented 8 months ago

I tried to upgrade linuxcnc from 2.8.4 to 2.9.2 without a connection but I couldn't get it to work with python3, so I decided to start again with a blank install and re-installed linuxcnc 2.9.2.

After some manipulation of my cnc to see if all working propelly.

I have tested the jog of my carrrousel but I find the same behaviour as before.

before home = 0 during home = 11 after home = 0 when jog is press = 20 and still 20 even if jog is release

andypugh commented 8 months ago

OK, I will try to look into this. Sorry for suggesting something that looks to have been a lot of trouble, but there is other good stuff in 2.9 too.

It is getting stuck here: https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/carousel.comp#L508

Does it ever move? When it is stuck in state 20, what are the values of motor-fwd and motor-rev? (or, are you using the analogue motor-dc?

Basically, if you look at the motor control pins with halmeter, does it look like it should be moving?

Hexagone51 commented 8 months ago

no worries, this is just for information and could be a way of improving the upgrade without network procedure to go from 2.8.4 to 2.9.2, maybe add some help to go from python2 to python3 for beginners like me.

to come back to my problem, here is an image of halshow when i press my physical button jog-fwd, i'm not used to halmeter so i did the test with halshow.(jog-fwd is not active because the physical button is far from my screen, but it activates in high when i press it). the induction motor doesn't start when i press it. The carousel works well when the M6 macro is called up.

422140979_414623211137086_5566906686733079448_n

My carousel system looks like this: -1 induction motor with an oriental motor brack pack for instant stopping of my motor.

andypugh commented 8 months ago

Well, motor-fwd is set. Why isn't the motor turning? That sounds a bit like a problem in your HAL.

Hexagone51 commented 8 months ago

yes i find it strange that the motor doesn't turning. in fact the only parameter that hasn't changed between version 2.8.4 and version 2.9.2 is my hal and ini.

I'm attaching them here

hal [HAL.txt](https://github.com/LinuxCNC/linuxcnc/files/14152327/HAL.txt)

ini [INI.txt](https://github.com/LinuxCNC/linuxcnc/files/14152331/INI.txt)

tool_change_index (it is in this file that the carousel is set up) [Tool_change_index.txt](https://github.com/LinuxCNC/linuxcnc/files/14152335/Tool_change_index.txt)

tool_change [Tool_change.txt](https://github.com/LinuxCNC/linuxcnc/files/14152339/Tool_change.txt) which carousel parameter in the hal can make the carousel work but not the jog?

andypugh commented 8 months ago

I think it is probably something to do with 7i77 output 14.

#M64 and M65 digital outputs
net car-enable motion.digital-out-00            carousel.0.enable hm2_5i25.0.7i77.0.0.output-14
...
#net car-fwd carousel.0.motor-fwd               hm2_5i25.0.7i77.0.0.output-08
#net car-rev carousel.0.motor-rev               hm2_5i25.0.7i77.0.0.output-13

net car-fwd <= carousel.0.motor-fwd
net car-fwd => or2.0.in0

net car-rev <= carousel.0.motor-rev
net car-rev => or2.0.in1
net car-rev => hm2_5i25.0.7i77.0.0.output-13

net car-out <= or2.0.out
net car-out => hm2_5i25.0.7i77.0.0.output-08

During a tool change your G-code sets carousel-enable and also sets hm2_5i25.0.7i77.0.0.output-14. During a jog that output pin will not be set. What does that pin do?

Hexagone51 commented 8 months ago

i had forgotten this pin, i m sorry about that, it was when i was trying to make the carousel work. I removed it, the carousel works correctly but the jog still doesn't work.

andypugh commented 8 months ago

I think this looks like a problem with your configuration, rather than with the carousel component. Can you describe what needs to happen for your motor to move? Is there a brake or latch to release, for example? Is there a drive enable?

Hexagone51 commented 8 months ago

I've tried to illustrate my carousel configuration as clearly as possible.

Here are the sensors

net bit0 carousel.0.sense-0 hm2_5i25.0.7i77.0.0.input-04 (Home sensor) net bit1 carousel.0.sense-1 hm2_5i25.0.7i77.0.0.input-14-not (Pocket sensor 1 turn = 1 pocket)

the illustration is not my carousel but it works the same way.

carousel sensor

For operation

CW - Only hm2_5i25.0.7i77.0.0.output-13 is needed CCW - I need hm2_5i25.0.7i77.0.0.output-13 and hm2_5i25.0.7i77.0.0.output-08

I've tried to explain my electrical wiring as best I can

courousel functioning

andypugh commented 8 months ago

I see a "brake release input" Is that used?

Hexagone51 commented 8 months ago

yes, it's the instant stop. when the relay is released (hm2_5i25.0.7i77.0.0.output-13), the motor stop instantly. so the motor brake when the contact is open

andypugh commented 8 months ago

I suggest logging (maybe with Halscope) the hm2 outputs in normal mode and jogging mode, to see what, if anything, is different. Basically, in mode 20 the system is sat there with motor-fwd being output from the carousel comp, and the motor not going forward....

Hexagone51 commented 7 months ago

I've just found the problem, you were right about During a tool change your G-code sets carousel-enable and also sets hm2_5i25.0.7i77.0.0.output-14. During a jog that output pin will not be set.

I didn't use pin 8 but pin 14 was the start of my carousel. I'm sorry to have wasted your time for an oversight on my part. thank you for your help.

you can solve this topic issues