Well, I am at a loss to explain what is going on. I loaded the modified firmware and the 2 motors that I have connected respond properly to all the commands that I send from serial monitor. That is the best that I can do since I don't have a spare CNC shield or the DFMoco software.
Type "hi" (without quotes) into serial monitor and send. What, if anything, is returned in the serial monitor? Please copy and paste the response, if there is any.
If no movement, my next suggestion is to load Robin2's simple stepper code from the link in my earlier post and confirm that the steppers work in isolation. I know that they worked before with Grbl, but it never hurts to make sure. Don't change the wiring, just make sure the sketch has the right pins for step and dir and the enable pin [pin 8] is output and LOW.
After analysing the Simple stepper sketch I realised that the code that the guy provided did indeed specify the correct pins for step and direction controls, but he had neglected to the the code for the enable pins!
So I just added lines in to define the enable pins and set the pinmode to OUTPUT and everything works great now!
I feel like I've learned a lot here (a lot more than I bargained for) and you've helped me get over a couple of weeks of frustration. Now I can finally get on with making my slider and (ultimately) making my film, Phew!
Happy that you got it working and happy to help. I would be interested to see your finished film, if possible. Karma for reporting back with the solution. You never know, but it may help someone in the future.
groundFungus:
Happy that you got it working and happy to help. I would be interested to see your finished film, if possible. Karma for reporting back with the solution. You never know, but it may help someone in the future.
Yes please ! I've read the entire thread, compared the DFMoco sketch with the CNC specs, and I can't figure it out
I can't find any place with obvious pin definition in the code.
groundFungus:
OK, in the case where the code is too long it is acceptable to attach the code. I looked at the code that you attached, but didn't go all the way through so didn't realize that it would not fit.
Per the link that you attached you need to make these changes.
Search the file for "set output pins" and insert the CNC shield pin definitions so it looks like this.
Replace what is there with the above.
Those changes are supposed to configure the program to work with the CNC shield.
After managing to understand the code a little bit better, I tried this answer.
The pins are definitly right (checked on schematics and on the real deal) BUT whenever I upload the code with the above lines : literally nothing happens. With the vanilla code, motors will start buzzing and whistling but if I add the "motors[0].stepPin" bit, : all go silent.
danielroberthope discovered that the original code did not enable the steppers in the code (see reply #26). The enable pins are, it seems, hard wired LOW in the original author's circuit.
Add the parts like in your last reply (#33) and also add:
const byte enablePin = 8;
right before setup() (make a global variable to hold the enable pin number).
Not at this time. I don't know the copyright status of the original code. I don't want to get in trouble for posting copyrighted material without permission.
There is only one setup() function in an Arduino sketch. So search for "void setup()" (it should be around line 568).
It should look like this after you add the enable pin stuff
:
// add stepper enable pin
const byte enablePin = 8;
/*
setup() gets called once, at the start of the program.
*/
void setup()
{
pinMode(enablePin, OUTPUT);
digitalWrite(enablePin, LOW);
So should I add that last bit of code to the original sketch in your first entry, or the one that is in "Reply #10"?
FYI, I don't have Arduino or shield yet. I was about to embark on a custom build like described by the Dragonframe tech. I found this so am very excited. I've programed Pololu and Mach3 before but am new to Arduino. I'll order a couple boards tonight. just that one more question above to get me started.