link two different signals to the same output

More
04 Feb 2024 17:08 #292417 by greg23_78
I tried with macros.

To try this, I configured my config like this

INI

[RS274NGC]
REMAP= M901  modalgroup=10  ngc=home_carousel

[HALUI]
MDI_COMMAND = M900 (it is for other thing)
MDI_COMMAND = M901

[TRAJ] NO_FORCE_HOMING = 1

NGC - home_carousel
o<home_carousel> sub

; Move carousel section

M68 E0 Q1 ;set the carousel to move to the right pocket
M64 P0  ;Enable Carousel
M66 P0 L3 Q120 ; wait for carousel-ready = true
    o203 if [#5399 LT 0]
    (abort, carousel not finished)
    o203 endif
    
M65 P0  ;Disable carousel enable

o900 ENDIF    

o<home_carousel> endsub [1]   

hal
net home-carousel halui.mdi-command-01 <= halui.home-all

But no movement from my carousel when I press the home-all button. I presume that halui.home-all is not correct, what can I replace it with?

 

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

More
04 Feb 2024 18:00 #292420 by spumco
Does the 901 macro run from the MDI screen? (not calling it with hal signal)

If so, can you watch the pins and signals in halshow and see if they all do what you expect?  That's the best way to diagnose this sort of thing.

I'd also run LCNC from the command prompt in a terminal and watch for an error when you run the 901 macro - either from MDI or via the halui.home-all button.

Basically trying to figure out if it's the macro or the hal connections.

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

More
04 Feb 2024 18:32 - 04 Feb 2024 19:58 #292423 by greg23_78
my macro works straight away, calling it manually with the mdi works,
I looked to see if the home-carousel signal changes to high when I press home-all. the signal doesn't receive the information, so the problem is really with halui.home-all.

should i create joint_3 and set up HOME_SEQUENCE = 3 or there is a simpler solution for the homing sequence because joint.0.homed instead of halui.home-all allows the carousel to work, but at the detriment of an axis that does not perform the homing sequence.
 
Last edit: 04 Feb 2024 19:58 by greg23_78.

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

More
05 Feb 2024 01:48 #292469 by spumco
Are you using an external button or a user-created screen button to trigger halui.home-all?

If you're just using a standard on-screen 'home-all' button or command then halui.home-all isn't getting triggered.  The GUI is likely using it's own python command to trigger the home-all function.

Try connecting your halui.mdi macro to motion.is-all-homed.  That should trigger the carousel to home after all joints are homed regardless of what initiates the home-all sequence.

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

More
05 Feb 2024 19:31 #292554 by greg23_78
thank you, it works perfectly. i have a question: isn't there a danger that MDI_command-01 will remain continuously high?

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

More
05 Feb 2024 21:12 #292575 by spumco

thank you, it works perfectly. i have a question: isn't there a danger that MDI_command-01 will remain continuously high?
 

Yes.  If you look back in the thread I pasted a snip from one of my configs that has a 'one-shot' component in it.

Using a oneshot between the motion.all-is-homed and the halui MDI command is the way to keep the is-homed from forcing the MID command high all the time.  The same result can be had from classic ladder using a rising-edge coil.

Either way (HAL or ladder), you want a 'blip' to trigger the MDI command - like a momentary button instead of a on/off switch.

If you need help setting up the oneshot after reading the LCNC manual (in the components section), just ask.

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

More
06 Feb 2024 19:47 #292678 by greg23_78
everything is working correctly, thank you spumco for your help.
for anyone interested in the carousel home in the home-all sequence.

Ini:
[RS274NGC]
REMAP= M901  modalgroup=10  ngc=home_carousel

[HALUI]
MDI_COMMAND = M901

home_carousel.ngc
o<home_carousel> sub

; Move carousel section

M68 E0 Q1 ;set the carousel to move to the right pocket
    M64 P0  ;Enable Carousel
    G4 P2  ; Wait 2 seconds

    M66 P0 L3 Q120 ; wait for carousel-ready = true
        o203 if [#5399 LT 0]
        (abort, carousel not finished)
        o203 endif
    
    M65 P0  ;Disable carousel enable

    

o<home_carousel> endsub [1]   

hal
loadrt oneshot count=1
addf oneshot.0                servo-thread
setp oneshot.0.width 1

net home-carousel-oneshot-in         oneshot.0.in <= motion.is-all-homed
net home-carousel-oneshot-out       oneshot.0.out => halui.mdi-command-01

I'll see later if I need to reset the pulse



 
The following user(s) said Thank You: spumco

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

Time to create page: 0.196 seconds
Powered by Kunena Forum