Stepper motor control

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Checked the inputs with an oscilloscope... umm strange.. they seem fine
(2-phase full step)

(Due to the garbage Wifi I am using, I cant upload the oscilloscope images)

EDIT: I tried to check the output in a oscilloscope while debugging it with a pickit3 (big news, I dont know how to use an oscilloscope correctly) and the results were depressing.

For some reason the outputs in A and B are ...the same!!! and only change from 2V to garbage.
On the same note the outputs in ~A and ~B are also the same!!! and they change from 24V to oscillating garbage that goes to 36V at max!

question:

1) Have i broken the motor??? (due to the 36 V)

2) what the thing is happening??! Is the voltage divider not cutting the voltage correctly when the current goes up???

I am now going to change to a program with wave drive (full step) to see the results but I have no hope...
 
Last edited:

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Here the results of the inputs (correct):
1_003.png
EDIT: I just realize they are not correct :(... inputs A and B are on a different scale... no wonder the outputs are not correct either...
and an example of the awful results in the outputs

the awful results
View attachment 86401
 
Last edited:

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
the awful results
2_000.png

EDIT: I programmed the Wave drive, and checked it with an osciloscope. It also seemed awful but for some reason when I stopped debugging it, and just run it, it worked.
So now the motor is moving with the wave drive. Meaning when only one coil is magnetized the motor moves. But when two are magnetized (as in AB) it does not...

Does it sound familiar to any of you???

Btw, do motors get broken if they are set for 5.9V, designed to be run with 24V but 40V are being applied to them??
 
Last edited:

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
I would really appreciate if someone could help me, even with ideas, or insights or advice

Right now, I corrected the inputs. They are going fine, and wave drive
4_000.png


As an output I got the following:
4_001.png

So for example when I activate B (A, ~A, and ~B=0) I got the following
Output:
A: 21.8V~25V (almost just 24V)
~A: 22V~26V (almost just 24V)
B: Huge changes between 2.4V to 34.2V
~B: Huge changes between 13.2V and 50.8V

Is this normal? Is this flickering due to PWM?? should I adjust the voltage divider? Or the RC circuit that so far I dont know what for is it?

Strangely enough the motor seems to be moving correctly.. so I guess it is working?? Am I overapplyign current to the coils??

What are the supposed correct values of the outputs A ~A B ~B anyway??.

Any thoughts? Any help? Please
 
Last edited:

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Well I tried full stepping and the results were catastrophic... Whenever I put AB or A~B only A or ~A or B got activated. ~B never got activated. And never more than one coil got activated. I am stuck... what can be the reason of this??
5_000.png
Any help would be greatly appreciated. I dont know how to advance from this point :(
 

Sensacell

Joined Jun 19, 2012
3,786
Be aware that stepper motors can have mechanical resonances that can drive you nuts.
There are some combinations of rpm, drive type and current level that excite torsional resonances that cause the motor to stall, or not rotate at all.

How many steps per revolution is your motor? Large angle motors are more trouble in this regard.
1.8 degree motors can be resonant at high rpm and just stop.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Be aware that stepper motors can have mechanical resonances that can drive you nuts.
There are some combinations of rpm, drive type and current level that excite torsional resonances that cause the motor to stall, or not rotate at all.

How many steps per revolution is your motor? Large angle motors are more trouble in this regard.
1.8 degree motors can be resonant at high rpm and just stop.

Thank you for your reply.
My motor step angle is 1.8 degrees per step so I suppose 200 steps per revolution?

I ve done some experiments without a IC, and manually entering input signals.
It was explained to me that when A gets activated ~A also reflects some voltage (both outputs) like a transformer. I am ok with that.
But what I have found is the following:

1) A, ~A, B and ~B are inverted. (A is ~A, B is ~B) . I swear I have checked and the connections are like the datasheet but this is how it is working.
2) Perhaps I am applying too much Vref??? The datasheet says that the limit is 2V. I suspect that I am applying through the voltage divider just 2V and with fluctuance it can reach a little more (EDIT: No, I am applyting only 0.7V but that translates to the limit current 0.7A)
3) strinkingly two signals can not be applied together (as in full step or half step). That is why wave drive works. When I apply:
AB A wins
~AB ~A wins
A~B A wins
~A~B ~A wins

"win" meaning that only that output got activated. Be aware that for example if I am in AB (A winning) and I disconnect A then B gets activated immediately. Only very rarely both outputs can be activated and for a little short time

the even more strange thing is that the other coil gets voltage! (as it should be ) but not the main coil.

I will now try to reduce the Vref to see what happens. could this be the cause...

EDIT; reducing the Vref didnt help. it didnt move the motor
 
Last edited:

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
I have to report that the motor is running fine. I solved the problems.

I also understood what the RC circuit was for !:p

Quick and simple question though:

Is it normal for a motor to get hot??
 
Last edited:

Sensacell

Joined Jun 19, 2012
3,786
Stepper motors are very energy inefficient, typically consuming more power standing still than running full speed!
The coil current always flows creating significant heating, moving or not.
 

shortbus

Joined Sep 30, 2009
10,049
Stepper motors are very energy inefficient, typically consuming more power standing still than running full speed!
The coil current always flows creating significant heating, moving or not.
This is why many of the big name drivers have a form of sleep mode. A low but still active output when movement is not active.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
For future readers, what was the solution?
It was very simple, silly almost. Originally I was planning to implement everything on a breadboard but was cautioned to put the 24V parts separated. So I put that on a board and the rest of circuitry on a breadboard. Which does not work. I had to put almost everything soldered very near to the driver (only left the PIC on a breadboard) and the problems went away.

