How to reverse axis movement? (Resolved)

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
ashesman
Posts: 126
Joined: Thu Dec 03, 2020 4:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
CNC Control System Serial Number: none

How to reverse axis movement? (Resolved)

Post by ashesman »

Setting up my Oak today with DYN4 drives, I found that my X and Z axis move backwards. This machine is gantry style, so the spindle should move right in the + X direction.

The DRO readout is correct, it increases when the spindle moves right. But, jogging + moves to the left! The Y axis is correct.

Using DMMs DYN4 to Oak cables. The motor drives are setup and tuned OK in the DMM software.

I tried reversing the axis motion in the motor settings and restarted everything. That made it jog in the correct direction but the DRO is now backwards.

Any ideas how to change the motor driven direction only?
cncsnw
Posts: 2080
Joined: Wed Mar 24, 2010 5:48 pm

Re: How to reverse axis movement?

Post by cncsnw »

Are you running in analog velocity mode, or in pulse-train position mode?

If you move X more than 10mm or so, do you get a "410 ... position error" stall? Or can you move indefinitely without error?

If you use MDI instead -- e.g. "G1 G91 F100 X10" does X move in the correct direction, or is it still opposite the DRO direction?
ashesman
Posts: 126
Joined: Thu Dec 03, 2020 4:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
CNC Control System Serial Number: none

Re: How to reverse axis movement?

Post by ashesman »

I believe I am running in pulse train mode. The DYN4 drives are set to A/B Pulse and Position Servo. I don't remember setting anything up in the Oak but that was months ago I did that! The drives are configured as per DMMs recommendations and using their cables but I am not sure the encoder gear/line number they said to use are correct!

They told me:
GEAR_NUM = 8192
LINE_NUM = 4095
Oak setting = 32768count/rev

When I moved one of the motors by hand one full turn it showed 16000 odd counts in the CNC12 encoder screen, not the 32768 I was expecting. GEAR_NUM of 8192 x 4 = 32768 which should turn the motor one full turn for 32768 pulses from the Oak. Pulses output per revolution = LINE_NUM x 4 = 4095 x 4 = 16380 which matches what I saw. I would have thought that using 4095 for both numbers would make more sense, but what do I know!

I definitely got a few "position error" warnings when moving too far. I could only move around 5mm. I assumed that was due to the DYN4 encoder count setup but I didn't look into it any further yet. I thought getting the directions right was most important.

I just powered up the machine for first time today so there was a million things to check!

I wasn't brave enough to try MDI incase it moved too far! This machine can crash and do damage before it hits the hard stops in some directions so I need to be cautious! I figured if it couldn't jog without an error then I shouldn't try make it move in auto.
cncsnw
Posts: 2080
Joined: Wed Mar 24, 2010 5:48 pm

Re: How to reverse axis movement?

Post by cncsnw »

You should be doing this testing with the motors uncoupled from the ballscrews.

