Author Topic: BLDC spindle  (Read 1062 times)

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1686
    • View Profile
Re: BLDC spindle
« Reply #15 on: October 08, 2022, 12:47:20 pm »
Another small update.
The programmer turned up a week early, so I’ve ripped out the old controller
and installed the new one, well almost It’s temporarily wired in the control box
but I had to use what wiring I had to had to hand and will get some more signal
wiring so everything is colour coded.

Details for this controller and programmer are pretty scarce on the ground so
it took a little while to configure it properly to suit my needs.
There are a few things not detailed anywhere like the controller with it’s default
configuration works very poorly and could possibly over heat the motor.

You must not (for this motor) set the drive for sine wave output. The ‘P’ parameter.

It’s a thee pole pair motor however it performs much better smoother and quieter
when configured for 6 pole pairs, and spindle RPM readout (with my 2:1) pulleys
is very close to true, it’s only different because the ratio is actually 1.98.

At this point I have it set to run in closed loop control. This works well.
Current 3 amps which seems more that adequate at the moment it may change
during more testing.
Max rpm  = 4000. 
Constant torque = off.
Starting acceleration = 2 sec.
Hall sensors = on.

I’ve run a first test file the Z axis disabled for the constant chipload feed rate adjuster
and it run through changing the spindle speed and feed rate to get the required chipload
without any errors.
It’s only a small file, that I made to make a quick assessment of the broad capabilities
of the software and hardware working together as a unit.

I can’t do any cutting until I get some more cabling, I did find while I was rummaging about
trying to find some cable, a hall sensor for the spindle rpm feedback to Mach3 meaning
I’ll be able to Auto calibrate it.
It also means feedrate per rev can be done, and some boring cycles want the
spindle orientated.

So far, the new driver (once I got it set up properly) is performing well enough as a spindle.
In this file it is ranging from 1111 to 1592 tracking the feed rate keeping the chipload constant
and is doing this in a very nice smooth blended way on the machine.
I now have to make a belt guard and a bracket for the spindle sensor, I had wanted to add
a spindle power meter in the same cabinet but after giving the enough air circulation and cabling
space there is no room left so when getting the cabling I’ll pick up a jiffy box for the
esp32 and analog meter.

Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1686
    • View Profile
Re: BLDC spindle
« Reply #16 on: October 12, 2022, 09:14:30 am »
Another small update
I set the spindle parameters and using the pulse output from the drive
auto tuned it, this makes a linear .dat file the PID uses for closed loop
control.
I then made a file (the one posted) which has the spindle rpm set
to vary between 600 and 1000 rpm at the required chipload 0.027.
this is the recommended value from the Sutton catalogue.
I’ll post it as it’s one of the best ones I’ve seen while looking around
It is very comprehensive and even has feed per rev data.
The file has a simple shape using a Troc mop and a profile mop.
I ran the job with no issues, and collected the chips to see if they were
uniform in their size (indicating that constant chipload was maintained)
throughout the run, (600 rpm chips looked like 1000 rpm chips) and as far as I can tell
they are. The job ran at 30% Spindle Power. And I have the current limit set low it can
 be higher.
The spindle readout is stable, the motor after the run was maybe a couple of
degrees hotter than ambient, all I can hear when the spindle is running is belt noise.
It’s only early days yet and I’ve only done one file, but the surface finish and consistent
chip size lead me to believe it was a worthwhile exercise.
Tomorrow I’ll run some files I’ve prepared for 1045 crs and see how I go, If this goes
well, I’ll do some Al with the 3D mops in the following days.
If all goes well, I’ll post the new feedrate adjuster which fixes the Mach3 spindle bug and
will replace a cut feedrate with a plunge feedrate where appropriate like the triangle holding tabs
thing.
Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1686
    • View Profile
