Clearpath MCVC Spindle Motor Control - Solved (Mike R is an absolute legend)

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Richards
Posts: 692
Joined: Sun Sep 16, 2018 9:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: South Jordan, UT

Re: Clearpath MCVC Spindle Motor Control - Help Requested

Post by Richards »

gMike,

I was able to run some tests today. Acorn's PWM mode seems to work almost as expected with my ClearPath MCPV servo.

Parts:
Acorn V4, with relay board not connected (to avoid modifying cable)
PS that shipped with the Acorn board
DB25 male breakout board for easy connections to the servo.
MCPV-3421P-RLN servo
Teknic 10-foot power and data servo cables
IPC-5 power supply
Oscilloscope
Digital Tachometer
DIN Terminal Block

Acorn / ClearPath Connections
DB25 Pin 14 connected to ClearPath Input B+ (Black wire)
DB25 Pin 21 (GND) connected to DIN Terminal Blocks (all terminal blocks are GND)
DIN Terminal Block connected to ClearPath Input B- (Yellow wire)
DIN Terminal Block connected to ClearPath Enable- (Orange wire)
Din Terminal Block connected to ClearPath Input A- (Brown wire)
Din Terminal Block connected to ClearPath Input A+ (White wire)
(NOTE: Input A is used to inhibit the motor. Normally I would have used a relay output to control the inhibit signal.)
ClearPath HLFB+ (Green wire) and HLFB- (Red wire) were not used. Those wires were individually taped off. Use those wires to detect a servo fault.

MSP Configuration:
Follow Digital Velocity Command / Bipolar PWM command w/inhibit
Deadband = 2%
Max Speed (RPM) = 3,000 (which is maximum for my motor)
NOTE: Use Max Speed (RPM) to set maximum spindle speed. See explanation below.

Wizard Configuration:
PWM Setup
PWM Enable = Yes
Base Frequency (Hz) = 22,000
PWM S command range = 0-100

Spindle
Spindle MAX speed in high range = 200
NOTE: The explanation for this setting is in the MDI section below.

MDI
G1
S100 /* PWM at ~50%. This is the dead-band region. */
M3 /* Start spindle. Spindle will not turn until speed is set outside the dead-band region. */
S50 /* PWM at ~25% duty cycle. 50% of max speed in one direction */
S2 /* PWM at ~Minimum duty cycle. Max speed in one direction */
S150 /* PWM at ~75% duty cycle. 50% of max speed in the other direction */
S198 /* PWM at ~100% duty cycle. Max speed in the other direction */
M5 /* Stop spindle */
NOTE: With Spindle MAX speed in high range set to 200, S2 - S99 allows 100% of all speeds in one direction and S101 - S198 allows 100% of all speeds in the other direction.

Manual Mode using the control panel
Set Spindle Auto / Manual to manual
Push Green ON icon
Increase speed in one direction by incrementing the "+" button
Increase speed in the other direction by decrementing the "-" button.
The speed will slow as the PWM nears 50% and will speed up as the PWM duty cycle nears 100% (for one direction) or 0% (for the other direction).

From this very limited testing, it seems to me that using a Teknic ClearPath MCPV (or MCVC motor which I assume will work, but I don't have one for testing) works very nicely with the Acorn PWM command. The "gotcha" moment came when I expected to be able to simply set the speed desired using the "S" command. Instead, I found that setting the Spindle Max speed in Wizard to 200 allows me to enter a number from 2 to 100 to inversely set the speed in one direction (2 is fastest, 100 is stopped) and to enter a number from 100 to 198 to go the other direction where 100 is stopped and 198 is maximum speed in the other direction.

The oscilloscope verified that the PWM duty cycle changed with the S command (or by using the +/- buttons in manual mode).
The digital tachometer showed a maximum speed of 2,977 RPM in one direction with S2 and 2,977 RPM in the other direction with S198. Setting S less than 2 or greater than 198 stalled the motor. The duty cycle was too close to 100%. Those speeds were obtained when the max speed was set to 3,000 in Teknic's MSP software. When I set max speed to 1,000 RPM, I obtained ~1,000 RPM at S2 and at S198, showing that MSP is controlling the max speed and the Acorn is controlling the duty cycle.
-Mike Richards
gMike
Posts: 23
Joined: Fri Oct 23, 2020 6:29 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Clearpath MCVC Spindle Motor Control - Help Requested

Post by gMike »

Mike R,

I have been really impressed by your dedication to help a complete stranger, it is heart warming. I keep looking around this site trying to find a way to give you a +1! @cnckeith I'd really like a way to do that please : )

I have read your post many times now and feel my risk of disaster is mitigated with the detailed trials and I can go ahead with my planned upgrade. Note I received a response from Teknic that was only a portion of the detail of your post but agreed with your findings as below

"Hi Mike
I took a look at the Acorn manual. It didn't give me lots of information on the PWM output, but I think it should be compatible (assuming of course that the electrical outputs are compatible with the ClearPath motor).

There are two possible "Modes" that would work for you with a ClearPath MCVC motor each with their advantages:

Follow Digital Velocity (Unipolar PWM command) (manual pg 116)
Follow Digital Velocity (Bipolar PWM command) (manual pg 109)

You would need to set the PWM output in the Acorn to be 20 Hz to 30 kHz (which I think it is possible based on the image I saw in the manual).

Thanks,
Jon"

To repay the community at least in some part I'll report back on my findings once the upgrade is complete so I can repay at least a little of the karma that has been paid forward to me : )

Again, many thanks to you Mike R!!!

Cheers...gMike
gMike
Posts: 23
Joined: Fri Oct 23, 2020 6:29 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Clearpath MCVC Spindle Motor Control - Solved (Mike R is a legend)

Post by gMike »

Also note I changed the thread name : )
martyscncgarage
Posts: 9912
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: Clearpath MCVC Spindle Motor Control - Solved (Mike R is a legend)

