Post by felixcatuk on Dec 14, 2020 15:31:23 GMT -7
I've just started using Open-Dobot 1.3 with a RAMPS 1.4 board . I was given a Dobot by a frustrated owner who ran out of patience with the original software.
I thought I'd share some notes for anyone in a similar situation, and confused by the same stuff I was... It found it a bit tricky to get going, but it is gradually coming together.
Wiring the RAMPS Board
The wiring for the RAMPS board was surprisingly easy to figure out. The connectors fit without any modifications (apart from the old accelerometers, which are destined for the bin).
Powering the RAMPS Board/Servos
My RAMPS board is powered by the original Dobot 20V PSU hooked up to the two power inputs on the RAMPS.
One detail that stalled me was 5V power to the servos, given the limitations of the RAMPS board, and Arduino... I simply connected +5/GND from an old 2A USB PSU to a spare servo connector (by chopping up a recycled motherboard LED connector cable from my parts box). The servo's have their own power rail, I didn't need to meddle with the RAMP diodes.
Limit Endstops
The next thing that I stumbled over, is implementing limit endstops for the base.
I plan to use magnetic reed switch sensors (the kind you might fix to windows for a burglar alarm). They're more presentable than the ugly glass/breadboard combo I am using at the moment. I attached an adhesive bar magnet on the base, and mounted the reed switch on a small breadboard, which is then mounted on the robot (with the reed switch facing down toward the magnet on the base). Its working better than expected, but in the long term I plan to replace it when I can get my hands on the burglar alarm sensors.
Anyway, it took a little digging through the source code to discover that the limit endstops for the base are not the limit endstop pins on the RAMPS 1.4 board, nor are the pin numbers used by the SDK the same as the Arduino pin numbers. Hence 'calibration pin 5' is actually pin D31 on the RAMPS AUX connector. (Likewise, 0 -> D16, 1 -> D17, 2 -> D25, 3 -> D27, 4 -> D29, 5 -> D31 etc). I chose to connect to 'calibration pin 5' which maps to D31 on the AUX connector, and the software correctly stops the robot's rotation at the point the reedswitch meets the magnetic field.
One point ... the code comments in example-limit-switch.py aren't correct;
# @param pin - firmware internal pin reference number that limit switch is connected to;
# refer to dobot.h -> calibrationPins"
In Open-Dobot 1.3, the details are actually specified in firmware/src/ramps/RAMPS.cpp.
So taking the provided example;-
driver.CalibrateJoint(1, driver.freqToCmdVal(1000), driver.freqToCmdVal(50), 1, 5, 1, 0)
The pin reference '5' is a defined in RAMPS.cpp to be PC6 which in turn maps to D31. And it is D31 you then connect your sensor to.
In my case, I'm using a normally closed switch, and I want calibration to rotate the base in the opposite way to the given example, so the resulting code is;-
calibrateResult = dobot.CalibrateJoint(1, dobot.freqToCmdVal(1000), dobot.freqToCmdVal(0), 1, 5, 0, 1)
if calibrateResult:
print('Calibrate Test 1 Success.')
else:
print('Calibrate Test 1 Failure.')
Accelerometers
I'm still working on the accelerometers. I've got some MPU-6500 GY-6500 6-axis gyroscope accelerometer sensor modules from an earlier project... and so far they seem to be giving sensible data. They are daisy chained, with power/signal from the RAMPS board to the rear arm accelerometer, feeding through to the front arm accelerometer. Making up that cables requires some creative solidering.
Wiring the front arm accelerometers, ie the one furthest away from the RAMPS board, requires voltage to be applied to the A0 pin on the accelerometer module.
I didn't take any special precautions to protect the A0 pin, YMMV.
I'm using some double-sided adhesive pads to attach the accelerometers on top of the old chips for the moment (but might 3D print some kind of proper mount for them in the longer term).
Per this post by Max;
The MPU-6500 accelerometers seem to be a good alternative to the MPU-6050 GY-521 modules.
Lasers & Pumps
TBC
Hope that helps someone get Open-Dobot working.
I thought I'd share some notes for anyone in a similar situation, and confused by the same stuff I was... It found it a bit tricky to get going, but it is gradually coming together.
Wiring the RAMPS Board
The wiring for the RAMPS board was surprisingly easy to figure out. The connectors fit without any modifications (apart from the old accelerometers, which are destined for the bin).
Powering the RAMPS Board/Servos
My RAMPS board is powered by the original Dobot 20V PSU hooked up to the two power inputs on the RAMPS.
One detail that stalled me was 5V power to the servos, given the limitations of the RAMPS board, and Arduino... I simply connected +5/GND from an old 2A USB PSU to a spare servo connector (by chopping up a recycled motherboard LED connector cable from my parts box). The servo's have their own power rail, I didn't need to meddle with the RAMP diodes.
Limit Endstops
The next thing that I stumbled over, is implementing limit endstops for the base.
I plan to use magnetic reed switch sensors (the kind you might fix to windows for a burglar alarm). They're more presentable than the ugly glass/breadboard combo I am using at the moment. I attached an adhesive bar magnet on the base, and mounted the reed switch on a small breadboard, which is then mounted on the robot (with the reed switch facing down toward the magnet on the base). Its working better than expected, but in the long term I plan to replace it when I can get my hands on the burglar alarm sensors.
Anyway, it took a little digging through the source code to discover that the limit endstops for the base are not the limit endstop pins on the RAMPS 1.4 board, nor are the pin numbers used by the SDK the same as the Arduino pin numbers. Hence 'calibration pin 5' is actually pin D31 on the RAMPS AUX connector. (Likewise, 0 -> D16, 1 -> D17, 2 -> D25, 3 -> D27, 4 -> D29, 5 -> D31 etc). I chose to connect to 'calibration pin 5' which maps to D31 on the AUX connector, and the software correctly stops the robot's rotation at the point the reedswitch meets the magnetic field.
One point ... the code comments in example-limit-switch.py aren't correct;
# @param pin - firmware internal pin reference number that limit switch is connected to;
# refer to dobot.h -> calibrationPins"
In Open-Dobot 1.3, the details are actually specified in firmware/src/ramps/RAMPS.cpp.
So taking the provided example;-
driver.CalibrateJoint(1, driver.freqToCmdVal(1000), driver.freqToCmdVal(50), 1, 5, 1, 0)
The pin reference '5' is a defined in RAMPS.cpp to be PC6 which in turn maps to D31. And it is D31 you then connect your sensor to.
In my case, I'm using a normally closed switch, and I want calibration to rotate the base in the opposite way to the given example, so the resulting code is;-
calibrateResult = dobot.CalibrateJoint(1, dobot.freqToCmdVal(1000), dobot.freqToCmdVal(0), 1, 5, 0, 1)
if calibrateResult:
print('Calibrate Test 1 Success.')
else:
print('Calibrate Test 1 Failure.')
Accelerometers
I'm still working on the accelerometers. I've got some MPU-6500 GY-6500 6-axis gyroscope accelerometer sensor modules from an earlier project... and so far they seem to be giving sensible data. They are daisy chained, with power/signal from the RAMPS board to the rear arm accelerometer, feeding through to the front arm accelerometer. Making up that cables requires some creative solidering.
Wiring the front arm accelerometers, ie the one furthest away from the RAMPS board, requires voltage to be applied to the A0 pin on the accelerometer module.
I didn't take any special precautions to protect the A0 pin, YMMV.
I'm using some double-sided adhesive pads to attach the accelerometers on top of the old chips for the moment (but might 3D print some kind of proper mount for them in the longer term).
Per this post by Max;
The pin holes of both modules are expected to look at the back of the robot (same direction where the wires would go). However, as this is an open project you are free to redefine it any way you like. The angles are acquired by _initializeAccelerometers function in SDK and is easy to adjust to any either way you module is mounted. In case you mount one of the modules with pin holes looking the opposite direction all you need to do is to change the sign of the angle returned from accel3DXToRadians.
The MPU-6500 accelerometers seem to be a good alternative to the MPU-6050 GY-521 modules.
Lasers & Pumps
TBC
Hope that helps someone get Open-Dobot working.