I would like to connect a 4 wire stepper motor to an arduino nano carrier, the final goal being to use it with matlab. I found many inputs using external stepper drivers but nothing concerning stpper motor + arduino nano carrier.
Would be great if someone would have some experience with that!
Thanks for the link which wasn't in your initial email, and I'm afraid I'm not familiar with all the Arduino products. I didn't actually attach anything!
Without knowing more about the stepper it's hard to comment, but the drivers on the carrier are just H bridges so a lot of the sequencing needed to drive a stepper would have to be done either in the on-board microcontroller or your Nano. Are software libraries available for the on-board micro?
Dedicated driver chips are available for steppers, such as the DRV8825 or **34, which make life much easier.
The CNC shield v4 makes it very convenient to control up to 3 steppers with an on-board Nano. It also has provision for limit switches and other control signals. Add stepper drivers like the A4988 or DRV8825 (I prefer DRV8825).
No problems, I appreciate any help! Since it is not the main point for my project at the moment, I will have time to try to figure out a solution: as it is stated, that the nano motor carrier board can run 2 stepper motors, there is surely a way
Where?
I see only common H-bridges (MP6522) on that Nano shield.
Good for brushed DC motors, but a poor/impossible choice for most modern stepper motors.
It definately can't drive the 2.3ohm/1.5A stepper you linked to.
That motor needs a current controlled driver that can comfortably handle 1.5A coil currents.
Leo..
My goal would be to be able to use stepper motors in the matlab environment as described here:
[Connection to stepper motor on Adafruit Motor Shield V2 for Arduino - MATLAB - MathWorks Schweiz]
I supposed that there is a way to use 2 DC motors connections to control 1 stepper (independantly of the power for this particular case, just for the sake of understanding the possibilities of hardwares).
That Adafruit V2 motor shield is also not suited for modern low-impedance steppers.
The Nano and Adafruit shields can only drive high impedance stepper motors.
Common H-bridges with high-impedance steppers might be ok for what you're doing, Just don't expect torque at high speed. For that you need a low-impedance stepper and a current controled driver.
Leo..
I have used both drv8825 and drv8834 in projects and it's relatively trivial to write code directly to drive them. Why do you particularly want to use MATLAB, and what is the issue with microsteps?
I want to use Matlab since I need some advanced functions to determine what is the next step to perform (in my case, which mixture to realize through the activation of 2 syring pumps controlled by the stepper motors).
Another possibility would be for me to send the commands from matlab to arduino (eg.: "do 10 revolutions clockwise", but I'm not fit enough now to perform that.
At the moment, I have no particular issue, since nothing is connected
I ordered following, to give some trials:
Single Stepper Control Board A4988
Creality 42-40 Stepper Motor Nema 17
Would you be operating two pumps simultaneously at different speeds to get a given proportion or first one then the other? The first is tricky as you have to generate two simultaneous pulse trains at different rates, in effect coordinated movement.
This is what I intend to do, though the coordination doesn't need to be perfect, since I plan to measure the result of the mixture before using.
The syringe pump I'm using has a driver box, and in the worst case, after having setup the speed I would like to, I could control with a relay like ON/OFF. But it would be of course not as nice as doing it directly with the arduino
The application in which there is a need to coordinate different pulse trains at different speeds is CNC control, where for example if you go from a given point in 3D-space to another one at a given speed along the path, the X Y and Z speeds all have to be different, yet all the pulse trains have to end at the same moment. To complicate it further, controlled yet coordinated acceleration and deceleration is needed.
There is existing code for Arduino to do this called GRBL. Though designed for CNC it can be pressed into service for many other applications. In your case you could regard one pump as the X axis and the other as the Y axis, and if you define a "speed" to do your dispensing in a given time just use some simple trig to work out the X and Y equivalent movements needed. All that could be done in Matlab and it would send a simple string of "G code" with format like "G01 X1 Y2 F10" to make GRBL drive the steppers as needed. A little bit of control code also needed to send config parameters to the Arduino.