Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Bentus66 on September 01, 2017, 09:58:24 AM

Title: AC servomotor calibration problem
Post by: Bentus66 on September 01, 2017, 09:58:24 AM
Hello all, i am new in here so i am not even sure this is the right place to ask, but here goes...

I am trying to setup a Bosch Ecodrive AC servo driver and motor as main spindle on a lathe. My problem is that when i try to setup this servo in motor tuning i can´t get the motor to run the actual rpm as i ask it to within mach3.

The servo is setup to work in step/dir mode, so i guess that it should be spot on with the rpm if correct set up. And by the way the actual speed on screen says 0, so do i have to install a tachometer setup even i use step/dir ?

Been reading different things about the value in velocity option, one is that this is the max speed the motor is designed for, another is that you need to take max speed and divide it with 60 to set the speed.

Tried both and neither is working. It runs but way off regarding the rpm. So anyone who can help me with this?

Another thing is that the motor is quite noisy and sounds like you can hear every single step. This gets better when i raise the step pr. rev. but to get the sound real good i would have to set it so high that mach3 can´t keep up and cuts down on the velocity. When i jog with the drivers internally jog button the motor does not make any sounds at all. Thinking to buy a smoothstepper to get more pulses because the servos driver accepts up to like 65000 pulses pr rev. Am i going in the right direction or is new controller overkill ?? ( i only use parallelport and bob right now.)

Also got a problem with changing in sound (like extra or missing clicks) from the motor, when i do as little as moving the mouse over the screen. I use a 2ghz desktop, os Win XP, and have disabled everything that does not needs to run. is the parallel setup this sensitive or am i having an extra issue here ?
 
Thanks in advance
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 01, 2017, 04:15:13 PM
Hi,
welcome to the forum. You have a few questions there...I'm not sure I can answer any of them!...but can try.

What model servo are you using? Can you post a manual for it or a link to the manual? What model servo drive are you using? Do you have a manual
for it or a link to it?

You say that the servo 'accept 65000 pulses per rev', where did that info come from?

If as you seem to suggest the encoder produces 65000 pulses per rev, it seems an unusual number, I would have expected 65536, ie 2 to the power 16.
Either way the servo drive will expect 65000 pulses to turn one rev at full resolution. If you wanted the servo to turn that one rev in one second then Mach
would have to produce pulses at a rate of 65kHz. It seems unlikely in the extreme that a parallel port is going to produce any thing like enuf pulses.
One rev per second is only 60 rpm, to be useful for a lathe you probably want to spin 2000 rpm ie 33 revs per second.

With Mach open on the Config/Ports and Pins page immediately below the enabled ports boxes there is a box for Kernel speed, the lowest being 25kHz and
the highest is 100kHz. What is your machine set to? The Kernel speed is the repeat speed of the primary internal timer used by Machs pulse engine to generate
pulse streams. If the kernel is set to 25kHz, the norm, then the maximum rate pulse stream it can generate is 25kHz. This will be woefully inadequate for your
spindle. You might ask 'can I increase the kernel speed to be fast enuf for my servo' and the answer is no. Many PCs struggle to produce stable pulse streams
at all, the CPU has too many things going on to concentrate on producing an accurately timed pulse stream.
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 01, 2017, 04:56:16 PM
Hi,
sorry misclick...will carry on.
The faster you try to go the worse it gets. 25Khz is the common standard for most parallel port users. I have experimented with speeds up to 65kHz but
found it too unstable to be of any use and its not like my steppers need it anyway.

How can you solve this problem?

There are several alternatives:
1) Electronic gearing...just about all servo drives offer electronic gearing and in its simplest it means that if Mach applies one pulse to the drive
     it will get 'multiplied by 57', or whatever number you program into it... To take a extereme say you programmed in 65000 then one pulse from
     Mach would cause the servo to turn one rev. You could not however turn half a rev or some other fraction, ie electronic gearing costs you resolution,
     should that matter for a spindle?
2)Analogue voltage control....is there a reason that you selected step/direction, otherwise called position control for your spindle? If you intend to thread
   or require an indexing spindle for gearcutting maybe but in most cases just speed control is enuf. Just about all servo drives offer velocity control by
    application of an analogue voltage of 0-10V. Mach with a suitable breakout board can do this, most CNCers use analogue voltage to control the spindle
    speed.
3)Manual speed control...you could almost certainly have a pot or knob attached to you servodrive which controls the speed and then all Mach would
   have to do is turn it on or off.
