|
Post by matthew on Feb 8, 2018 16:32:21 GMT -7
Hi, I'm trying to run open-dobot with RAMPS. I flashed the firmware using the cmd script (I'm on Windows), and initially had the same problem as this thread and made the modification to the SDK, but motor commands don't seem to be going through. Currently I am just testing a single stepper motor (the fore-arm). For example, on running example-driver.py I get: Board: RAMPS Dobot ready! ('Accelerometer data returned', (0, 0, 0, 0, 0, 0, 0)) ('Executing 20 commands with steps 27, -3, -14. Expecting GetCounters() to return:', 540, -60, -280)[ stuck in while loop ]
Looking into it, it seems that the writes from the Steps function always return (0,0). Do you have any guesses as to what may be the issue? Thanks
|
|
|
Post by Max on Feb 8, 2018 21:18:40 GMT -7
ehmm, probably comment out the line that does driver.GetAccelerometers() The whole point of replacing the code in sdk was to make it not request accelerometers that are not connected so that the firmware doesn't get stuck trying to talk to those accelerometers. Besides, example-driver.py doesn't even use sdk, it only uses driver
|
|
|
Post by matthew on Feb 9, 2018 15:58:46 GMT -7
Thanks for taking the time to answer Max. I tried your suggestion and it seems to have worked in preventing getting stuck, however the commands don't seem to be propagating to the motor (reads and writes show that the commands are queued, returning (1,1)). Right now my setup is the RAMPS board with only the left stepper driver (with enable connected to ground) and motor attached, to test out the forearm movement only. Am I missing anything that might be necessary for this? Here's a picture of my board: i.imgur.com/TiNumqZ.jpgThanks again
|
|
|
Post by Max on Feb 9, 2018 16:43:54 GMT -7
I can't verify that, but, as far as I remember, data is supposed to come quicker than it can be relayed to the motors in that example and some returns must be (1,0) when the buffer gets full in arduino. Then some commands return (1,1) once space in the buffer becomes available. Is that what you're observing? Also, is the motor actually energized - does it stay at its position or you can freely move that arm around? To make sure your RAMPS board's circuit is correct remove that resistor from the driver. open-dobot takes care of that after the program starts. RAMPS boards are manufactured by everyone and everyone decides what they like to do with the circuit - mine, for instance, has all microstepping jumpers shorted, rendering them useless. I've also noticed that the colors (pins) on your motor wire don't match mine raw.githubusercontent.com/maxosprojects/open-dobot/master/docs/images/interference-fix.jpgBut if the motor is energized then it should do at least something - not necessarily moving as expected, but at least make some noise as the driver counts steps. If the above is all as expected I'd recommend to check the voltage on the STP and DIR pins of the driver. While STP changes at higher frequency and a regular voltmeter might not pick up those changes, the DIR pin is supposed to change only between the loops in that example program that doesn't happen as often and STP. That would show you whether your arduino commands the driver at all and will help you troubleshoot the rest of the circuitry. Ideally you could check those with an oscilloscope if you have one - much better picture of what's going on and where.
|
|
|
Post by matthew on Feb 9, 2018 17:24:06 GMT -7
You are correct, occasionally the commands return (0,1).
Also the motor is not energized without the enable pin tied to ground (as expected the motor is locked when the enable is 0), even when the program is running (the enable pin is high). The SLEEP and RESET pins are reading high as well.
About the wire coloring, I have tested them and the right two and left two on the jumper are separate coils, which seems to line up correctly to the connections on the stepper driver.
Unfortunately I don't have an oscilloscope, but I'll try checking the DIR and STP pins visually with an LED.
Thanks again for the insight and helping me troubleshoot my issue.
|
|
|
Post by matthew on Feb 9, 2018 18:42:13 GMT -7
Edit: After checking the MEGA pins for DIR and STP with and without the RAMPS board, I realized that it was a connection issue! I guess two contacts weren't contacting properly, leaving values floating. After connecting everything securely, it worked!
Thanks for all your help on this issue, Max.
|
|
|
Post by Max on Feb 10, 2018 22:04:09 GMT -7
you're welcome, glad it helped
|
|