Of course I solved other problems as well but that was basically what made it work
Thanks again

btw, any comment on the heat of the motor? :)
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Hello
I would really appreciate if someone can advice me, comment or give any idea to my situation here.

After some time dedicated to other projects, I am doing steppers again. This time with a different but similar controller.
I have reprogrammed my stepper motor control. This time it uses timers, etc. Due to this I can easily stop the motor by just deactivating the timer When I activate the timer (well it really is a ticker) it repeatedly calls its sequence.

I have done quite a lot of work. Different than before I incorporated not only speed but also acceleration and deceleration. Tested it and for example it gives something like:

But I want to test it profusely. So I find a problem and that is my question

What can you tell me about "ramping up a stepper"?

The situation is as follows:
One thing I notice (and it is important for my later question) Whenever I log delays (like the above graph) the stepper gets slower. I suppose it is obvious. Without logging it goes to its original speed.

So to test it further, I did the following:

  • Set the speed to 300 rpm
  • NO acceleration
  • move to position -600 (3 revolutions counterclockwise)
  • when stopped
  • move to position -300 (one and a half clockwise)
  • repeat
And it failed to move! The motor just got stucked.

Notice that this error does not happen if I do any of the following:
  1. Log the sequence of steps it is having (motor gets slower) or
  2. make both moves in the same direction or
  3. Set an initial acceleration
I was perplexed. I tried to reproduce the error with logging to see what was going wrong but as you see it did not reproduce.

Then after a lot of thinking I slowed the speed of the motor: And it moved!!!
So my conclusion is that a stepper motor can not move to a high speed (like 300rpm) all of a sudden. If I try to do that it gets stucked

I have to either reduce the speed of the sudden start or go to that high speed little by little (with acceleration).

Under this theory , I cant explain why it did work when it was both on the same direction.

Is my reasoning ok? Do steppers have a speed limit to which they can move all of a sudden. Do professional algorithms for moving steppers use acceleration by all means?? What is ramping up a stepper?

Thank you very much for any comments in advance
 

Papabravo

Joined Feb 24, 2006
22,084
A stepper motor typically has two resonances, a mechanical one and an electrical one. The mechanical one depends on the moment inertia of the rotor and the load. It typically occurs at around 200 steps per second. The second one is electrical and occurs at around 5000 steps per second. If you ramp the velocity up you can pass through the mechanical resonance without difficulty. You also have to ramp the velocity down. The electrical resonance occurs because the motor runs out of torque at high speed, like all motors do, and there is nothing you can do about that one.
 

Sensacell

Joined Jun 19, 2012
3,786
The movement of a stepping motor is ALL ABOUT the input pulse train.

If you feed it a simple pulse train, the motor must accelerate almost instantly from zero speed to the speed of the pulses, this can cause the motor to stall and not move. If the pulse frequency is low enough, the motor can accommodate, but to gain any useful speed, you will need to have the pulse frequency ramp-up to smoothly accelerate the motor. The software to do this while keeping track of the position is called an "indexer", an indexer can create "moves" that generate exactly the correct number of pulses required to move the motor from A to B while smoothly controlling the speed - to maximize the performance.
 

MaxHeadRoom

Joined Jul 18, 2013
30,697
The Picmicro Mechatronics board features might help, it includes software in C for both stepper and DC brushed, you can download the software and see the board schematic used from Microchip site.
(even has Gerber files for the board)!
Max.
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Thanks.
So basically "ramping up" means smoothly accelerate the motor?

An indexer? Well then I just built an indexer!:rolleyes:.

The movement of a stepping motor is ALL ABOUT the input pulse train.

If you feed it a simple pulse train, the motor must accelerate almost instantly from zero speed to the speed of the pulses, this can cause the motor to stall and not move. If the pulse frequency is low enough, the motor can accommodate, but to gain any useful speed, you will need to have the pulse frequency ramp-up to smoothly accelerate the motor. The software to do this while keeping track of the position is called an "indexer", an indexer can create "moves" that generate exactly the correct number of pulses required to move the motor from A to B while smoothly controlling the speed - to maximize the performance.

A stepper motor typically has two resonances, a mechanical one and an electrical one. The mechanical one depends on the moment inertia of the rotor and the load. It typically occurs at around 200 steps per second. The second one is electrical and occurs at around 5000 steps per second. If you ramp the velocity up you can pass through the mechanical resonance without difficulty. You also have to ramp the velocity down. The electrical resonance occurs because the motor runs out of torque at high speed, like all motors do, and there is nothing you can do about that one.
Thank you for your reply. I have the specs of torque of the motor and others in the lab. (right now on holiday:D). I will post it here hoping that I can be taught about its meaning
 

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Hello

I would really appreciate some help here.

The specs of my motor says:

Inductance 8.2 mH ref
Holding Torque 340 mN.m at 0.7A/Phase 2 phase ex
Pull out torque 240 mN.m (min) at 1600pps (=240 rpm)
Pull out torque 200 mN.m (min) at 2133.3 pps (=320 rpm)
Pull in rate 1400 pps (min) at 1-2 phase ex
Pull out rate 2500 pps (min) at 1-2 phase ex

position accuracy +- 10 % at 2 phase ex

etc.

With these specs... how can I calculate the max speed or acceleration that I can have with this motor??
 
Top