How to Control a PWM Gripper

More
2 years 2 weeks ago #311986 by Project_Hopeless
I have my hobby robot gripper working and an Axis GUI slider to manually control/test it.  So now I need a hook to control the gripper from an eventual gcode program.

I'm thinking of having 3 states, Open, Close, Variable.  I'll need to output a float value, so is this best suited for G, M, O, or other code? 

Secondly are "aliases" possible in gcode?  For example "Gripper Open"  or "M65 Open" something relatively simple.
Code:
######## rcPWM Gripper Control setp hm2_[MESA](BOARD).0.rcpwmgen.rate 50 setp hm2_[MESA](BOARD).0.rcpwmgen.00.width 1 setp hm2_[MESA](BOARD).0.rcpwmgen.00.offset 1.39 setp hm2_[MESA](BOARD).0.rcpwmgen.00.scale 180 net PWMcmd  pyvcp.servo-f  hm2_[MESA](BOARD).0.rcpwmgen.00.width        #float

Please Log in to join the conversation.

More
2 years 2 weeks ago #311991 by Aciera
Replied by Aciera on topic How to Control a PWM Gripper
You could use the 'motion.analog-out' pins (M68):
linuxcnc.org/docs/html/gcode/m-code.html#mcode:m68

If you wanted you could define your own M-code or Subroutine that sets a particular analog output pin so you would not have to enter the E-word all the time.

We cannot pass strings in gcode and the only way to use something like that would be a subroutine (eg o<yoursubroutine>call)

Please Log in to join the conversation.

More
2 years 2 weeks ago #311997 by Project_Hopeless
I'm thinking about readability, so is this possible with subroutines...

Open CALL
Close CALL
Open 50 CALL (representing 50% full scale)

Please Log in to join the conversation.

More
2 years 2 weeks ago #312037 by Aciera
Replied by Aciera on topic How to Control a PWM Gripper
No that is not possible, subroutine calls need to use the 'O' Word (O <your_subroutine> CALL)
Note: lowercase lettering is also fine like in my last post. Subroutines can also accept parameter values (O <your_subroutine> CALL [123] [456] ...)
Remapped Mcodes can also pass P and Q words: (M456 P1 Q2)

Please Log in to join the conversation.

More
1 year 10 months ago #316995 by robocidalmaniac
Has anyone been able to use M codes to operate a Robotic Arm gripper yet? I have a post for a Scorbot-ER-3 and Linuxcnc 2.9.1 which uses a gui and mouse to open and close the gripper, but need to make a M code for this function. Please help

Please Log in to join the conversation.

More
1 year 7 months ago #323536 by robocidalmaniac
Please a few questions.
I have a Scorbot-ER-3 (with original control box) working using LinuxCNC, But cannot activate the gripper using G-Code commands or the Logitech dual action F310 controller pendant. When Andy designed this for LinuxCNC in 2020 the only way to open or close the grippers is through a GUI pop-up box and the mouse.
Thank you for your time.

Please Log in to join the conversation.

More
1 year 7 months ago #323538 by meister
i use M68 to control my rc-servo gripper's
so i can control it by gcode and for the gui i use mdi commands and a vcp gui with buttons to set some fixed positions

[HALUI]
MDI_COMMAND = M68 E0 Q-100
MDI_COMMAND = M68 E0 Q-75
MDI_COMMAND = M68 E0 Q0
MDI_COMMAND = M68 E0 Q75
MDI_COMMAND = M68 E0 Q100

www.youtube.com/shorts/Tp3savo-MGs

Please Log in to join the conversation.

More
1 year 5 months ago #328935 by robocidalmaniac
Please do you have any more details on this?
How do you use the M68 to open?
How do you use the M68 to close?
Do you have M68 (number value)?

Please Log in to join the conversation.

More
1 year 5 months ago #328940 by PCW
Replied by PCW on topic How to Control a PWM Gripper
www.linuxcnc.org/docs/html/gcode/m-code.html#mcode:m68

See the note about the hal pin.

Looks like meister was using different numbers for different positions
some likely being fully open and some fully closed

Please Log in to join the conversation.

More
1 year 5 months ago #328958 by meister
exactly, the servo is configured as an analog output and can be controlled with values from -100 (open) to +100(closed).
Code:
net sig_motion_analog-out-00 <= motion.analog-out-00 net sig_motion_analog-out-00 => rio.gripper.position

Please Log in to join the conversation.

Time to create page: 0.340 seconds
Powered by Kunena Forum