X2 motor not driving in sync with X motor

Short version
I have had issue with my X2 motor skipping. I have replaced the motor and it made no difference.

I am asking for some help.

The problem is very easy to replicate so either;
a. There is an issue with the X2 driver code; or
b. I have a hardware issue with my driver boards; or
c. My old motor and the new replacement motor are failing / failed.

Demonstration of issue
-Loosen the belt driving X and X2 motors so the motor spin without moving the gantry.
-Run the test code
-Watch X2 start to fail about 7-10 cycles.

Can some people please run this code and see if they get a clean 100 movements without movement retries.

=======

Long version
I have been having issue with X axis with occasional movement retries. I have never been at a point where I had clear data - until now.

When FB is doing its usual watering, the errors randomly occur and it sort of fixes itself but then the movement was out (no longer calibrated requiring a rehome) . In response, I decided to write a soak test for X axis.

The code cycles through 100 movement on X axis over 300 mm just back and forth over, and over. This caused constant failures with the X2 motor, failing to engage or stopping movement early.

I obtained a new motor and the problem was still persistent - so now I am wondering, is the a hardware failure in my rig or is there a bug in the code for X motors. With my X2 motors, when I apply gentle pressure (a small pinch) to the driving gear, - when it is working properly I cannot stop it but when it fails, I can stop the motor with a small amount of pressure.

My request is can some people please run this code and see if they get a clean 100 movements without movement retries.



-- Define the number of cycles for the soak test
local cycles = 100

-- Perform the soak test for the specified number of cycles
for i = 1, cycles do
  move_absolute(500, 0, 0)
  
  move_absolute(800, 0, 0)
  
  -- Report the current cycle count
  toast("Completed cycle " .. i .. " of " .. cycles)
end

-- Move to the final position 0,0,0
move_absolute(0, 0, 0)

-- Ask the user to verify there are no movement errors and the head is at 0,0,0
send_message("info", "Please verify there are no movement errors in the log and visually confirm the head is at 0,0,0.", "toast")

Ran this just now with no X1 or X2 motor connected (different from your requirement of running active motors unloaded)
No problems detected.

Low probability : many other bots doing similar workloads every day successfully (?)

Now we’re narrowing the possible culprit(s) . . Maybe time to swap out the current Farmduino ?

Thanks for the feedback.
I have three motors and all three are having the same issue - so it is not likely to be the motors.

I agree it is a low probability of the code being wrong but it is possible. The gantry will move with one motor, most of the time and it will compensate for move errors so it is entirely possible that it has been compensation all of this time across multiple rigs.

I say that due the the find_home() bug I found last month. It has been there for years and no one noticed. As my primary focus is soak testing so I can get a hardened system, it is possible that the stresses I am placing on the system are showing weaknesses. I say this as the system still waters the plants successfully twice a day without reporting errors. It is the soak test script that causes errors - which is interesting in itself.

I have just purchased a dual channel 100 MHz oscilloscpe and will be investigation very closely to try to work this out.

Oh, OK !! (he says, green with envy)

Still, the HCF is the Farmduino PCB. (design flaw, stepper driver chip batch problem, etc.)

The oscilloscope was £ 150. I could not believe how cheap they are now. They used to be £ 800 +.

I hope we haven’t missed the bleeding obvious :slight_smile:
That behaviour is a classic case of low motor drive current.
Are you completely happy with the X2 motor cable and (esp.) the connectors and seating at both ends ?

LOL. It is good to point out the obvious as it is often overlooked.
No. I checked that. The issue is also intermittent but repeatable, which is why it is interesting.

The majority of the time 80% +, it works perfectly. A strong drive on X2.

Doing ‘the test’ and removing all load by loosening off the drive belts, you can clearly see the X2 motor stopping moving the X1 is still moving. I also looked at the drive current settings but there does not seem to be a setting that is unique for X2. X1 works perfectly. It is most strange.

I think the next step is to swap X1 and X2 motor.

That will give me a new set of data.

1 Like