Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: p_j_whelan on August 16, 2010, 10:27:20 AM

Title: Power Supply for Motion Controlling
Post by: p_j_whelan on August 16, 2010, 10:27:20 AM
Hi there,

I am hoping somebody can help me with something that I am having trouble understanding. I am building a mechanical positioning device used to position aerodynamic probes within wind tunnel walls and it is a ball screw driven system. I have the hardware for the rig assembled and wish to apply power to the screws driving the system and control them using Mach3.

The device consists of two ball screws which I wish to control (X and Z direction travel) and the probes rotate about the Z axis then using an additional motor to rotate the probes.

I have been supplied with three stepper motors (Astrosyn MY706, Astrosyn MY703-3 and Astrosyn MY7001) and three microstepping drivers (3 x Astrosyn P402) which require 24v dc power. Ideally I would like to generate and operate a pulse train of around 500Hz (can be manufactured in house using a 555 timer is astable arrangement if needed) to apply the pulses to the drivers but I do not know if this is necessary.

What I cannot understand from reading other posts and looking at other peoples devices is how power is supplied to the motors/drivers and also how the pulse is communicated to the drivers from the 25 pin port if it does come from this port?

Does the PC supply an output voltage which can be used or is an external supply needed (24v dc)?
Also the pulses that are applied to the motor, how are they regulated if it does not come from the PC? Are the drivers regulated by relays which activate the 24v dc supply in the sequence required?

If anybody could give me some help on this or has worked on something similar and can make suggestions on the control system it would be very much appreciated as I am the first to use this software at our University so my Professor would be delighted if I could control the device using a new motion control system than the standard in our Department!!!

Please find attached a diagram of the device showing the direction(s) of travel and what it is that I am trying to power. The CAD model shows a third motor in the Y-direction, please ignore as this has been discarded due to budgetary constraints. Any other info required please ask.

Cheers,
P
Title: Re: Power Supply for Motion Controlling
Post by: Hood on August 16, 2010, 10:41:01 AM
Your power supply will feed the stepper drives and you will need to make or buy a suitable one. If you look in the info section on this site http://campbelldesigns.net/ you will see a PDF that will explain how to build a power supply.

Mach can pulse at 100KHz via the parallel port although 60KHz is likely a more realistic max for most computers. However as you are requiring a max of 500Hz then you will have no issues at all.
Hood
Title: Re: Power Supply for Motion Controlling
Post by: p_j_whelan on August 16, 2010, 10:58:32 AM
Hi Hood,

Thanks for your reply but what voltage will the mach3 pulse supply or does it regulate the 24v that I will supply to the drivers as they are programmed?

P
Title: Re: Power Supply for Motion Controlling
Post by: Hood on August 16, 2010, 11:09:34 AM
The pulse is produced by the parallel port and it is 5v (or should be) It is totally separate from your drives power supply.
Download the Mach3Mill Install and Config Guide and look at page 4-17  it will give you an  idea of how a basic system is set up.
Hood
Title: Re: Power Supply for Motion Controlling
Post by: p_j_whelan on August 17, 2010, 01:57:38 PM
Hi again, had a good go through of my equipment and the Astrosyn P402 drivers have opto isolated input signals so if I am correct (which I am not sure of!!) the 5V input into pulse, direction etc. from the printer port to each driver will activate the relays built into the driver boards and allow the motors to run from the 24v dc supply shown in the schematic below. Just wondering if anybody has ever used similar equipment and was this the layout of the equipment if so?

Also will need to integrate 4 limit/home switches and an E-stop into the system. Is it a case of just wiring them to one of the input pins, e.g. pin 10, and using mach3 to determine if the systems runs or not in the lo/high position? Perhaps somebody would be kind enough to add to the schematic if they know how they will be integrated into the electrics (afraid not very experienced at all in this department!). What I want to do is position 2 limits on each axis, X++, X-- and Y++ and Y-- and use one of each as the home origin then, along with an emergency stop in the case of misuse. I am working at a learning institute after all!!!

Cheers,

P
Title: Re: Power Supply for Motion Controlling
Post by: Hood on August 17, 2010, 05:18:16 PM
Wiring looks good, personally I would use a breakout board but its not mandatory, might just be safer and also if the parallel port is low voltage most breakouts will boost the voltage to 5v.
 Not sure how the enables work but might be worthwhile feeding them through one pole of a two pole E-Stop switch, just a bit of added safety. The other pole would just connect as you have mentioned.
Limits can be all wired in series if they are normally closed switches and that way you will only use one input for all homing and limit switches.
Hood.

Title: Re: Power Supply for Motion Controlling
Post by: Tweakie.CNC on August 18, 2010, 03:13:05 AM
Just a thought,

I use axis enable / disable quite a lot but I have never had the need to actually switch it during program execution.
I took my axis enable connections to three toggle switches (mounted on the side of my control box) for manual use only - and as Hood has said the common feed to the switches could run through your estop for added 'belt and braces'.
The advantage here is that it frees up 3 of the outputs from your parallel port to be used for other stuff. It's amazing how much stuff you can add in a couple of years of use.