4)Get an external motion controller...you mentioned an ESS, I use one and  it produces high quality pulse streams way WAY faster than a parallel port.
   I have a servo for my mill spindle, if I run it in step/direction mode (very unusally I might add) at full speed of 3500 rpm, ie 58 rev per second. The
  encoder is 2000 line or 8000 count per rev, ie at 58 rev/sec the ESS has to produce pulses at 467kHz without the use of electronic gearing. 467kHz is
   low AM band radio frequency! You need some flash signalling electronics to transmit pulses at that speed and your servo at the same speed will be
   58x65000=3.8Mhz. Within the ESS specs but only just and how you will signal your servo drive at that speed is a guess and could your servo drive even
   recognise a signal at that speed? The combination of electronic gearing and an ESS to bring the signalling rate down to a more reasonable 200kHz
   is indicated.

There  are some alternatives for you to think about....I would recommend you start by pursuing the simplest ones and later as your experience and/or
budget demands look at the  more ambitious (indexing) solutions. Analogue voltage and manual speed control are the simplest and ESS and/or electronic
gearing are the way to go for indexing operations.

Craig.
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 01, 2017, 04:59:56 PM
Hi,
sorry just rereading your post and yes all those sounds the servo is making are because Mach is not signalling the servo drive correctly, it probably
won't hurt the servo but its not how you want it to operate,

Craig
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 01, 2017, 05:14:15 PM
Hi and thanks for your answer joeaverage.

You are right about the encoder, i just couldn´t remember the excact number but you got it straight on.

The driver is a Bosch Rexroth DKC01.1-040-7-fw and the motor is a MKD090B-047-GG1-KN. The manual can be found at Bosch´s homepage, i have it but there is nothing about getting it to play within Mach3 or other like that.I have set the driver up with the software that belongs to this system so i am sure there is no errors there.

I think the only reason for the dro speed and actual speed is not the same must be because of the quality of the signal from the parallelport witch is changed to a differential signal with a driver called AM26ls31. I just ordered a smoothstepper today so i hope that will fix all of my problems at the same time.

I first set the step prr rpm to 200 cause this is what my steppers have too, but this made the motor really noisy and full of hard vibrations, and found out it gets better the higher i set the steprate. the 25 kHz is like you say not enough to get it running smooth cause the higher i set velocity=step pr rpm the lower the max speed gets, so smoothstepper and 4 MHz should fix that problem. Just hope the pulses is clean enough for my driver so the speed equals the actual speed. By the way is the only way to get an active "actual speed" by giving Mach3 a index signal from a proxy switch or similar. Again my mind tells me that in step mode what i ask for i s command should be precise what the actual speed becomes.

Whops saw you wrote more,,

I want to use step dir because then i can build a little bridge with a spindle so i can mill stuff like gears and put precise holes in a circular object, thinking i can use the spindle as a axis when i do this stuff. To begin with i also wanted this so i could do threading with total precision, cause mach3 would know precise were the spindle is all time and not only once pr rpm with in index way. Found out later that Mach3 was not even able to do threading this way, but still the axis need is there so fine with step mode. (maybe i have to give up upon it due to the vibration and noise but time will tell when smoothstepper is installed.

I am no electronic expert so sad to hear that i can´t even take advantage of the 4 MHz from ESS but i will look into what this electronic gearing is and were to get it/ how to build it.

I really appreciate that you take your time to help me out here. Thanks a lot.
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 01, 2017, 05:16:42 PM
Hi,
sorry just rereading your post and yes all those sounds the servo is making are because Mach is not signalling the servo drive correctly, it probably
won't hurt the servo but its not how you want it to operate,

Craig
Yeah thats why i try out the smoothstepper now so i can get better and faster pulses
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 01, 2017, 05:18:38 PM
Hi,
sorry misclick...will carry on.
The faster you try to go the worse it gets. 25Khz is the common standard for most parallel port users. I have experimented with speeds up to 65kHz but
found it too unstable to be of any use and its not like my steppers need it anyway.

How can you solve this problem?

There are several alternatives:
1) Electronic gearing...just about all servo drives offer electronic gearing and in its simplest it means that if Mach applies one pulse to the drive
     it will get 'multiplied by 57', or whatever number you program into it... To take a extereme say you programmed in 65000 then one pulse from
     Mach would cause the servo to turn one rev. You could not however turn half a rev or some other fraction, ie electronic gearing costs you resolution,
     should that matter for a spindle?