Post by martyscncgarage »

gMike wrote: Wed Sep 15, 2021 4:40 am Also note I changed the thread name : )
We are very fortunate to have guys like Mike Richards and others who are technically more well versed than most of us and spend their "free" time here to help others. Saying thank you goes a long way. That is appreciated.

Continued luck with your project and the BEST way to say thanks is to take the time to post your project when completed in the SUCCESS STORIES forum when you completed it. Give an overview, walk around and a video clip of it doing its thing.
viewforum.php?f=57
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
Richards
Posts: 692
Joined: Sun Sep 16, 2018 9:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: South Jordan, UT

Re: Clearpath MCVC Spindle Motor Control - Solved (Mike R is a legend)

Post by Richards »

MAJOR UPDATE

Edited:
I was not satisfied with yesterday's test. Using Bi-Polar PWM Command with Inhibit works perfectly fine for me, but it would probably require a lot of manual editing if you use a CAM program to generate G-code. The mode shown in this test could probably be used with CAM software without requiring manual editing of the G-code.

Teknic ClearPath motors have another mode that may be more suited for use with the Acorn.
Follow Digital Velocity Command / Unipolor PWM Input

Unipolor PWM Input allows you to set the max RPM of the motor using Teknic's MSP software, and then to set the Acorn's maximum spindle speed using Wizard. You'll need to set the Acorn's max speed slightly higher than the desired max speed because the PWM duty cycle becomes 100% at maximum speed. The ClearPath servo sees that as either a constant high signal or a constant signal, depending on how you set the polarity of the PWM signal in Wizard. I set both MSP max RPM the Acorn's max spindle speed to the motor's max speed plus 100 RPM. That means that I can still get nearly perfect tracking between the Acorn and the servo as long as I keep the S (speed) setting at or below the motor's maximum speed.

I changed MSP configuration as shown below:

MSP Configuration:
Follow Digital Velocity Command / Unipolor PWM Input
Max Speed (RPM) = 3,100 (which is maximum for my motor + 100 RPM)

When using Follow Digital Velocity Command / Unipolor PWM Input, Input A on the ClearPath motor determines the direction. If Input A+ is HIGH and Input A- is LOW, the shaft turns CW. If Input A+ is LOW and Input A- is LOW OR if Input A+ floats (not connected) and Input A- is LOW, the shaft turns CCW.

Here is a list of the parts used, and configuration parameters, along with the MDI G/M codes used to test this configuration:

Parts:
Acorn V4, with relay board not connected (to avoid modifying cable)
PS that shipped with the Acorn board
DB25 male breakout board for easy connections to the servo.
MCPV-3421P-RLN servo
Teknic 10-foot power and data servo cables
IPC-5 power supply
Digital Tachometer
DIN Terminal Block acting as common (GND)

Acorn / ClearPath Connections
DB25 Pin 14 connected to ClearPath Input B+ (Black wire)
DB25 Pin 21 (GND) connected to DIN Terminal Blocks (all DIN terminal blocks are GND)
DIN Terminal Block connected to ClearPath Input B- (Yellow wire)
DIN Terminal Block connected to ClearPath Enable- (Orange wire)
Din Terminal Block connected to ClearPath Input A- (Brown wire)

ClearPath Input A+ (white wire) controls the direction of the shaft

MSP Configuration:
Follow Digital Velocity Command / Unipolor PWM Input
Max Speed (RPM) = 3,100 (which is maximum for my motor + 100 RPM)
No Deadband setting available