Tweakie.
Title: Re: Power Supply for Motion Controlling
Post by: stirling on August 18, 2010, 04:28:24 AM
A point about your wiring diagram above. The 24Vdc supply should be *star* wired to the drives NOT *daisy-chained*.

Ian
Title: Re: Power Supply for Motion Controlling
Post by: Tweakie.CNC on August 18, 2010, 04:46:45 AM
Quite right Ian - the voice of experience here.  ;)

But is this really a wiring diagram or just a schematic I wonder ?

Tweakie.
Title: Re: Power Supply for Motion Controlling
Post by: manmeran on August 18, 2010, 07:00:08 AM
about ENABLE pin:
in industrial driver ,there are two signal (Pulse and Dir) but if we want use IC drive(sample :L297) for build driver, we have three signal(Pulse, Dir and Enable) .
In the industrial driver ,part of the embedded    Task: If the pulse is applied,then Enable pin is enabled.
If the enable pin is active for all times, power IC and motor Will be very hot.

Amir
Title: Re: Power Supply for Motion Controlling
Post by: stirling on August 18, 2010, 08:01:51 AM
But is this really a wiring diagram or just a schematic I wonder ?
Somebody woke up this morning in mischievous mood methinks   ;D

Ian
Title: Re: Power Supply for Motion Controlling
Post by: Tweakie.CNC on August 18, 2010, 08:54:42 AM
 ;D ;D ;D Sorry Ian, couldn't resist - I think that laser cutting this acrylic is messing with my head.  ;D ;D ;D

Tweakie.
Title: Re: Power Supply for Motion Controlling
Post by: stirling on August 18, 2010, 01:51:08 PM
Is that a foot on one of your nuts? - what an excellent idea  ;D
Title: Re: Power Supply for Motion Controlling
Post by: Sam on August 18, 2010, 04:11:40 PM
That's neat Tweakie. Can you turn the laser power down enough to etch something into the surface? For instance, if the cut-out was a dog bone, could you etch something like, say... "Scruffies vet and kennel" or whatever, and then maybe light the edges with a colored light so the etching shows up? Or would it be better done engraved with a cutter? I know that etching done on metal looks really great, but I was wondering about if it would work on the acrylic.
Title: Re: Power Supply for Motion Controlling
Post by: Tweakie.CNC on August 19, 2010, 02:41:45 AM
My apologies to p j for hijacking his thread.

Yes Ian - I hate it when someone steps on my nuts  :D

Yes Sam, I can reduce power / increase speed and cut in to any depth. Because the kerf is extremely narrow any engraving is better viewed at an angle. This keyring was the prototype for some made for my musical buddy Terry Batt. (thanks to your help I can now obtain better edge finish than this  ;) )
The best effects with acrylic are by raster etching the surface - this does stand out quite well when side lit. When I get some spare time today I want to raster etch an owl picture using the Mach Impact/laser plugin and I will post some pics of the result.

Tweakie.
Title: Re: Power Supply for Motion Controlling
Post by: p_j_whelan on September 22, 2010, 12:48:48 PM
Hi Gents,

Thanks for your replies over the weeks. Have the entire system wired and powered at this stage and connected the device, via parallel port to my PC. However some issues have arose, basically that nothing is happening.

To begin with each of the drivers I have contain a Pulse, Direction, Common and Enable port. Each driver is optically isolated and assume that the 5V output from the PC will activate the driver as the pulses are applied. I have assigned each of the port mentioned above to a corresponding pin on the 25 pin port: Pin 1,2,3 and4. When I go to Mach3 and put a "tick" in the enable box for the X-axis and assign pins 1 and 2 as the step and direction input, I still have no movement in the axis. I went further and assigned enable 1 (under outputs tab) to pin 4, the enable port on the driver. Still nothing.

Have an electrician helping me with the wiring and really want to discover if the problem is with the programme or with the wiring, as his time is valuable. Also if anybody could tell me what I am not assigning correctly as regards ports and pins please help.

Another issue I am having is with proximity sensors on the machine. I have two on each axis of motion, X-, X+, Y- and Y+. The sensors are inductive proximity sensors NPN switching type, therefore operate at 24V which goes through a voltage divider to reduce it to 5V which is then input into Mach3. The sensors are always high and when the target approaches they switch to 0V so I am using negative logic to control them. However when testing them out, they send 5V to the PC, however when I place material in front of them, they do detect the material however the signal is not recognised within Mach3.

Anybody who can help me with this it is greatly appreciated. I am really struggling to grasp both of these problems.

Cheers,

PJ
Title: Re: Power Supply for Motion Controlling
Post by: Tweakie.CNC on September 22, 2010, 01:18:12 PM
PJ,

Best to resolve one problem at a time here.

