Go Down

Topic: PWM and 4-wire stepper motor. (Read 3953 times) previous topic - next topic

Qwseyvnd

How to use one PWM for 4-wire stepper motor ?

Regards from Qwseyvnd.

Robin2

Why would you want to use PWM for any stepper motor?

Stepper motors need steps.

What stepper motor driver are you using? Most of them just need a step and direction connection to the Arduino and these two lines of code should produce a single step

Code: [Select]
digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);


...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Qwseyvnd

Brushless stepper motor same as floppy disc motor.
I want to use PWM to give an amount of electric to let it run fast as the airplane in X-plane runs; so easier if high PWM = fast, low PWM = slow. It is about to measure km distance and speed to the waypoint; it is about count miles decreasing to the waypoint so fast the airplane running.

Qwseyvnd

#3
Oct 17, 2014, 09:36 pm Last Edit: Oct 17, 2014, 09:39 pm by Qwseyvnd Reason: 1
My point is that I want a smooth motor that does not stop each increment. It is brushless if I am correct.

If I control a gear DC electric motor with PWM which necessary to provide speed. But I need to count steps it has passed first with each miles, then each 10x miles, then each 100x miles with analog input.
Is that a better idea ?

Robin2

You need to do some reading - wikipedia has useful stuff about stepper motors.

It is correct that stepper motors are brushless motors but they have almost nothing in common with brushless DC motors such as are used to power model airplanes.

PWM has nothing to do with stepper motors.

Maybe if you describe what you want the motor to do we could help.

Quote
My point is that I want a smooth motor that does not stop each increment.

Stepper motors don't stop after each step but at slow speeds the steps will be noticeable and they cannot run at very high speeds. Also they are very inefficient.

Stepper motors are normally used where it is important for the Arduino to be able to command them to move an exact number of steps.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

tylernt

Steppers can be made to move more smoothly by micro-stepping. Micro-stepping is basically two sine waves out of phase, which can be synthesized by varying the PWM duty cycle.

http://softsolder.com/2011/05/05/thing-o-matic-mbi-stepper-motor-analysis/

Qwseyvnd

One revolution = 10 km
Max 22.5 km each minute / 1350km per hour.
There must be something that can run the motor smooth without steps.

Qwseyvnd


Steppers can be made to move more smoothly by micro-stepping. Micro-stepping is basically two sine waves out of phase, which can be synthesized by varying the PWM duty cycle.

http://softsolder.com/2011/05/05/thing-o-matic-mbi-stepper-motor-analysis/


Do you mean use 1-3 outputs with PWM to control smooth ?

Robin2

#8
Oct 18, 2014, 12:41 pm Last Edit: Oct 18, 2014, 12:43 pm by Robin2 Reason: 1

Do you mean use 1-3 outputs with PWM to control smooth ?


Read my lips --- no Arduino PWM, anywhere.

Most stepper motor driver boards can be set to use different levels of microstepping - for example 1/2, 1/4, 1/8 and 1/16. The stepper driver board figures out how to make that happen. The Arduino just sends step pulses.

When you use microstepping the torque of the motor is reduced because the microstepping is achieved by using the coils to pull against each other.

1350 km/h is not slow - I think it is close to the speed of sound. Are you sure you have your units correct?

I can't figure how one revolution can be 10 km. That implies a wheel that is over 3 km in diameter.

Tell us what you are actually trying to do

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

tylernt

Do you mean use 1-3 outputs with PWM to control smooth ?


If you're building your own stepper driver with discrete transistors, you'd need either 4 PWM outputs, or, two PWM outputs plus another couple of pins to control polarity (stepper windings have to be driven both directions).

But as Robin2 points out, most people use a stepper driver and so you don't have to worry about PWM -- the driver does that for you.

Qwseyvnd



Do you mean use 1-3 outputs with PWM to control smooth ?


Read my lips --- no Arduino PWM, anywhere.

Most stepper motor driver boards can be set to use different levels of microstepping - for example 1/2, 1/4, 1/8 and 1/16. The stepper driver board figures out how to make that happen. The Arduino just sends step pulses.

When you use microstepping the torque of the motor is reduced because the microstepping is achieved by using the coils to pull against each other.

1350 km/h is not slow - I think it is close to the speed of sound. Are you sure you have your units correct?

I can't figure how one revolution can be 10 km. That implies a wheel that is over 3 km in diameter.

Tell us what you are actually trying to do

...R

I can't read your lips because I am deaf. It's truth.
10 km is a measure of each revolution. I am trying to building a km counter decreasing to the waypoint or ahead while increasing.

Let me explain in detail.
I am trying to building, actually origin is electromechanical method, a navigation system NV-PB of Il-62 as it should be.
http://www.airliners.net/photo/Aeroflot/Ilyushin-Il-62/1084218/L/&sid=c9f75636cddb578ae623461791afdbe3
This, you might see eight big counters.
#1 is heading position while the airplane moving
#2 is Y coordinate position
#3 is X position
#4-6 same but the next waypoint then moves to #1-3, then #4-6 and so on.
#7-8 is to store the next waypoint in X and Y coordinate.
#1 and 4 heading positions must be set manual.
The dark grey four boxes is for VOR or RSBN correction.

The very big black box upper panel is to store both SID and STAR or just SID or STAR, or some waypoints ahead a thunderstorm.

etc.

Robin2



I can't read your lips because I am deaf. It's truth.

Perhaps you would like to reconsider the logic of this sentence


Quote
10 km is a measure of each revolution. I am trying to building a km counter decreasing to the waypoint or ahead while increasing.


The information you are giving us as been very misleading.
Nothing is moving 10  km per revolution.
It is a simulation of an analog instrument. It doesn't matter what units are printed on the dial - they could be mm or light-years.
All that matters to the Arduino (and the stepper motor) is how many steps it needs to take.

Now that we know you are trying to simulate an instrument can you please describe what your project needs to do.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Qwseyvnd

OK.

I am building one home cockpit; Ilyushin Il-62 (not M model but maybe M anyway). Maybe it is better I am making one blog homepage that describes everything I am doing while I am doing this.

Robin2


I am building one home cockpit; Ilyushin Il-62 (not M model but maybe M anyway).

This hasn't advanced our understanding very far so I don't know what help you want.

Quote
Maybe it is better I am making one blog homepage that describes everything I am doing while I am doing this.


Feel free to write a blog but be aware that I am lazy and I am only going to give advice here and I am not going to read a blog to get information that should be posted here.

However if you post specific questions here I will try to help.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Qwseyvnd

OK, I will now trying to draw something in GIMP.

Go Up