HOW CAN I CONTROL STEPPER MOTOR?

 

I need to control 2 stepper motors via driver with Industruino. I have a well design software that was made for mega which use AccelStepper. So does anyone know how to modify Accelstepper so that its outputs (Step and Direction) go to the output screw terminal with serial comunication using Indio.h library?

Or does anyone know how to control a stepper motor via driver (Step/Dir) ?

   

Francesco Benasso
Francesco Benasso
7
| 2 1 1
Asked on 9/15/16, 7:43 AM
0
vote
4414 Views
I definitelly agree with you. I cheked the datasheet and I found that the maximum switching frequency of digital output is 400Hz. In order to use the stepper motor I need to produce a square wave (10% duty cycle) form 1khz to 3khz. So that means that the Indio.digitalWrite() is pretty unusefull. Do you agree with what I said above? I came up with this design: I'll use each  Analog Output to produce a  voltage that is going to pilot the voltage input of a VCO. The Voltage Controlled Oscillator (with 3 Opamp because the 555 would be unusefull) is gonna produce a square wave for the step pin of the stepper motor driver. I won't have a perfect control of the position but it should work. My goal is  costant speed and stepper should be better that dc motor

Inviato da iPhone

Il giorno 16 set 2016, alle ore 11:01, Stefano Ariel Bonvini <bonvini@industruino.com> ha scritto:

Hello, two issues: 1) you mention serial communication, but I guess you are not saying that your driver has a serial input, right? 2) the signal level for step and direction input of the driver is 5V or 3.3V Using Indio you will need to adjust that with a resistor network.. Surely it is possible to change Accelstepper in order to use Indio, but I would rather use two pins from the 14-pin connector. If I remember well, D2 and D3 are available, which are regular Arduino pins and not Indio pins. If you choose to modify Accelstepper, go to the library folder and make a copy of the library named IndioStepper. Then the procedure is quite simple: - include in Indiostepper.h - open IndioStepper.c, which looks quite like an Arduino program - find the reference to step and direction pins - switch it to the proper Indio outputs - Include IndioStepper in your software

--
Stefano Ariel Bonvini
Sent by Industruino using Odoo about Forum Post HOW CAN I CONTROL STEPPER MOTOR?
Francesco Benasso
on 9/16/16, 4:01 PM

Hello, two issues: 1) you mention serial communication, but I guess you are not saying that your driver has a serial input, right? 2) the signal level for step and direction input of the driver is 5V or 3.3V Using Indio you will need to adjust that with a resistor network.. Surely it is possible to change Accelstepper in order to use Indio, but I would rather use two pins from the 14-pin connector. If I remember well, D2 and D3 are available, which are regular Arduino pins and not Indio pins. If you choose to modify Accelstepper, go to the library folder and make a copy of the library named IndioStepper. Then the procedure is quite simple: - include in Indiostepper.h - open IndioStepper.c, which looks quite like an Arduino program - find the reference to step and direction pins - switch it to the proper Indio outputs - Include IndioStepper in your software

Stefano Giuseppe Bonvini
Stefano Giuseppe Bonvini
107
| 4 1 3
Answered on 9/16/16, 9:02 AM
0
vote

You can measure that with a simple stepping demo using micros() before and after each action.

Anyhow the output chip of Ind I/O is a I2C chip that can also be directly controlled.
I don't think the time should be very long though.

If the end result does not fit your purpose, or the time spent in adaptations is too long, you have only two ways:

- using the 14-pin connector pins

- rewrite your software

There's also another issue in modifying a library that makes it less appealing:

After modify you are on your own, no support and no update will be given by anyone.
Actually, make sure you rename your library as I told you, otherwise the next update will erase your changes.
 

Stefano Giuseppe Bonvini
Stefano Giuseppe Bonvini
577
| 2 0 2
Answered on 9/16/16, 8:58 AM
0
vote

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

30 follower(s)

Stats

Asked: 9/15/16, 7:43 AM
Seen: 4414 times
Last updated: 9/16/16, 4:11 PM