2)Analogue voltage control....is there a reason that you selected step/direction, otherwise called position control for your spindle? If you intend to thread
   or require an indexing spindle for gearcutting maybe but in most cases just speed control is enuf. Just about all servo drives offer velocity control by
    application of an analogue voltage of 0-10V. Mach with a suitable breakout board can do this, most CNCers use analogue voltage to control the spindle
    speed.
3)Manual speed control...you could almost certainly have a pot or knob attached to you servodrive which controls the speed and then all Mach would
   have to do is turn it on or off.
4)Get an external motion controller...you mentioned an ESS, I use one and  it produces high quality pulse streams way WAY faster than a parallel port.
   I have a servo for my mill spindle, if I run it in step/direction mode (very unusally I might add) at full speed of 3500 rpm, ie 58 rev per second. The
  encoder is 2000 line or 8000 count per rev, ie at 58 rev/sec the ESS has to produce pulses at 467kHz without the use of electronic gearing. 467kHz is
   low AM band radio frequency! You need some flash signalling electronics to transmit pulses at that speed and your servo at the same speed will be
   58x65000=3.8Mhz. Within the ESS specs but only just and how you will signal your servo drive at that speed is a guess and could your servo drive even
   recognise a signal at that speed? The combination of electronic gearing and an ESS to bring the signalling rate down to a more reasonable 200kHz
   is indicated.

There  are some alternatives for you to think about....I would recommend you start by pursuing the simplest ones and later as your experience and/or
budget demands look at the  more ambitious (indexing) solutions. Analogue voltage and manual speed control are the simplest and ESS and/or electronic
gearing are the way to go for indexing operations.

Craig.
sorry wrote my reply as reply to my own thread, thats how it is when one is a newbie to this kind of communication haha
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 01, 2017, 05:30:20 PM
Hi,
sorry just rereading your post and yes all those sounds the servo is making are because Mach is not signalling the servo drive correctly, it probably
won't hurt the servo but its not how you want it to operate,

Craig
Yeah thats why i try out the smoothstepper now so i can get better and faster pulses
By the way, regarding the electronic gearing. Isen´t it what i already use when i via the software can choose step pr rev from a low number and up until those 65536 steps. Cant remember the precise number but if i what to set an ssi output from the driver i can go up around 1200 something, so maybe that is the number of the encoders output pr. rev
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 01, 2017, 06:42:53 PM
Hi,
not quite sure yet but yes it would appear that you can program the resolution of the encoder...page 1.4
Quote
The number of steps per rotor revolution is adjustable between 16 and
65536.
If that the case then why choose max resolution of 65536? That equates to and angular resolution of 20 arc seconds! If your machine is rigid
and accurate enuf to demand a resolution of 20 arc minute let alone 20 arc second then you should be on a professional forum not a hobbyists one!
Additionally if you think you are going to successfully signal your drive at close to 4MHz your dreaming.

The solution I came up with for my servo driven spindle is:
Program the drive to operate in two different modes, the first, simple velocity mode using analogue voltage and, the second, with step/dir position
control.

Most of my milling ops can be done under plain velocity control, in fact its quite adequate to have just a knob you lean over and twist until the tool is
cutting as you want and the leave it there for the rest of the op...in some cases hours. This is the first of the control stratgegies and is selected by one
digital input (pin4 from memory) being held low by Mach. When I want position control for rigid tapping I go to the other mode by asserting the input
pin high. Typically when I'm tapping I don't tap at 3500 rpm! 100 rpm is fine and consequently the pulse output rate is 13kHz, in fact well within the
pulse rate of a parallel port let alone my ESS. As it turns out ESS can signal 467kHz no probs and my drive can receive 500kHz with differential signalling
but transmitting signals of that frequency can be fun and ultimately not even really useful or required for mill operations.

I haven't read the Bosch manual enuf to know whether it allows this dual mode strategy, my Allen Bradley drive does and I've seen it offered in other
makes as well and guess it is therefore standard fare for modern drives. If it is it would allow you to get simple speed control running and then put
your thinking cap on for the indexing mode. I doubt you will need anything like the max speed of the spindle when indexing and so when you 'gear it
down' (electronically speaking) you don't have to sacrifice resolution hugely and yet still end up with a pulse rate that means you don't have to be an
RF/ High Speed Digital engineer to get it to work.

Craig
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 01, 2017, 07:23:53 PM
Since i haven´t tried anything in mach3 turn yet, i have to ask.

