Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Slmitch on November 02, 2017, 06:09:55 PM

Title: z axis problem
Post by: Slmitch on November 02, 2017, 06:09:55 PM
I have a home built CNC using Mach3 and I recently decided to upgrade the z axis on my machine as I always felt the Stepper motor was working too hard. So I redesigned this part of my system and upgraded from 17 to 23 stepper motor. now I have a problem I cannot figure out.
As I run the machine the z axis slowly and consistently gains height and after a while the bit is no longer cutting.
I have tried everything from changing back to 17 motors, to changing the step count, to changing to max current to the motors, changing the Hrz from the computer, changing the microsteps, accelaeration, velocity. It is a very consistant and smooth rise so that I can't see it being mechanical, it is like I am loosing a step at each change of the z axis? The g code is something I used before and never had this problem.
Any suggestions or ideas would be most appreciated
Title: Re: z axis problem
Post by: joeaverage on November 02, 2017, 07:07:59 PM
a similar thread to this is:,35699.0.html (,35699.0.html)

The problem was that the Step pin of the BoB was pulled low (say) at idle whereas the driver required an active low (say)
and as a result it would gain (lose) a step at each axis reversal. Does that sound like whats happening to you?

Title: Re: z axis problem
Post by: joeaverage on November 03, 2017, 02:18:12 AM
that might sound like gobble-de-gook. Have a look at the attached pic.

This is of my Vexta stepper driver. The inputs (cw and ccw or alternately Step/Dir with the appropriate selector switches) are opto coupled.
At idle the driver requires that the opto be de-energised. If my BoB is naturally low at idle, ie high when active all well and good, the Bob and
the inputs are well matched and the upper diagram, ie current sourcing is used.

If however my BoB is logic high when idle it will cause the opto to be energised and consequently the first pulse will be masked. Either I need to add
some circuitry or more likely choose an appropriate hook-up to secure the result I want. That is the reason the manufacturer has provided for and published
the two alternatives current sourcing/current sinking. Vexta is a very good Japanese brand and has superb documentation.

Do you have documentation for the input circuit of your stepper drivers? How about a circuit of the output of your BoB? With both of those sorting your
problem will be easy, without it there will be some guessing and experimenting required.

Title: Re: z axis problem
Post by: joeaverage on November 03, 2017, 02:21:49 AM
oops...have confused terms and diagram...
and the upper diagram, ie current sourcing is used.
That should be 'the lower diagram, ie current sourcing is used.'

Title: Re: z axis problem
Post by: Slmitch on November 03, 2017, 07:59:55 PM
Thanks for your replies and info
Unfortunately this is just a small homemade cnc, so I don't have much info for the drivers and motors. As I read through the similar posts, I really think it hit the mark. I tried changing the DIR and Step to active low, but saw no change. I did find it changed the motor speed, direction, etc. I would love to pick some ones brain that has a handle on all the ins and outs of this part of the cnc system, but that is for another time
I  was in the process of trying to run the step motors with the highest and lowest step settings, to see if I could see a difference. But, of course, I had a small disaster and all testing has stopped.
I nearly have things back together, but in the mean time do you have any suggestions as to how or what I can do to pin point the problem and hopefully solve it. Please bear in mind  I have a limit experience with the electronics/software end of things, but I am always up for learning something new.
Again thanks for every ones input.
Title: Re: z axis problem
Post by: joeaverage on November 03, 2017, 08:22:01 PM
can do. A lot of gear made for the hobby CNC market has poor documentation, even among quality manufacturers the info can be maddeningly brief or just
non-existent. I, for other reasons, elected to buy Vexta stepper and drivers and paid a huge premium for them. As it turns out my reasons were weak but that
was my understanding at that time...I've learnt more since then, but one of those happy consequences is the quality of the documentation. Certainly English is a
second language to the Japanese manufacturers but the quality, readability, detail and accuracy is superb. Why it is that so many of the Chinese manufacturers
documentation is that poor as to be unreadable and lacks any useful detail? Roger has pointed out that many of the Chinese companies we deal with are just
selling houses, they don't make and certainly don't design anything they sell. They don't answer questions because they can't.

