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) ?
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
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.
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!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 9/15/16, 7:43 AM |
Seen: 4487 times |
Last updated: 9/16/16, 4:11 PM |
Inviato da iPhone
Il giorno 16 set 2016, alle ore 11:01, Stefano Ariel Bonvini <bonvini@industruino.com> ha scritto: