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?
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?
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.
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.
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.
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!