The pin assignments do not normally include pin 1 they are usually (but don't have to be) as follows;

X step - 2
X dir    - 3
Y step - 4
Y dir    - 5
Z step  - 6
Z dir     - 7

At this stage hard wire the enables (they will either be 5V or ground as per the driver instructions) and reconfigure Mach to the pin assignments (if you change anything).
Check that the parallel cable that you are using does actually have pin 1 connected to pin 1, 2 to 2, etc and, if you can, use a voltmeter to measure the PC parallel port outputs to check that, for example, the X dir pin changes state from approx 0V to approx 5V when you hit the X jog arrow keys.

If you report back we will proceed from here.

Tweakie.

Title: Re: Power Supply for Motion Controlling
Post by: p_j_whelan on September 23, 2010, 09:19:39 AM
Thanks Tweakie,

Have got my motors running, two of the three in one direction only though. I have configured them the same as the third which is working fine in both directions. When jogging both motors turn anti clockwise for as long as I hold them for. Try to go back the other way and no movement whatsoever. I have checked the signal from the PC with a voltmeter and it changes from a high to lo when the direction is changed from positive to negative and vice versa. The system thinks that it is jogging back and the X and Y clocks count down but the screw stays in the same position so when I resume jogging in the positive direction it resumes from the original point that it stopped at. Any takers?

PJ
Title: Re: Power Supply for Motion Controlling
Post by: Jeff_Birt on September 23, 2010, 09:54:48 AM
Having one stepper lead broken/open will do this..
Title: Re: Power Supply for Motion Controlling
Post by: Tweakie.CNC on September 23, 2010, 10:38:23 AM
PJ,

The direction signals that you measured with the voltmeter, are they rising to a high level of 5 Volts ?. (some pp outputs only swing to 3.3Volts which may not be enough for some opto isolators in the drivers).
Changing the configuration active high / active low for the step pulse may help.

Tweakie.
Title: Re: Power Supply for Motion Controlling
Post by: p_j_whelan on September 23, 2010, 04:41:47 PM
The voltage(s) that I am measuring are around 3.4, however the fact that I had them running in one direction at least illustrates that the voltage supply is sufficient to power them. Having re-examined the wiring and grounding the common cables again, I sorted out the problem that I was having (Faulty wiring I think0. However a new problem has arose.

For the enable and direction signals that I am sending to the driver I am having no problem, register around 3.4V or so, with the direction going to 0 when the direciton is changed from the Mach3 panel (jogging). Similarly the enable is high when I wish so and disables when I suspend it. However the "pulse" port on my Astrosyn P402, which I have connected to the "step" pin port in Mach3 is staying high even when I try to jog so I am not getting a pulse signal to the driver, only a high or low which does not change unless I change the active high or lo setting.

Put simply, I am not getting a pulse to my driver through pin 5 (direction and enable are pins 6 and 8 respectively). Tried both configurations of active lo (checked and unchecked) still to no avail. Is there another setting that I must assign to enable the pulse train to go from the PC to the driver?. Am getting quite a bit of pressure from people wishing to use the machine also as this is what I need to get it working.

Best regards,
PJ
Title: Re: Power Supply for Motion Controlling
Post by: Tweakie.CNC on September 24, 2010, 02:11:07 AM
If pin 5 is a problem you could try using another pin number and allocation to see if you have the same problem.

What model breakout board / stepper driver are you using ?.

Tweakie.
Title: Re: Power Supply for Motion Controlling
Post by: p_j_whelan on September 24, 2010, 03:10:22 AM
The Astrosyn P402. It is optically isolated and am driving three motors on three drivers. I dont think its a pin assignment problem as none of the motors are operating, however the direction and enable works on each just not the "pulse" signal. I am presuming that this connects to the "step" assignment within Mach3
Title: Re: Power Supply for Motion Controlling
Post by: Tweakie.CNC on September 24, 2010, 05:11:29 AM
Hi PJ,

I think we are going round in circles here.

The Astrosyn 402 spec says that it's inputs are TTL compatible (in my book, that's the 5V standard) it does not specifically state that it complies with the 3.3 Volt standard. As I said earlier 3.3 Volt may not be enough to operate some opto-isolators, at least not reliably and I think you should check this point with Astrosyn before proceeding further and looking for problems that may not exist.

You could try using a PC with 5 Volt parallel port or fit a PCI parallel port card with 5 Volt output, either of these two options may solve the problem.

Tweakie.

nb. You are correct - the pulse is associated with step within Mach.
Title: Re: Power Supply for Motion Controlling
Post by: p_j_whelan on September 29, 2010, 07:14:48 AM
OK, what I have now done is implemented solid state relays between the drivers and the 25 pin D sub. The relays require a 3V input to trigger a max 24V output, which I have connected to the drivers. The problem now seems to be that the pulse width is too narrow for the relays to activate therefore not enabling the drivers to operate. is it possible to raise the pulse width of the signal from 1-5us which is located on the motor tuning tab to well say 100us+?
Title: Re: Power Supply for Motion Controlling
Post by: Hood on September 29, 2010, 07:34:46 AM
You can set to 40uS pulse width by using Sherline mode. At 25KHz kernel that is half pulse width so basically that is the max Mach will allow you to set.
Hood