The ultimate way of cutting on a lathe is to keep the same feed and that means that the speed of the motor have to change all after the diameter of the material your working on, so my question is this, can mach3 control and adjust speed on the spindlemotor in velocity mode, when you attach a potmeter to regulate the speed manually. I am not sure but i think i can only use a potmeter as an override feature in jogmode.

I haven´t read to much about velocity mode in my manual or mach3´s manual, so i have no clue on how to change direction. I only noticed a jog + and - on the driver. Guess i need to study some more and try to see if there is a solution like yours if i can´t get rid of the noise.

You mentioned your milling when talking about your setup. Mine is for a lathe spindle, sorry if i forget to mention that earlier.


Again i bow in respect to you for spending your time on me,, thanks a LOT.


My driver can not do like yours with setting up two different setups, i have to connect to the driver with a old old laptop running win 3.1 or xp (thats how old this software is) and then via software set the driver to work in either analog, velocity, torque or step mode.

The reason for setting the pulsrate this high is to eliminate the noise and vibrations, not for accuracy
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 01, 2017, 07:32:35 PM
One more thing, the things you said about pulsrate and not being able to use the 4 MHz made me look for the bob´s spec´s but it says nothing about pulsrates. Do you know how fast those optocouplers are. The board is one of the cheap ones from ebay, called universal mach3 usb parallelport bob. (usb only for voltage supply). I have a pic but i can´t seem to find a way to post it here.
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 01, 2017, 08:21:29 PM
Hi,
have been looking at the manual and found:
Quote
S-0-0032, Primary Mode of Operation
which sounds very hopeful because the nexy entry is:
Quote
S-0-0033 Secondary Operation Mode 1
Description:
The first secondary operation mode is reserved for the jogging operation
for DKC.
Any other auxiliary operating modes are not permitted.

so while is has a primary and secondary mode the secondary is reserved for on-drive jogging....bugger!

Your requirement are that you be able to perform indexable operations but also require max speed from the spindle. Even if indexing is not required at high
speed as you have only one mode of operation available to you then your solution is to choose the compromise between the two.
May I suggest that you keep the signalling rate to about 200kHz , beyond that and you will start encountering speed difficulties. You've already identified
one, the cheap optos used on breakout boards are unlikely to go anywhere close to 200kHz.

Say you assume a top speed of 3000 rpm...that is 50 revs/sec. 200,000/50=4000. So if you program your encoder to give you 4000 counts/rev then you can
achieve you max speed comfortably. 4000 counts/rev is an angular resolution of 360/4000=0.09 degree or 5.4 arc min, very acceptable. If that were direct
coupled to a 5mm pitch ballscrew it would be equivalent to a 1.25um linear resolution. Any man, hobbyist or not, could be proud of a machine that could turn
in that sort of resolution! The question is are you?

It is not necessary to set a high pulse rate to achieve smooth or quiet operation of a servo, that comes from the concept of microstepping which is a valid
technique to get smooth motion from a stepper motor.

The ESS will require a breakout board and I doubt the one you have will work well enuf. I use two break out boards from Homman Designs in Austrailia, I
live in New Zealand and as much as it pains me to admit it some of those bloody Aussies are really clever and relatively close, they don't have opto isolators.
You need to be a bit careful about what the various IO is hooked to so that power supplies don't fight but the speed is determined by the TTL buffers, easily in
the MHz range. Even if you get a breakout board without optos and with TTL buffers you will still need to use differential signalling and a twisted pair cable to signal
your drive at 200kHz or better. Are you electronically inclined? A simple line driver IC will do the trick over a few meters. Other than making one yourself you could
probably buy something pretty cheaply....they are really simple/small after all.

I have not used Mach3 turn. I know there is a feature that allows you to maintain a constant surface speed but as I say have not used it. I have done plenty of
manual turning over the years on all sorts of lathes none of which had infinitely adjustable speeds and I made plenty of good ********* on them. Is it that important?
Anyway the setup we're talking here can handle that easy.

While the servo software may run on a XP machine you should be able to set up your drive which is then programmed onto an EPROM and thereafter you don't
need the setup software at all. That's certainly how the Allen Bradley software works, I program the drive on any computer that has the Ultraware software on it
and the I take it away and put it on my mill which doesn't have the setup software on it!.

Craig
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 01, 2017, 08:35:56 PM
Ok so endgame here is, getting a faster breakoutboard and then play with the setup of velocity vs speed and find a good compromise. I think 2000 rpm is good enough for this little lathe.

As i said it´s not about precision but the sound and vibes. This servo sounds precise as a stepper just louder, but only when i use step mode, so guess the motor is ok.