Go to the PID Configuration screen (F1/Setup -> F3/Config -> "137" -> F4/PID.
Select Incremental, Slow jog mode.
Watch the "Error" values as you jog the axes.

On your Y axis (the one you report is both moving and counting in the correct direction), you will probably see Error return to near zero after each incremental jog, no matter how many increments you jog.

What happens with the Error values as you jog X and Z successive increments?

In position mode, if the DRO for an axis always counts the correct direction, but any kind of movement on that axis always moves the wrong direction, then you have a miswired cable. In that situation, the Error value would increase, by 2x the number of counts it should have moved in one increment, every time you jog another increment.
martyscncgarage
Posts: 8456
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
CNC Control System Serial Number: none
Location: Mesa, AZ

Re: How to reverse axis movement?

Post by martyscncgarage »

ALWAYS Post a FRESH report when asking for help.
F7 Utility, F7 Create Report

Dyn4 drives run under OAK in Precision Mode

You following the Oak Installation Manual?
Search for Direction Reversal in the manual
https://www.centroidcnc.com/downloads/c ... manual.pdf

Figure 6.4.3
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
ashesman
Posts: 126
Joined: Thu Dec 03, 2020 4:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
CNC Control System Serial Number: none

Re: How to reverse axis movement?

Post by ashesman »

Hi Marty, yes I followed the manual. But as mentioned above setting axis to reverse changed both the DRO direction and travel direction.

I will go down tonight and spend some time on just this issue. Last time I was juggling a lot of testing all at once.

I will look at the error values suggested above and report back. Also make a report file.
ashesman
Posts: 126
Joined: Thu Dec 03, 2020 4:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
CNC Control System Serial Number: none

Re: How to reverse axis movement?

Post by ashesman »

OK, so tonight I went over this with a fine tooth comb and got it sorted. There were two major problems. Firstly some axis are reversed, secondly movement distance does not match DRO or encoder counts.

So I decided to sort movement distance out first. This should have been as simple as typing in the numbers on the DMM instruction sheet. I want to make it clear that as I previously suspected these are completely wrong. They do not line up with the math in the manual or work in practice.

The Oak expects to receive the same number of pulses for one revolution of the motor as it sends out (assuming encoder on motor). DMM say to set the Oak to 32678, GEAR_NUM to 8192 and LINE_NUM to 4095. This is correct for the oak driving 8192 x 4 = 32768. But, the encoder output signal would be 4095 x 4 = 16380. The correct numbers to use are Oak = 16380, GEAR_NUM of 4095 and LINE_NUM of 4095. output pulses = 4095 x 4 = 16380 = 4095 x 4 = input pulses. 4096 can not be used for GEAR_NUM as you cannot set LINE_NUM higher than 4095. You would lose 4 pulses per revolution.

Ideally you would set the number of pulses per revolution to encoder counts per revolution, which in my case is 10000. That would give GEAR_NUM = LINE_NUM = 2500. GEAR_NUM of 2500 works correctly. It turns out that even if you set LINE_NUM to 2500 it doesn't work. The DYN4 always outputs 4095 x 4 = 16380 pulses. Another DYN4 fault to add to my list!

Anyways, after setting that up I could move 10 revolutions and get 0 pulses in the error count and move the right distance on a dial gauge. Yay!

Next was axis direction. I found the following:

X DRO reversed MDO reversed Jog reversed
Y DRO reversed MDO reversed Jog reversed
Z DRO reversed MDO correct Jog Correct

So, I reversed the /A and A req output signals to the X axis and it solved all the directions. It works perfectly. I will do the same for Y axis tomrorrow night. And swap the /A and A encoder signals on the Z axis. I dont really know why these are different on XY to Z. All the motors rotate the same direction to get + axis movement. But I dont care anymore. I will swap the wires and get on with it! I am using DMMs encoder interface PCBs and the motor wiring and encoder wiring are matched as the DYN4 drives correctly in the self tune function. I am also using DMMs adapter cables so I didn't really have much opportunity to mess up the wiring.

Anyways, tomorrow night I hope I can get homing working.
martyscncgarage
Posts: 8456
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
CNC Control System Serial Number: none
Location: Mesa, AZ

Re: How to reverse axis movement?

Post by martyscncgarage »

Glad you are making progress.
I have not experienced what you have in the several Oak/DYN4 conversions I have done.
And personally, I have set my installation gear and line numbers to be 2000 and 8000 in CNC12. I have always purchased the Oak to DYN4 signal cables from DMM.

I have never used or purchased "encoder interface PCBs"
Marty
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
ashesman
Posts: 126
Joined: Thu Dec 03, 2020 4:54 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
CNC Control System Serial Number: none

Re: How to reverse axis movement?

Post by ashesman »

All sorted now. Swapped the wires as I previously mentioned. I still don't know why I needed to swap them or why XY and Z needed different wires swapped. Soon I have to shorten the cables from the Oak to the drives so I will review them for differences then.

Anyways, after that I was able to get homing working and set up all the travel limits. I still need to fine tune the motor drives, then let the Oak do its tuning thing.

I dont know how to mark this post as solved.
tblough
Posts: 1536
Joined: Tue Mar 22, 2016 10:03 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: Yes
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
CNC Control System Serial Number: 100505
100327
102696
103432
7804732B977B-0624192192
Location: Boston, MA
Contact:

Re: How to reverse axis movement?

Post by tblough »

Since Centroid cannot possibly know the hundreds of different ways motors can be connected to drive an axis, it has no way to determine which way the motor should rotate to drive the axis in a positive direction.

Similarily, Centroid has no control over encoder manufacturers nor how the encoders are mounted in relation to the axis. Therefore it has no way to tell which the encoder counts relative to positive movement of an axis.

One or both of these could be incorrect. If the motor turns in the wrong direction, you need to reverse the motor power leads. If the encoder counts backwards. You need to swap the A/B pairs.

Oftentimes if you've needed to swap the motor or encoder direction, you'll also then need to correct the limit switch configuration.
Cheers,

Tom
Confidence is the feeling you have before you fully understand the situation.
I have CDO. It's like OCD, but the letters are where they should be.
Post Reply