Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: fever16 on December 30, 2009, 09:59:02 AM
-
hello all,
Iam working on a small hobby robotic arm.
where aim using 3 steppers and 2 small dc gear motors.
in these DC motors,one for rotation and other for closing the gripper.as i don't need much accuracy,i will run these DC motors based on time(using g04).
so how do we do it using mach3.i can assign 2 outputs for each motors,to interchange the polarities for CW and CCW motion.
so to enable these outputs,do i need to work on macros.
over all i need to control 4 outputs using M-Codes.
Regards
-
Hi, I'm not an expert but maybe you could call these 2 motors, axe B and axe C.
Call those axes in your program and you could place the dwell time command G04.
Mach3 can control up to 6 axes, X Y Z and ABC, each can be controlled with output for direction and steps.
Hope this help.
Jeff
-
In ports and pins set Output1,2,3,4 to the port and pin for your motor signals.
Use some of Mach3's M codes e.g. M3, M4, M8, M9, modify the macro in the VB editor to ActivateSignal(Input1) and DeActivateSignal(Input1)
For example :-
'M3 macro
ActivateSignal(Output1)
sleep 100
code "G4 P1000" ' wait 1 second
sleep 1000
while ismoving()
wend
DeActivateSignal(Output1)
sleep 100
Just do this for each M code and save them back changing the Output1 to whichever one you are using.
This may not be perfect but its a starting point.
Graham
-
Worth noting is you can have the G4 in Mach configured for seconds or milli seconds so make sure its milliseconds if using Grahams example or you will be getting tired waiting for it ;D
The check box for it is on General Config page.
Hood
-
thanks for the response.
iam not very good with understand the coding.
so the above script when called imean M3 or M4,it will active the particular pin and want for 1000ms then again it get turn off instead of using M5
right?
and what is while ismoving() and sleep100 for?
-
hello friends ,
i am new to cnc machines i dont know any thing about cnc machines for my academic project i have designed a cnc carving machine basic design using dremel 300 rotary tool but for axes motors iam using dc gear motors of 30 rpm.why because i can't afford for stepper motors. i would like to know whether mach3 can support for dc gear motor control from motor outputs option in it. i need reply soon.because my project demo is near by.
-
Saiz,
Check reply in your other post.
Tweakie.
-
another thought, Just use the M3/4/5 and the M7/8/9 directly. They can be output to pins already and can be use directly in the GCODE. The functions to get the process correct (time dwell)could be programmed ON THE FLY
M3 (CloseClaw)
G4P1000
M5 (stop Close)
M4 (open claw)
G4P1000
M5 (stop open)
Just a thought, (;-) TP