When i get the smoothstepper i will set it up and then i will return to you with the result and if it´s still wrong, i will take a video so you can see and hear how it acts.
Craig, again thanks a lot..
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 01, 2017, 09:00:58 PM
Hi,
just having a look at PMDX-126 breakout board, depending on where in the world you are may be a good bet, $174US, so not cheap but VERY capable
and reputation for backup is 'best in the business' and you'll only need one, it can handle two 'ports' worth of IO.

Am a bit surprised about the noise. I wonder if you have got it set up for 'exact stop' mode or the servo equivalent of. My servo scarcely hums even at
3500 rpm, have to be carful at slow speeds unless you can actually see something turning its easy to reach in without realising its still running.

Anyway once you get your ESS you'll start to make progress. If you haven't used one before may pay to get in some 'patience pills', you will end up
scratching your head to start with.

Do you have a licenced copy of Mach3? It is not possible to upgrade from Mach3 to Mach4, you have to buy anew, so if you haven't already paid for Mach3
you should consider going straight to Mach4. I changed over to Mach4 at the end of last year. Mach4 is new and still developing, for milling/routing it good
to go as is, and for turning ops, not far behind although I cannot personally attest to that.

Anyway good to talk to you, report back once you get some results...your experience will help others.

Craig
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 01, 2017, 10:23:05 PM
Hi,
try per page 6.4 and 6.5 'Position with Following Error'. If you go with 'Position without Following Error' you get a harsh control much like a stepper motor
whereas the 'with Following Error' option allows the acceleration discontinuities to smoothed.

Craig
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 01, 2017, 10:32:38 PM
Hi,
apologies those page references should be 6.1 and 6.2.

Note also in figure 6.4 Stepping Motor Interface on page 6. 4 that the max switching frequency is 175kHz.

I'd be tempted to say you could push that a wee bit, 200kHz you would probably get away with. My Allen Bradley drive allows step/dir signals to 500kHz.

Craig
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 03, 2017, 05:39:38 AM
Hi,
not quite sure yet but yes it would appear that you can program the resolution of the encoder...page 1.4
Quote
The number of steps per rotor revolution is adjustable between 16 and
65536.
If that the case then why choose max resolution of 65536? That equates to and angular resolution of 20 arc seconds! If your machine is rigid
and accurate enuf to demand a resolution of 20 arc minute let alone 20 arc second then you should be on a professional forum not a hobbyists one!
Additionally if you think you are going to successfully signal your drive at close to 4MHz your dreaming.

The solution I came up with for my servo driven spindle is:
Program the drive to operate in two different modes, the first, simple velocity mode using analogue voltage and, the second, with step/dir position
control.

Most of my milling ops can be done under plain velocity control, in fact its quite adequate to have just a knob you lean over and twist until the tool is
cutting as you want and the leave it there for the rest of the op...in some cases hours. This is the first of the control stratgegies and is selected by one
digital input (pin4 from memory) being held low by Mach. When I want position control for rigid tapping I go to the other mode by asserting the input
pin high. Typically when I'm tapping I don't tap at 3500 rpm! 100 rpm is fine and consequently the pulse output rate is 13kHz, in fact well within the
pulse rate of a parallel port let alone my ESS. As it turns out ESS can signal 467kHz no probs and my drive can receive 500kHz with differential signalling
but transmitting signals of that frequency can be fun and ultimately not even really useful or required for mill operations.

I haven't read the Bosch manual enuf to know whether it allows this dual mode strategy, my Allen Bradley drive does and I've seen it offered in other
makes as well and guess it is therefore standard fare for modern drives. If it is it would allow you to get simple speed control running and then put
your thinking cap on for the indexing mode. I doubt you will need anything like the max speed of the spindle when indexing and so when you 'gear it
down' (electronically speaking) you don't have to sacrifice resolution hugely and yet still end up with a pulse rate that means you don't have to be an
RF/ High Speed Digital engineer to get it to work.

Craig
Hi again Craig.
I looked in to the solution of driving the servo in analog interface but i am kinda lost, since i am a novice to this. In my manual i can see that via a potmeter to ired 1and 2 i can control torgue or in jogmode velocity and then it says analog signal to e1 and e2. Now it seems you are an expert in this so i hope you have paitience enough to explain to me how i setup this analog mode.
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 03, 2017, 07:14:28 AM
Hi,
if you require your spindle to do indexing operations then you need to use position control per section 6 in the manual. 'Position
with Following Error' is the right dynamics mode (sounds and vibes) and on the screen on page 6.3 the right choice is about 4000 pulse
per rev.

