Can I use 4 stepper motor and 2 servo with CNC shield v3.0? With grbl I can use all 4 steppers but other 2 servo doesn't appear in that software and I'm a beginner. I have the CNC shield in that images:
Are you using all of the limit switches? How about the analog input pins (Abort, Resume, Hold, Cool En)? You can use any of those pins for servos. Don't try to power servos from the Uno 5V though, power them with an external supply capable of delivering enough current for the servos.
Thank you so much for your reply. I found many software like grbl controller, grbl control panel but they are only for at least 4 axis and I can't add other axis.
Why I can't use the 5V on the shield? Is not a problem for me to add another power supply is only for information.
The Uno 5V, when supplied either by USB or by the on-board 5V regulator, is capable of supplying limited current. A servo under load can pull more current than can safely be supplied. That will cause unwanted resets.
I know of no software or firmware for an Uno with CNC shield that controls 4 steppers and 2 servos like Grbl would so you will probably have to write the code yourself.
I won't disturb you too much. I build a robotic arm that has 4 stepper to move base and first three part of the arm. Two servo instead serve to move the hand. If you want more detailed description tell me.
Anyone can help me. How can I define the pin that I'm using with cnc shield in my code. I'm try to using AccelStepper and Servo to write it. I need only simple back and forth movement.
I'm trying to use MobaTools but i report many issues on my path. Can I control arduino moves with pc keyboard?? I assigned a pin for each servo and I imposed that on press of a key servo moves of x grades. How I can do that fuctionally? I used keyboard library and MobaTools library.
Another question, if I keep press the key, servo or stepper motor keep going or not?
Post your code. Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum. Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
Tell us what the code actually does and how that differs from what you want the code to do.
Which one? Post a link to the library.
If you code it that way.
Please realize that we cannot see your project. We have very little idea what you have, how it is connected and the programming. You will get the best help if we have all the information necessary to duplicate your project. That means code, schematic and data sheets for each component (as necessary).
Hi, this morning I've tried to compute a code and it almost work for servo, for stepper I haven't started yet because with cnc shield I don't know what pin are in use. I link the code there:
[code]
#include <Servo.h>
// Define servo motor
Servo Servo1;
Servo Servo2;
int ang1 = 90;
int ang2 = 90;
int k = 0;
char val = '0';
//Define stepper motor
//MoToStepper Stepper1(10, FULLSTEP);
//MoToStepper Stepper2(10, FULLSTEP);
//MoToStepper Stepper3(10, FULLSTEP);
//MoToStepper Stepper4(10, FULLSTEP);
void setup() {
Serial.begin(115200);
Servo1.attach(A0);
Servo2.attach(A1);
Servo1.write(ang1);
Servo2.write(ang2);
// byte Stepper1.attach();
// byte Stepper2.attach();
// byte Stepper3.attach();
// byte Stepper4.attach();
}
void loop() {
if (Serial.available())
{
val = Serial.read();
}
if (val == 't') {
ang1 += 1;
Servo1.write(ang1);
delay(15);
}
if (val == 'g') {
ang1 -= 1;
Servo1.write(ang1);
delay(15);
}
if (val == 'f') {
ang2 += 1;
Servo1.write(ang2);
delay(5);
}
if (val == 'h') {
ang2 -= 1;
Servo1.write(ang2);
delay(5);
}
}
[/code]
You are right, in fact I use Abort and hold and I'm writing the code myself because i haven't find a software for me.
Can you explain better that software please? If I can work smarter is better.
Or, as a beginner, if you want to use Gcode, 4 axes and 2 servos, you may want to choose more capable hardware that already works with those. Almost any 3d printer hardware will do.
X axis step = 2, dir = 5
Y axis step = 3, dir = 6
Z axis step = 4, dir = 7
A axis step = 12, dir = 13
stepper enable = 8, active LOW (LOW to enable motors).
What stepper drivers are on the CNC shield? Have you set the coil current limits on the drivers (important).
I think one problem is, that the value of 'val' ( not a very descriptive name ... ) stays at the last received value and the corresponig 'if' is true with every loop cycle.
You should reset 'val' at the end of loop to a non valid value, or move all the if ( val ==... into the if block of Serial.available().
And you should check wether your angle value overflows ( becomes greater 180 or less than 0 )