Re: BLDC spindle
« Reply #17 on: October 28, 2022, 08:54:59 am »
Another small update.
We’ve had a bit of weather a couple of weeks ago, which took out the Interwebs
for me and a few others, which gave me the time to sort out the coding, and the
spindle drive as a system ‘as a whole’.
It turned out to be ‘Mach3’ challenging.
Not having access to the hive mind, I had to surf through what data sheets I had on hand
and fire up an old computer, I had been thinking of doing this over the years, Interest had
peaked and waned as other projects seemed more practical or interesting, I had taken some
snippets from various forums and wrote a note to self about how to overcome the various
Issues. Couldn’t find it though, and it took at least a week to rediscover what to do.

I tested the code with many files suited to my spindle setup.
Minimum Spindle Speed = 200 rpm.
Maximum Spindle speed = 1750 rpm.
Resolution 1.5 rpm steps.

I’m using the spindle drive pulse output and have a spindle sensor although it’s not
being used for anything yet.
I not using ‘Use spindle output in sync modes’.
I am using Mach3’s pid loop and spindle speed averaging.
I made my own PWM to Voltage converter.

The first pic is of a couple of shapes in CB with a Troch and finishing mop.
The second pic the piece cut out with constant chipload in MDF with a four flute
metal cutting 6 mm endmill. Not the best but what I had on hand.
The side walls of the pocket, where I was looking for artefacts caused by accelerating
and decelerating of the machine and spindle, looked pristine, the spindle speed varied
between 1000 rpm and 1592 rpm the feed rates between 108 mm\min and 172 mm\min.
I first cut out the spindle sensor bracket in 3 mm mild steel (with a through hole) and
was pleased with the result, at the start it was rather incongruous to see and hear the axes
and spindle vary in speed but not see it in the cut surface.

I also did some testing with 25 mm x 25 mm tubular architectural Al, not known for it’s
machining properties, using a Troch and profile mop.
For the first mop I pre-drilled a 12 mm hole on the drill press, set the start point of the mop
to the center of the hole, popped the endmill down to -7 mm even though the stock wall
thickness was 3 mm to make the cut on a new unused part of the endmill.
This went well, so for the next side I navigated the endmill to the stock center and drilled
straight down to -7 and spiraled out to 18 mm.
Of all the tests this was the one that was going to break the endmill as your spiraling out.
continues...

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1686
    • View Profile
Re: BLDC spindle
« Reply #18 on: October 28, 2022, 09:00:00 am »
A few things I learnt along the way:
I could have used the original controller with a suitable opto-isolated interface, it doesn’t have
some of the nice features of the new drive but for a mini-lathe where you just want set a speed
and have the lathe maintain it, it would be fine. No pulse output and the resolution is a bit coarse
for constant chipload.
Earlier in the thread I mentioned that the motor was 10 Nm, I got this value from a guy in Florida selling the
original sewing machine motor and drive with an interface, however when I had the abacus out, I could
only get 4 N\m, so at the spindle I would have 8 N\m, in any case I’ve got more
power than the machine can handle, a little while ago I made a muppet move and drove a 14 mm
endmill into a piece of stock and managed to move the 6 inch machinists vise on the table.
The vice was mounted longitudinally along the table with clamps so not as secure as bolting
it down in the ‘T’ slots but still the noise was loud enough for me to pull the ‘Y’ axis motor off and check
whether I’d done a mischief to the ball screw. I turned the current down another amp as in an emergency I’d
rather stall the spindle (there’s an error output on the drive which stops Mach3) than damage the machine.

Soon I’ll be testing the system's ability to rigid tap, I believe at this point I can tap with spiral point
and spiral flute taps, not sure about rigid tapping with hand taps though.
I had to ditch the Analogue meter idea as it was a while ago that I got it and the rear boss holding the movement
was too big, so I 3D printed a case for the programming panel and screwed it to the control box, where I use it
as spindle power meter. This means I can use the spindle in pure manual mode or with Mach3 with or without
constant chipload Gcode.

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1686
    • View Profile