If you just want to get your spindle going and make some chips then you use section 7 Drive Control with Analogue Interface. On the screen on
page 7.2 you can set the voltage, offset and speed that you wish. Note that at no time do you need to set the 'pulse per rev' that's required
for position control not speed control.

Just as an aside this servo doesn't have an encoder at all, it has a resolver, a very VERY groovy technique from
analogue days, makes me come over all misty eyed! The pulse per rev setting is actually a programmatic setting for the 'Resolver to Digital' converter
in the drive. Thats how Bosch managed to achieve what is to all intents and purposes a programmable resolution encoder...CLEVER!

Anyway back to analogue speed control....with the settings made per 7.1 and 7.2 all that is now required is to enable the drive and apply a voltage.
To enable the drive (fig 10.56 page 10.54) apply +24VDC to pin 1 X4 with 0V pin 4 X4 and have your BoB or even a short bit of wire apply 24V to pin 3 X4.
Lets for the moment imagine that you selected 10V as max command value and 2000 rpm as max commanded speed. For the moment assume 0V offset.
If you apply 5V between pins 1 and 2 connector X3 per page 7.3 then the servo will run at half speed, ie 1000 rpm. Apply 1V and it will run at 1/10 full speed ie 200 rpm.
The voltage applied could come from PWM from Mach via a low pass filter on your Bob or even easier from a potentiometer hooked to your drive.
Some PWM don't actually quite get to 0V, some hang up about one diode drop above earth at 0.7V. If your PWM is like this use the offset of 700mV
to counteract it. A potentiometer should get to 0V so the offset can be 0mV.

Given how simple having a potentiometer is you should probably have a go just to prove to yourself that you can. On page 7.4 is a circuit diagram of the analogue
input. Note that it says a max of 15V input, DON'T exceed it or will blow it up. Ideally you would get a 10 or 12V regulated DC supply or if you want spindle to go
backwards a -12V, 0V, +12V supply. Why  would you want to go backwards though? You'll need a potentiometer, anywhere between 1 kOhm to 10 kOhm  will be
fine, 10 kOhm is a bit like an arsehole...everyones got one! Hook one of the outside pot terminals to +10V, the other outside terminal to 0V AND pin 1 X3. The centre
pot terminal to pin 2 X3 and the servo should run. If it seems to be going backwards swap the connections between pins 1&2.

Craig
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 03, 2017, 07:25:25 AM
Hi,
if you require your spindle to do indexing operations then you need to use position control per section 6 in the manual. 'Position
with Following Error' is the right dynamics mode (sounds and vibes) and on the screen on page 6.3 the right choice is about 4000 pulse
per rev.

If you just want to get your spindle going and make some chips then you use section 7 Drive Control with Analogue Interface. On the screen on
page 7.2 you can set the voltage, offset and speed that you wish. Note that at no time do you need to set the 'pulse per rev' that's required
for position control not speed control.

Just as an aside this servo doesn't have an encoder at all, it has a resolver, a very VERY groovy technique from
analogue days, makes me come over all misty eyed! The pulse per rev setting is actually a programmatic setting for the 'Resolver to Digital' converter
in the drive. Thats how Bosch managed to achieve what is to all intents and purposes a programmable resolution encoder...CLEVER!

Anyway back to analogue speed control....with the settings made per 7.1 and 7.2 all that is now required is to enable the drive and apply a voltage.
To enable the drive (fig 10.56 page 10.54) apply +24VDC to pin 1 X4 with 0V pin 4 X4 and have your BoB or even a short bit of wire apply 24V to pin 3 X4.
Lets for the moment imagine that you selected 10V as max command value and 2000 rpm as max commanded speed. For the moment assume 0V offset.
If you apply 5V between pins 1 and 2 connector X3 per page 7.3 then the servo will run at half speed, ie 1000 rpm. Apply 1V and it will run at 1/10 full speed ie 200 rpm.
The voltage applied could come from PWM from Mach via a low pass filter on your Bob or even easier from a potentiometer hooked to your drive.
Some PWM don't actually quite get to 0V, some hang up about one diode drop above earth at 0.7V. If your PWM is like this use the offset of 700mV
to counteract it. A potentiometer should get to 0V so the offset can be 0mV.

