Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Sherwood on January 08, 2021, 09:48:53 PM

Title: Motor changing direction at random
Post by: Sherwood on January 08, 2021, 09:48:53 PM
I have recently connected my 3 axis CNC to Mach3 via 3 TB6600 drivers and a ST-V2 BOB. Everything is wired up correctly and Mach3 Config has been entered as per BOB installation instructions.

However, the Y axis motor changes direction at random with each activation of the jog command, either by hot key or from within Mach3. i.e when I press the Y+ command, the motor will start in any direction; Y+ or Y-. The next time I hit the Y+ command again, the motor might run in the opposite direction. The DRO however will continue to clock as if the motor is running in the Y+ direction. The same occurs with the Y- command but the DRO will continue clocking in the Y- direction. This problem initially happened only to the Z axis motor, but that seems to have resolved itself mysteriously and now occurs only to the Y axis. Both X and Z axes' motion are stable.

I have ruled out the TB6600s and the BOB by interchanging the Drivers and BOB axes pin connections, and changing the Motor Outputs pin values in Mach3 Config accordingly. It does not matter what channel I establish between Mach3 and the motors, the Y axis jog commands can not assure direction.

My computer's O/S (Vista) was reinstalled + memoryoveride.zip, as was Mach 3 (R3.043.062) and I also addressed the blue question mark after the Mach3 driver in 'Device Manager' with the fix in https://www.machsupport.com/forum/index.php?topic=38269.0. The blue question mark remains.

I've attached the xml file.

Do any of you have any suggestions?

Title: Re: Motor changing direction at random
Post by: Tweakie.CNC on January 09, 2021, 01:38:09 AM
Check that your PC parallel port outputs are 5 Volt TTL logic and not 3.3 Volt TTL. This thread may be helpful; https://www.machsupport.com/forum/index.php?topic=34848.0

Tweakie.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 09, 2021, 03:38:15 AM
Thanks Tweakie, I'll check that in the a.m.
Title: Re: Motor changing direction at random
Post by: MN300 on January 09, 2021, 07:17:21 AM
If the problem is 3.3V on the parallel port when the signal level is high it would barely meet the minimum value for the BOB board's input. However the direction represented by 0 volts should run reliably. Sherwood reports that the system fails in both directions.
Title: Re: Motor changing direction at random
Post by: TPS on January 09, 2021, 11:39:40 AM
had a look to the BOB shematic, i think this only can happen, if USB is not connected or something is wrong with the 5V of the USB supply.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 09, 2021, 07:56:44 PM
I'll send the pics first
Title: Re: Motor changing direction at random
Post by: Sherwood on January 09, 2021, 08:27:58 PM
The parallel port is integral to the motherboard and not 5V I think. The slot I can use is 3.3V. Pls see the previously attached pics. Can I insert a universal PCI card into the 3.3V slot to supply 5V?.
If yes, I purchase a universal card to resolve the 5V BOB board supply before considering the next.
If no, what are the options; updated computer?

The BOB is not connected to a USB for its 5V supply but to a dedicated 5V 3A transformer. Pic of activated BOB attached.
Title: Re: Motor changing direction at random
Post by: MN300 on January 09, 2021, 09:46:15 PM
I have labeled the step and direction pins on your photo.
The top pins are the signals from the parallel port. The bottom pins, one to the left, are the outputs to the stepper drivers.
To measure the voltages connect the negative lead of the meter to PC GND and probe the pin you want to check with the positive lead.
This will eliminate any doubt as to what the port voltage level is.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 09, 2021, 10:46:40 PM
OK, without jog command: Voltage between GND and each (X,Y,Z and A axis) DIR parallel port input = 108.6 mV. GND to all DIR Driver outputs = 0.29 V. Voltage between GND - STEP //port inputs = 4.5 V; GND - STEP Driver outputs = 5.1 V.
When jog command, for positive direction GND - X or Y DIR input = 4.5 V, for neg direction = 108.6 mV

