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 or Create an account 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 or Create an account 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 or Create an account 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 or Create an account 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 or Create an account 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 or Create an account to join the conversation.

Time to create page: 0.222 seconds
Powered by Kunena Forum