Given how simple having a potentiometer is you should probably have a go just to prove to yourself that you can. On page 7.4 is a circuit diagram of the analogue
input. Note that it says a max of 15V input, DON'T exceed it or will blow it up. Ideally you would get a 10 or 12V regulated DC supply or if you want spindle to go
backwards a -12V, 0V, +12V supply. Why  would you want to go backwards though? You'll need a potentiometer, anywhere between 1 kOhm to 10 kOhm  will be
fine, 10 kOhm is a bit like an arsehole...everyones got one! Hook one of the outside pot terminals to +10V, the other outside terminal to 0V AND pin 1 X3. The centre
pot terminal to pin 2 X3 and the servo should run. If it seems to be going backwards swap the connections between pins 1&2.

Craig
great Craig
i will go and try it out just for the fun of it. think i will make the final decision when i also have tried the step mode with the smoothstepper.
I can't say this enough. i apriciate your help so much. if all people were like this the world would be a better place..
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 03, 2017, 07:42:16 AM
Hi,
nice of you to say but you haven't met me...easy to be nice over the internet...but you may want to shoot me in real life.

Craig
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 03, 2017, 09:10:06 AM
Hi,
nice of you to say but you haven't met me...easy to be nice over the internet...but you may want to shoot me in real life.

Craig
haha yeah that´s right. It´s just nice to have people who offers their own time to help other. Hope i some day can repay, by helping other who needs my knowledge.
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 03, 2017, 09:30:45 AM
Hi,
nice of you to say but you haven't met me...easy to be nice over the internet...but you may want to shoot me in real life.

Craig
I can´t find anything about the input terminals construction. Do you know if they are galvanic isolated either with buffer or optocoupler, so i can go direct to the driver without any bob
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 03, 2017, 12:01:08 PM
Hi,
if you require your spindle to do indexing operations then you need to use position control per section 6 in the manual. 'Position
with Following Error' is the right dynamics mode (sounds and vibes) and on the screen on page 6.3 the right choice is about 4000 pulse
per rev.

If you just want to get your spindle going and make some chips then you use section 7 Drive Control with Analogue Interface. On the screen on
page 7.2 you can set the voltage, offset and speed that you wish. Note that at no time do you need to set the 'pulse per rev' that's required
for position control not speed control.

Just as an aside this servo doesn't have an encoder at all, it has a resolver, a very VERY groovy technique from
analogue days, makes me come over all misty eyed! The pulse per rev setting is actually a programmatic setting for the 'Resolver to Digital' converter
in the drive. Thats how Bosch managed to achieve what is to all intents and purposes a programmable resolution encoder...CLEVER!

Anyway back to analogue speed control....with the settings made per 7.1 and 7.2 all that is now required is to enable the drive and apply a voltage.
To enable the drive (fig 10.56 page 10.54) apply +24VDC to pin 1 X4 with 0V pin 4 X4 and have your BoB or even a short bit of wire apply 24V to pin 3 X4.
Lets for the moment imagine that you selected 10V as max command value and 2000 rpm as max commanded speed. For the moment assume 0V offset.
If you apply 5V between pins 1 and 2 connector X3 per page 7.3 then the servo will run at half speed, ie 1000 rpm. Apply 1V and it will run at 1/10 full speed ie 200 rpm.
The voltage applied could come from PWM from Mach via a low pass filter on your Bob or even easier from a potentiometer hooked to your drive.
Some PWM don't actually quite get to 0V, some hang up about one diode drop above earth at 0.7V. If your PWM is like this use the offset of 700mV
to counteract it. A potentiometer should get to 0V so the offset can be 0mV.

Given how simple having a potentiometer is you should probably have a go just to prove to yourself that you can. On page 7.4 is a circuit diagram of the analogue
input. Note that it says a max of 15V input, DON'T exceed it or will blow it up. Ideally you would get a 10 or 12V regulated DC supply or if you want spindle to go
backwards a -12V, 0V, +12V supply. Why  would you want to go backwards though? You'll need a potentiometer, anywhere between 1 kOhm to 10 kOhm  will be
fine, 10 kOhm is a bit like an arsehole...everyones got one! Hook one of the outside pot terminals to +10V, the other outside terminal to 0V AND pin 1 X3. The centre
pot terminal to pin 2 X3 and the servo should run. If it seems to be going backwards swap the connections between pins 1&2.

Craig
So now it is setup and tested. It works perfect, but then another issue turned up. The jog feature does not work in analog speed mode. This means that when i stop the spindle with enable still active the motor brakes with torque and if i disengage enable switch, then the 24v motorbrake is active,,,darn.
Yet one more issue. When set to spin manually with only a potmeter, the motor stops so hard when start is disabled, that the chuck unscrews and falls off.