That brings us back to your problem. In absence of documentation then your are going to have to measure or otherwise characterise the inputs to your drive
and the outputs of your BoB. Do you have any documentation at all? Even if its no more than 'output opto isolated' for instance may well give us enough clues
as to how its arranged internally.

Knowing the required signalling requirements of your drivers would be especially welcome. If the drivers have an IC which is very common with the lower
current drivers the input characteristics are largely determined by the IC which should be searchable. Do they have a driver IC and can you read the part number?

Title: Re: z axis problem
Post by: joeaverage on November 03, 2017, 08:23:43 PM
don't know if you have an Estop button, but you may not prevent all accidents but you will stop a few!

Title: Re: z axis problem
Post by: joeaverage on November 03, 2017, 10:07:43 PM
I've taken these shots from the manual of my BOB from Homan Designs in Austrailia. Note the both pins 2-9, the bi-directional capable
and the regular outputs 1,14,16 and 17 are NOT opto coupled. It should be noted that many BoBs do have opto isolated outputs and these diagrams
will not help you if trying to devise a circuit diagram for those types.

It may be that you have non isolated BoB outputs and therefore this discussion may well be of help to you. Another thing to note is that all outputs
have an LED. They are a Godsend when trying to set your machine up especially if new to Mach. If your going to buy another BoB then look for versions
which have LEDs on the outputs and if possible on the input buffers as well like these MB-02V6's.

Another thing to note is that whether these inputs are pulled high or pulled low is determined by a jumper, it adds flexibility but can also create some
confusion, so its a bit of a wash as to whether it useful or not. The important point here is that if say the pull up resistor is engaged high then at idle
the output will be high but with an impedance of 1.2kOhm. A load of only 4.2 mA would drag the output to 0V. If your driver or whatever you
have attached to the output is expecting a current source of more than a couple of mA with the gate idle it will be disappointed and probably fail.
When the output goes low the output will sink around 15mA, the normal sink current of a TTL gate, plenty adequate. When the gate goes high, ie driven
high by its input the gate can source plenty of current, around 20mA. So the situation is that the output is well defined and can either source or sink
current as required and is only marginal if the gate is unpowered, a most unusual condition, a fault really.

Title: Re: z axis problem
Post by: joeaverage on November 03, 2017, 11:03:35 PM
as I alluded to in the previous post I have attached a brief sketch of opto isolated outputs.

The top one, output named CURRENT_SOURCE, will when the opto transistor is active source current direct from Vcc to the load. When it is inactive it will
attempt to sink current via R1 to earth. Excepting a low value of R1 its ability to sink current is modest, the more current it tries to sink the output low
voltage will increase until the load doesn't know whether its low or high.

Conversely the bottom one, output named CURRENT SINK, will when the opto transistor is active sink current from the output pin to earth. When it is inactive
the output will be pulled high by R2. Excepting a low value of R2 its ability to source current is modest.

The Vexta stepper driver I posted earlier required a current of 7-20mA to be active. Thus if we used the output represented by the lower one with a Vcc of
5V then R2 would have to be 5V/10mA=500Ohm to be sure of turning the input on when the opto is inactive. With Vcc of 24V R2=24V/10mA=2.4kOhm

With the non isolated ouptuts that I posted previously they could source or sink currents of 15-20mA easily whereas the opto isolated ones rely on a resistor to source/sink
current in one state. This can be done no problem but it does require some thought and knowledge of the load to be done successfully.

The trick now is to find some way of identifying which of the two types you have.

Title: Re: z axis problem
Post by: joeaverage on November 03, 2017, 11:04:50 PM
oops forgot to attach the pic.

Title: Re: z axis problem
Post by: Slmitch on November 04, 2017, 08:58:31 AM
Hi Craig
1st, Thank You for all the info, it is very much appreciated.
I will be reading it carefully in the next few days.
I also have a bunch of family commitments coming up, so I will be away for a little while. I will be back in contact when as soon as I can.
Again thanks