Wizard Configuration:
PWM Setup
PWM Enable = Yes
Base Frequency (Hz) = 22,000
PWM S command range = 0-100

Spindle
Spindle MAX speed in high range = 3100 RPM (slightly higher than the RPM set with MSP software)
Usable range is 0-3000

MDI
G1
S100 /* ~100 RPM */
M3 /* Start spindle. */
S1000 /* ~1000 RPM */
S3000 /* ~3000 RPM */
S3100 /* 100% duty cycle. The motor STOPS */
M5 /* Stop spindle */

NOTE: Control the direction of the motor's shaft via ClearPath motor's Input A as described above.

NOTE: There was NO creep when S (speed) was set to 0. That was good news because there is no dead-band setting with this mode.

Manual Mode using the control panel
Set Spindle Auto / Manual to manual
Push Green ON icon
Increase speed in one direction by incrementing the "+" button
Increase speed in the other direction by decrementing the "-" button.
The speed will almost stop as the speed setting nears 0. In manual mode, there is creep. With my settings, the minimum speed shown on the Acorn's display is 16, not zero. The shaft does not completely stop

I did not use my oscilloscope for this test, because the Teknic manual described exactly what to expect with the PWM duty cycle. At 0% duty cycle, the motor stops. At 100% duty cycle, the motor stops. When there is an actual PWM pulse, the shaft turns.

Both of the modes that I've tested seem to work well with the Acorn. The first mode, B-Polar PWM Command with Inhibit allows CW/CCW control without using a separate direction signal. The second mode, Unipolar PWM Input, allows the S command to set the speed and an Acorn output to control the shaft's direction.
-Mike Richards
gMike
Posts: 23
Joined: Fri Oct 23, 2020 6:29 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Clearpath MCVC Spindle Motor Control - Solved (Mike R is a legend)

Post by gMike »

Hi Mike R,

Just a quick update, I have barely been home for a few days so apologies for the delayed response. I'll digest and get back to you!

Many thanks...gMike
gMike
Posts: 23
Joined: Fri Oct 23, 2020 6:29 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Clearpath MCVC Spindle Motor Control - Solved (Mike R is a legend)

Post by gMike »

Hi Mike R,

First up i think this is the best start to a post I have ever seen "I was not satisfied with yesterday's test"

Next "but it would probably require a lot of manual editing if you use a CAM program to generate G-code"
>> yikes no thanks, I am on team "keep it simple", the rest of my project is already hard enough haha

More broadly the penny just dropped and now I really understand what you mean about the different PWM modes. As best as I can see the unipolar control type really is the best way to control the spindle motor speed. Free from noise and excellent resolution. I am at the beginning of a long and difficult micro machining effort using r0.5mm end mills on copper. I need as few other uncontrolled variables as possible and I also intend to rigid tap at M3, I did check the torque calculations and I should be able to comfortably engrave at 10krpm then tap at m3 without changing the belts.

"NOTE: There was NO creep when S (speed) was set to 0. That was good news because there is no dead-band setting with this mode."
>> awesome!

"Both of the modes that I've tested seem to work well with the Acorn. The first mode, B-Polar PWM Command with Inhibit allows CW/CCW control without using a separate direction signal. The second mode, Unipolar PWM Input, allows the S command to set the speed and an Acorn output to control the shaft's direction."
>> Makes sense, it seems this is on par with a default operating mode of the board and should give no trouble down the track.

All up i want to really show you my gratitude for the detailed and diligent work you have done. I think it says a lot about the acorn community that you complete this level of research for a complete stranger. For my part as Marty suggests I'll post my build once its complete as I believe more sherline users will be interested in this option.

Again my deepest thanks!!!...gMike
gMike
Posts: 23
Joined: Fri Oct 23, 2020 6:29 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Clearpath MCVC Spindle Motor Control - Solved (Mike R is an absolute legend)

Post by gMike »

Note: I changed the thread topic name again : )
kilo7
Posts: 39
Joined: Wed Mar 13, 2019 10:57 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 74E182A80DDE-0312191753
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Clearpath MCVC Spindle Motor Control - Solved (Mike R is an absolute legend)

Post by kilo7 »

Does anyone have a schematic to wire Clearpath MCVC servo to Acorns PWM pin out from the parallel port. ?
A job worth doing “right", is!
cnckeith
Posts: 7166
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: Clearpath MCVC Spindle Motor Control - Solved (Mike R is an absolute legend)

Post by cnckeith »

great info, once finalized, please post latest working configurations and maybe a video demo. and i will gather and compile info into a Tech Bulletin and create a centroid schematic for others to use in the future.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
Post Reply