It is also very sensitive about the tuning of the offset. i have found my zeropoint at -0.15mv any diffeerence in either way makes the spindle turn either cw or ccw. Quite funny that i can get CCw at full speed just by setting this offset at -10v.
This was a little update and as usual with a few questions as well... Have a greeeat sunday everyone

Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 03, 2017, 02:21:06 PM
Hi,
when you disable the servo it stops at its max acceleration. You can set that....although why you would set it less than its capable of...you have
paid for all that luvly grunt and now you don't want it?

The offset must be perfect if you expect it to stop. In your lathe you will use the disable pin under Machs control to stop.

I think you can program the brake so that it doesn't come on when the drive is disabled. When disabled you should be able to jog, when enabled
it is in primary control mode and it ignores jog which is its secondary control mode as per previous post.

Craig
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 03, 2017, 02:51:54 PM
Hi,
when you disable the servo it stops at its max acceleration. You can set that....although why you would set it less than its capable of...you have
paid for all that luvly grunt and now you don't want it?

The offset must be perfect if you expect it to stop. In your lathe you will use the disable pin under Machs control to stop.

I think you can program the brake so that it doesn't come on when the drive is disabled. When disabled you should be able to jog, when enabled
it is in primary control mode and it ignores jog which is its secondary control mode as per previous post.

Craig

somewere in the manual it says that jog is only available in step and position mode. so i think i have to use the software to go back to syepmode before jog is an option again. I haven't seen any program option in the software were i can do anything to either brake or toeque. Torque can only be worked with if i choose analog torgue instead of analog speed.
If you do not have a solution i guess i have to overcome this with a switch on the power cord to the brake and then put it in stopmode so the torque is 0.
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 03, 2017, 02:54:11 PM
Hi,
look at 'Torque Limits' on page 10.7. You can set the max torque by setting or you can use an analogue setting per fig 10.8.

The analogue setting could be under Mach PWM control which would allow you to have variable torque limits depending on current requirements.

Craig
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 03, 2017, 03:01:13 PM
Hi,
when you get your ESS and get it set up in step/dir mode per your original plan then all of this becomes meaning less. You will not have to disable
the drive to get it to stop...just have Mach stop iussing step pulses and the brake will never come on. Likewise you will be able to jog from Machs
screen, you won't have to go anywhere near the drive.

The point of setting it up in analogue it simply that you could experiment and learn something about your drive and servo. Have you learnt some
new stuff?. I bet you have and if so the hobby is succeeding.

Craig
Title: Re: AC servomotor calibration problem
Post by: Bentus66 on September 03, 2017, 03:21:09 PM
 :) yeah i am sitting here with a big smile, yup i am learning and you are right it gets meaning less, but i got caught up in this and just want it to be perfect in case the noise issue in stepmode continues. Yes hobby it is and great when it becomes a succes.

you asked why i didn´t want all that grunt. The anser is my jaw chuck is screwed on the spindle and there is no lock so if the spindle stops in an instant the jaw chuck continues and result is a chuck running over the floor.

I read this manual like 15 times but much is just going right thru without any understanding until you point me in the right direction and explains were, what and how. Then things starts to be understood.

Thanks Craig and now i think i have to let you rest before you give up on me haha. I will play a little tomorrow with what you just told me and then wait for the board. I´ll be back with info on how everything went.
Title: Re: AC servomotor calibration problem
Post by: joeaverage on September 03, 2017, 04:43:50 PM
Hi,
kool, I thought you might have a smile.

While it may be a bit agressive at start up and slow down you really want all that torque at other times. When cutting
the cutting forces slow the spindle sown and you want the torque of the servo to bring it up to speed again.
The last thing you want to do is imasculate it stop the chuck from coming off.

Remeber under step/dir control the speed up and slow down will be controlled by Mach that you set in Motor Tuning
and when at constant speed the drive and servo can utilise max torque to do it, perfect.

My servo doesn't have a brake. My understanding is that the brake is normally on so that if the power is suddenly
removed or the drive goes into emergency shutdown then the brake comes on. You need to power the brake coil in
order to release it and spin the spindle. A simple test is remove the input power to the drive, does the brake activate?
If it does then you will have to permanently power the brake coil in order to avoid the brake from interfering.
Look in the brake section for the circuit diagram, I'm at work and don't have the manual here.

Craig