Re: BLDC spindle
« Reply #19 on: October 28, 2022, 09:08:37 am »
The PP and PPT are very different now, even from the last posted debug version, It has a lot more
States, caters to Mach3’s foibles and fails safe. This won’t affect it’s use with other controllers though.
If you don’t have a variable speed spindle don’t use this constant chipload feed rate adjuster use
the original one which if installed correctly with give you your original output from your PP and when only
when called adjust a particular mop just like this one.
The new parser requires that you enter the style data ‘case’ and ‘space’ sensitive, don’t use enclosing braces.
Don’t use an Troch Style with a non-Troch mop as there’s a 100% chance of endmill breakage.
You can use a non-Troch style with any mop, although you will lose the Troch mop optimisations
for Troch mops.
The last pic is of a section of Gcode, where I turned on the debug output to see how good the output was, as can
be seen the input chipload excursions can be very high in some places with a fixed spindle and feed rate (the blue lines) the red lines are the chipload achieved by the feedrateadjuster.
I’ve checked the PPT output against profile, troch and 3 d mops where there’s a few new features
and cut what stock I had in the scrap bin, into chips, it works like a champ.
In some way’s, not having access to the web was a great benefit as looking at the comments
in most of the threads from the ‘usual suspects’ would have led me to believe that Mach3 spindle problems
were intractable when this is clearly not the case.
I learnt a few things and gained some insight by doing this project, just as with the drilling plugin
where at some point in the project I started to think in drill diameters and still do, I now think
in chip load.
If you have a good value for the surface cutting speed, which can be fraught sometimes as while
looking up plywood the values (for what was described as the same product) varied over a wide range, for
metals the catalogues were very close in agreement.
It’s well worth a bit of legwork to find a good number here, and the chipload for the cutter.
With these values you can do the simple calculation to find the spindle speed and cut and plunge feed
rates, The Spindle speed is the most important variable and the PPT will try to maintain that
spindle speed throughout the file as this gives the best productivity, obviously there are times when
it’s not possible to do this because of chipload and the spindle speed will be adjusted along with the
feedrates to maintain constant chipload.
I’m in the process of converting my old production files to the new feed rate adjuster, which involves selecting
 the new style and setting it’s properties to inherited style.
The first file I did had 85 mops and it got old quick have to replace the style and set the property
in each mop, and I have many files some with a lot more mops, so I’ve added the ability to the
on mass mop editor to be able to set all the styles in one go.
I’m finally done and dusted and will post the PP and PPT in a new post in the PP sectionin the next few days, I've just got to
finish of the mop editor to contunue with the 85 mop production file which I'll process as a last test as it has every mop but the Vengrave in it.


Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1686
    • View Profile
Re: BLDC spindle
« Reply #20 on: October 31, 2022, 04:05:51 am »
Here’s the 3mf slicer files for the printed box for the programming
dongle that you use to setup and display rpm, current draw ect.
I printed with PetG which is a bit more compliant than some of the other
filaments, using 3 mm walls it turned out quite robust and a nice press in fit
with your fingers.

Dave

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1686
    • View Profile
Re: BLDC spindle
« Reply #21 on: November 07, 2022, 02:37:08 am »
Another small update for Mach3 users, I’ve made a small change that comments out a
spindle speed change which in some circumstances, can cause the spindle to stutter when
moving between two mops and no tool change has taken place.
I’ll post it in the post processor thread.
Here are two files, one of which has been run through the Drilling plugin as well.
I’ve ran both of these files through the machine cutting stock a few times each, with
no issues.

My startup procedure from a cold start:
Start controller.
Start computer run Mach3.
Power up spindle controller.
Warm up spindle 5 min at 1000 rpm.
I then check if everything is working by going to the MDI screen and command a spindle speed
twice for example.  Type in M3 S1000, then S1000 again.
For example, today the spindle nose bearings starting temp was 22 deg C, after 5 minutes at
1000 rpm it was 29 deg C, motor temp 25 Deg C, current draw 1 amp.
The cold startup Amps bobbled about between 1170 to 1210 ma.
The static and dynamic friction both decreased. This equates to about 65 watts.

Dave