I am working on a project in which i have a robot working with stepper motors. I wish to control this robot with simulink. How can i convert the input( Analog sin input ) into the PWM that can be used as input for the system???

The Robot is Arduino2560 Based.

  • $\begingroup$ You need to give us more information first. I guess, your "analog sin input" means the sinusoidal voltage curves that you would feed into your stepper motors. Do you want to implement your own stepper motor drivers? Usually, one uses a stepper driver which has an input for "direction" and "step" and does not need any PWM, but a digital input signal.... Please describe in more detail (1) how the motors are connected to your Arduino2560 board, (2) what the "input" you are talking about means (e.g. give some example) and (3) what the produced result/motion should be. $\endgroup$
    – SDwarfs
    Commented Jan 9, 2018 at 18:24

1 Answer 1


Basic Comperator circuits/systems can be implemented. For example if your sin wave's frequency equals to some frequency value. You can compare it with another sin wave or a DC value and hence you can generate modifiable (via second input to Comperator) PWM signal.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.