The voltage does not change despite a change in direction for the Y motor.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 09, 2021, 10:53:58 PM
What is IC2 used for?
Title: Re: Motor changing direction at random
Post by: MN300 on January 09, 2021, 11:55:47 PM
From left to right, IC2 buffers  B-step, B-dir/relay, PWM, and enable. Enable uses 3 buffers, the last buffer is unused.

You measured 4.5 volts on the parallel port pins showing that 3.3V is not an issue. If they don't change when they should the problem is in the PC.

I didn't follow your last sentence. Do you mean the port pin doesn't change when you reverse direction in MACH3 or that the motor reverses without a change in the direction voltage?
Title: Re: Motor changing direction at random
Post by: Sherwood on January 10, 2021, 12:04:51 AM
Yes, the motor reverses without a change in the direction voltage.

I'll have another computer to connect tomorrow, so that'll be interesting.

It could still be Mach3  ???
Title: Re: Motor changing direction at random
Post by: MN300 on January 10, 2021, 12:18:03 AM
That's very strange.  I'll wait to hear if the other computer behaves the same.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 10, 2021, 12:39:49 AM
Heisenberg would be thrilled

Title: Re: Motor changing direction at random
Post by: ZASto on January 10, 2021, 04:03:21 AM
Yes, the motor reverses without a change in the direction voltage.

I'll have another computer to connect tomorrow, so that'll be interesting.

It could still be Mach3  ???

No. It is the voltage levels on parallel port.
According to the datasheet of HC245, your higj logic levels could be somewhere in undefined area for Vih.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 10, 2021, 04:26:02 AM
Hi ZASto, would you please explain that in layman's terms?
Title: Re: Motor changing direction at random
Post by: ZASto on January 10, 2021, 06:00:52 AM
OK, here are the input voltage levels for HC245

If Vih is on the higher side, and your parallel port does not have the 3.3V levels but a bit lower, then HC245 will have it's outputs "somewhwe" where it wants to be at the particular moment.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 10, 2021, 06:52:30 AM
Yes, I can see how that could change the direction at random.

At rest though, the parallel port supplies the HC245 STEP Input with 4.5 V and the DIR Input with 108.6 mV. When the motors are activated the parallel port supplies the HC245 DIR Input with 4.5V in the positive direction and 108.6mV in the negative direction. Therefore the parallel port can supply the HC245 with more than 3.3V when it is required. So I now think it is a 5V parallel port. Also, the random direction changes only occur on the Y channel, which ever way it is hooked up between Mach3 and the Y motor.

There must be something I don't as yet see at the moment and maybe the anomaly is in the computer hardware, although the Y direction changes did not occur when the CNC was attached to the Maxpath42 circuitry .... that just blew up ..... I'll see tomorrow when I hook the other CPU up.

I did not test the voltage on the HC245 outputs with the motors running ... I'll do that tomorrow as well before I connect the other CPU

I have read blogs that state that although stepper coil wiring colour codes are specified by the manufacturer, sometimes the coils are wired differently, which, if not detected, can cause random direction changes. I have interchanged the motors though, and the random direction change always occurs to whatever motor is connected to the Y channel.
Title: Re: Motor changing direction at random
Post by: MN300 on January 10, 2021, 07:46:49 AM
Does the motor ever run the wrong direction when the DIR line is at the low voltage?
Title: Re: Motor changing direction at random
Post by: TPS on January 10, 2021, 07:59:29 AM
here:

https://www.youtube.com/watch?v=uglCm_qsojk&t=84s

is a good tutorial how to check the parallel port for supplied voltage.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 10, 2021, 04:47:05 PM
Yes MN300, it did, but I will go through the entire diagnostics again today to double check all parameters.

Thanks for the utube TPS, viewed it and will do that too.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 10, 2021, 05:25:18 PM
Question: what determines that a motor should run in one direction and not the other when an appropriate voltage is applied to it.

Also, if the DIR input voltage is close to zero both at rest and when the motor runs in a direction, what other factor determines that the motor should actually run and not be at rest.
Title: Re: Motor changing direction at random
Post by: MN300 on January 10, 2021, 06:00:56 PM
Ultimately the direction is determined by the state of the direction pin on the TB6600 IC in the motor driver. That depends on the the amount of current flowing through it's input opto coupler from the BOB. The voltage that drives that current can be measured by connecting the positive lead of your meter to the PC 5V terminal and the negative lead to the relevant 'P' terminal.

