How to Control a PWM Gripper
- Project_Hopeless
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 200
- Thank you received: 10
13 Oct 2024 16:37 #311986
by Project_Hopeless
How to Control a PWM Gripper was created 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.
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.
######## 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 or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4251
- Thank you received: 1873
13 Oct 2024 16:57 #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)
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 or Create an account to join the conversation.
- Project_Hopeless
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 200
- Thank you received: 10
13 Oct 2024 18:01 #311997
by Project_Hopeless
Replied by Project_Hopeless on topic How to Control a PWM Gripper
I'm thinking about readability, so is this possible with subroutines...
Open CALL
Close CALL
Open 50 CALL (representing 50% full scale)
Open CALL
Close CALL
Open 50 CALL (representing 50% full scale)
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4251
- Thank you received: 1873
14 Oct 2024 06:57 #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)
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 or Create an account to join the conversation.
- robocidalmaniac
-
- Offline
- Junior Member
-
Less
More
- Posts: 21
- Thank you received: 4
19 Dec 2024 17:08 #316995
by robocidalmaniac
Replied by robocidalmaniac on topic How to Control a PWM Gripper
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 or Create an account to join the conversation.
- robocidalmaniac
-
- Offline
- Junior Member
-
Less
More
- Posts: 21
- Thank you received: 4
08 Mar 2025 19:17 #323536
by robocidalmaniac
Replied by robocidalmaniac on topic How to Control a PWM Gripper
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.
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 or Create an account to join the conversation.
- meister
- Offline
- Platinum Member
-
Less
More
- Posts: 519
- Thank you received: 325
08 Mar 2025 19:45 #323538
by meister
Replied by meister on topic How to Control a PWM Gripper
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
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 or Create an account to join the conversation.
Time to create page: 0.061 seconds