JJRobots COMMUNITY

Full Version: New to use of Arduino, need assistance
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all!

Hope to gain some assistance from you to get my StarTracker moving!

What I have currently set up...
-Arduino Leonardo w/ brain shield seated and a4988 driver seated correctly on motor 1 connectors.
-Nema17 stepper motor connected to board for motor 1.
- Startracker_v5.ino code uploaded to Arduino
-12 volt power supply connected.

Now, how do I get it to work? I have tried pressing the red "reset" button, which just makes the "L" led light turn on, and I am guessing just resets the board. I have tried pressing the button between the motor hookups on the brain shield, but nothing happens. I am guessing that this button is analog 3 on the board, so I changed "Button1" to A3. Nothing.

Is there a controller I need to get to start and stop it? Thanks for you help!

UPDATE: Volt Regulator was fried, board gets very hot and can't be identified by computer. Will have to replace Arduino Leonardo, and hope that Brain Shield was not affected by what seemed to be a power surge.
I will try to take a look at this if this weekend. The Brain shield has a protection diode. It "should" be fine. But...
So, after getting my new arduino leonardo in the mail, I started looking closer to the code provided by jjrobots. Should have read the info at the top in the first place, for it says exactly what board and arduino the code works for; JJROBOTS arDusplay Stepper Motor Control, Arduino Pro Micro, and either an A4988 or DRV8825 driver.

Doesn't seem that they have the JJROBOTS arDusplay Stepper Motor Control board or Arduino Pro Micro in stock, so the link in the instructions sends us to another board, the Arduino Leonardo, with the brain shield acting as a control board. Not sure why the instructions lead us to this device, but I am slowly figuring out I may have purchased the wrong stuff, at least the wrong shield that will not work since it does not have the three button control. Hope I am wrong...
Decided to try and use the brain shield by soldering the digital slots of 4,5 and 6 to external buttons that will be installed on the outside of the box I created for the arduino and shield. We shall see how this goes.
So I didn't know how to find which pins of the a4988's direction, step and enable connected to the arduino leonardo, so I took the shield off, connected the driver and stepper motor to a breadboard, and put in a simple code that just runs the motor at the correct rpms, and had it running. Probably going to get a mini breadboard and pair it with the board to finalize this project, unless I can figure out how to make the brain shield work. Any input would be great!

Basic Code used:

#include <Stepper.h>
Stepper stepper(200, 8, 9, 10, 11);
void setup()
{
// set the speed of the motor using equation (((2*3.14159)/1436)*LENGTH BETWEEN HINGE AND ROD))/(60*0.2549))/1.25 <--- M8 Rod
stepper.setSpeed(2.197177767019892);
}
void loop()
{
stepper.step(200);
}

[Image: woxpcv.jpg]
Ended up purchasing an Adafruit Perma-proto board to bypass the need for a brain shield for the time being till I can get the code figured out. Soldered the following if you wish to do the same...

Took the a4988 driver and installed it on the perma-proto board and soldered it into place. Won't need to solder the ms1, ms2 or ms3 connections since they will not be used. Bridged the sleep and reset together. Connected to the Arduino Leonardo the following... Engage to D10, Direction to D9, and Step to D8. VMOT and GROUND (right next to each other) to Capacitor 100uf on the perma-proto board, then from the capacitor I connected the VMOT to VIN and Ground to the ground next to VIN on the Leonardo. VDOT connects to 5V slot on Leonardo, and the Ground near VDOT will connect to the ground near 5V slot on Leonardo. Picture of set up seen below...

[Image: ThsKAZ.jpg]

Coding to upload is very simple, seen below, and will run the stepper motor at power-up, at the speed pre-calculated by following what jjrobots did in their coding, but just make sure screw is opened up full on the top of the A4988 driver for it to go the speed you want. You will not need buttons, but you will have to manually turn the bolt back to start, and change the direction if you feel inclined by flipping the stepper motor connection to change polarity.

#include <Stepper.h>
Stepper stepper(200, 8, 9, 4, 11);
void setup()
{
// speed of motor calculated by (2*3.14159)/1436)*(Length from center of hinge to center of threaded rod)/(60*0.2549)/(size of metric bolt used)
stepper.setSpeed(2.197177767019892);
}
void loop()
{
stepper.step(200);
}


It runs, but would like to try and get it to run so it's a consistent speed and not with a studder. Will have to mess with code to see if that will fix it.

Will try it when the sky is clear to see if it makes for a steady picture.
Reference URL's