When I asked about ever running the wrong direction when DIR is high I was thinking about problems related to the parallel port. Does it ever run the wrong way when DIR is low?
Title: Re: Motor changing direction at random
Post by: Sherwood on January 10, 2021, 08:49:08 PM
Yes, yesterday when I checked the DIR, direction also changes when the DIR is low. i.e. when activating the Y- command, the DIR voltage was low and remained low even though the motor changed direction. I will go through all of the diagnostics again though. Have just returned home after shopping and picking up the other CPU.

Can any one tell me in detail what the Mach3 and CPU software/hardware processes are between activating the jog command and the associated Voltage / current changes in the HC245 pins. There must be a number of settings and other variables within Mach3 and the CPU that have an effect; and that could conflict with each other. I must say that my understanding of what occurs within the software and CPU hardware is quite dim.
Title: Re: Motor changing direction at random
Post by: TPS on January 11, 2021, 01:05:44 AM
the only setting's witch influence the state of the DIR pin are the port and pin Settings in Motor Output TAB.

interesting would also be the state (voltage) of DIR+ DIR- directly measured at he TB.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 11, 2021, 05:20:47 AM
Thanks TPS, the replacement PC was not functional, hard drive issues. I'm borrowing another tomorrow loaded with XP.

Did quite some diagnostics with the motors at rest; all within normal limits. Will have help tomorrow to measure current and voltage at the HC245, BOB and TB6600s, with the motors activated.

I have the Motor Output values entered as per the BOB manual and will measure the DIR values at both the BOB and TB6600s with the motors at rest and activated
Title: Re: Motor changing direction at random
Post by: MN300 on January 11, 2021, 08:37:46 AM
The only way the stepper driver can randomly run the wrong way is if the stepper driver sees the DIR input as being in the wrong state. This could be from the signal being on the threshold between states or if there are pulses on the DIR line you can't see with a meter. A friend with an oscilloscope would be a big help in diagnosing the problem.

Earlier I asked about the high voltage level at the parallel port input and the low level at the 'P' terminals (inputs to the stepper driver). These are the conditions where the logic levels are most likely to be at their threshold. The port inputs would affect one direction and the 'P' terminals the other. Since both directions sometime fail it would take two types of failure to cause your problem. That's possible but not too likely.
Having stray pulses (or noise) on the DIR line wouldn't normally be too high on the list of probable causes but the fault has evaded capture so far.

Sometimes troubleshooting by replacing parts is easier than tracking down and measuring the exact mode of failure. We will learn more when you try another PC.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 12, 2021, 08:49:31 PM
Problem solved :D, the Y TB6600 B- terminal was not making contact with the motor cable so the motor was activated by one coil only.
Such a simple situation. I soldered the wire end and folded it back over the insulation, inserted it into the terminal receptacle and tightened the screw. The screw pushed against the insulation and pushed the wire into the plastic corner of the terminal, so no contact. The torsion on that wire was such that every time I took it out of the terminal receptacle and then put it back again, it would enter in the same position  :(

Gentlemen, thanks for all your help. I'll put the machine back together again and prepare for the next phase - learning how to make something.

Have a great 2021 with good health
Title: Re: Motor changing direction at random
Post by: MN300 on January 12, 2021, 09:17:56 PM
I'm surprised the motor ran at all, it couldn't have had much torque. Now you can get on with some serious motor setup.
Title: Re: Motor changing direction at random
Post by: Sherwood on January 13, 2021, 12:00:22 AM
Aaah so I'm not finished yet, OK, I'll put the motors and gantries back together again to prepare for that.

What should I be looking at to tune the motors
Title: Re: Motor changing direction at random
Post by: Sherwood on January 13, 2021, 05:39:16 PM
I will close this topic as the solution to the issue has been found and open another as required.
Thanks again. ;)