Controlling stepper using PWM?

Hi!
I have been searching for a way to convert a pwm signal to step/dir but have not
been able to find something.
Does anyone know if there already is a code available for this or even a finished
product that solves my problem.

Here is my problem:
I want to control a stepper (driver) or possibly a servo with step/dir signal but I need
to do it using a RC radio and if I am not wrong it is using PWM.

I would really appreciate if someone had a solution or could point me in the right direction.

Thanks!

EDIT: All I want is to be able to run the motor both directions and at different speeds.
I don´t need to position the motor or have precise control.

There is no direct relationship between the RC signal and the control signals for a stepper motor. You will need code to interpret the RC signal and then use that information to make appropriate step and direction signals.

You don't control servos with step and direction signals and, most likely, the RC signal can control the servo directly.

Your second Post suggests that a simple DC motor might be more appropriate.

Your question is a bit confusing. What exactly do you want to achieve?

You may find some useful stuff in stepper motor basics.

...R

You can have the arduino read the signal intended to command a servo from your RC receiver - look for posts by Johnredearth - he's using the technique to do additional processing on the RC signals so he can control an RC submarine.

Once you have the servo signal, you can use the accelstepper library to set speed & direction.

Gadjimoj:
EDIT: All I want is to be able to run the motor both directions and at different speeds.
I don´t need to position the motor or have precise control.

You can use pulseIn() to read a RC PWM signal and then use those values to drive
some code using Stepper or AccelStepper libraries perhaps...

Hi again and sorry for the delay, I though I would get an email upon replies to my thread.
I know that I don´t control a stepper directly using step/direction this way since it gives me the choice to chose a driver that fits my needs/current.
I found this really cool servo unit Simplex motion
that would be perfect if I only could control it.

If I am correct I can drive this unit the same way using step/dir which would be perfect.
The problem is that my programming skill is very limited so I was hoping that this problem has been solved before and that I could find the program and wiring for it.
Sorry for being a total noob. :frowning:

Gadjimoj:
I found this really cool servo unit Simplex motion
that would be perfect if I only could control it.

As far as I can make out from your questions your problem is not “how to control it” but “how to gather the data that is used to decide how to control it”

If you can get the data from your RC system then you can use that information to control anything - servos, steppers or that expensive looking Simplex Motion. And you will have to look on the Simplex motion website to figure out how to control their system. As far as I can see you need their driver unit and their motors.

…R

I might be on thin ice here but I think the controller is integrated and that it´s possible to
control it with step/dir using one of the inputs, no? :confused:
I think the cost for a unit is about $350, it doesn´t sound terrible to me.
I might be able to have someone help me with this, I guess it´s not a very hard for someone with the
experience but to me it´s not that easy.

Thanks for all the support, I might post a solution if I can find one. :slight_smile:

Gadjimoj:
I might be on thin ice here but I think the controller is integrated and that it´s possible to
control it with step/dir using one of the inputs, no?

Have you studied the manufacturer’s datasheet?
You can’t expect an answer from someone here unless you post a link to the datasheet.

…R

I included a link in my last post.
Simplexmotion
Datasheet

Gadjimoj:
I included a link in my last post.
Simplexmotion
Datasheet

There is an awful lot of reading in that datasheet.
Perhaps you can summarize it to save me the trouble?
Or at least point me to the paragraph you need help with?

...R