Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: fever16 on December 30, 2009, 09:59:02 AM

Title: mach3 Gear DC motor control.
Post 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
Title: Re: mach3 Gear DC motor control.
Post by: ostie01 on December 30, 2009, 12:29:19 PM
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
Title: Re: mach3 Gear DC motor control.
Post by: Graham Waterworth on December 30, 2009, 01:13:26 PM
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
Title: Re: mach3 Gear DC motor control.
Post by: Hood on December 30, 2009, 02:23:41 PM
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
Title: Re: mach3 Gear DC motor control.
Post by: fever16 on December 30, 2009, 02:30:26 PM
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?
Title: Re: mach3 Gear DC motor control.
Post by: saiz13 on October 23, 2012, 01:17:56 AM
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. 
Title: Re: mach3 Gear DC motor control.
Post by: Tweakie.CNC on October 23, 2012, 02:57:37 AM
Saiz,

Check reply in your other post.

Tweakie.
Title: Re: mach3 Gear DC motor control.
Post by: BR549 on October 23, 2012, 10:29:23 AM
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