Connect Makelangelo Software to Custom Bot
Shop › Forum › Makelangelo Polargraph Art Robot › Connect Makelangelo Software to Custom Bot
- This topic has 17 replies, 3 voices, and was last updated 8 years, 9 months ago by Anonymous.
-
AuthorPosts
-
2016-02-10 at 17:07 #8918AnonymousInactive
Dear Makelangelo,
I am constructing a drawing bot for my school from 3d printed parts, an arduino uno, adafruit motorshield v2, and adafruit nema 17’s on Windows 7. Unfortunately, I cannot get the software to move my motors as this is supposed to happen once I hook up my bot. Attached is an image of my situation and it says, ‘port opened’ which I connected to. I* am using V5 and I have transferred the firmware to the Arduino library.
I am interested in buying a machine, but want to learn on my own first so any help would be greatly appreciated.
Thank you,
Erik2016-02-10 at 17:41 #8919AnonymousInactive2016-02-12 at 02:51 #8933AnonymousInactiveHi,
Wanting to build a COREXY-table for the Fablab in my neighborhood, I’m in a similar situation.
I don’t know whether it’s causing your problems, but have a few questions.
Can you get the steppers moving, using just the example-sketches for the V2-shield ?
Using an Uno +V2 shield you’ll need the firmware_ams-sketch as firmware.
Standard it supports a V1-shield, have you changed it to work with a V2 ?If so, V2-shields are controlled by I2C. In theory you can control 127 devices using the I2C-bus, but they all need their own address.
Standard…. the address of a V2-shield is 0x60, something you can change, using the address-jumpers on the shield. Having a few versions of the firmware, I did notice SHIELD_ADDRESS is set to 0x61 in one of the firmwaresketches as well.Your shield will only respond if both addresses are the same.
If you enter the address used in a working… example-sketch, it should work. If needed you can check which address(es) your shield responds to, by uploading an I2cScanner – sketch.
2016-02-16 at 13:45 #8952AnonymousInactiveThanks for the reply Bart,
I uploaded the sketch you referenced, firmware_arms-sketch to the ArduinoUno. I defined the constants as listed in the attached beginning of the code. THe issue I am facing is that the servo is working fine, but I cannot get the steppers to move. I think it has something to do with the pins of the M1_PIN and M2_PIN. I would think that each motor has two pins as is stated on the adafruit website. Also, I don’t understand the limit switch portion.
DO you think this is why the steppers are not moving? They move fine in ‘steppertest’ sketch in the Arduino API.
Thanks so much,
Erik#define MOTHERBOARD 2 // Adafruit Motor Shield 2 // machine style #define POLARGRAPH2 // uncomment this line if you use a polargraph like the Makelangelo //#define COREXY // uncomment this line if you use a CoreXY setup. //#define TRADITIONALXY // uncomment this line if you use a traditional XY setup. // Increase this number to see more output #define VERBOSE (0) // Comment out this line to disable SD cards. //#define USE_SD_CARD (1) // Comment out this line to disable findHome and limit switches //#define USE_LIMIT_SWITCH (1) // which motor is on which pin? #define M1_PIN (1) #define M2_PIN (2) // which limit switch is on which pin? #define L_PIN (A3) #define R_PIN (A5) // Marginally Clever steppers are 400 steps per turn. #define STEPPER_STEPS_PER_TURN (200.0) // We don't use microstepping on the AMS shield. #define MICROSTEPPING_MULTIPLIER (8.0) #define STEPS_PER_TURN (STEPPER_STEPS_PER_TURN*MICROSTEPPING_MULTIPLIER) #define NUM_TOOLS (6)
2016-02-16 at 13:47 #8953AnonymousInactiveAlso, I am concerned that this code might be outdated as the version 2 of the ADAfruit uses the constants:
#include <Wire.h> #include <Adafruit_MotorShield.h> #include "utility/Adafruit_PWMServoDriver.h" // Create the motor shield object with the default I2C address Adafruit_MotorShield AFMS = Adafruit_MotorShield(); // Connect a stepper motor with 200 steps per revolution (1.8 degree) Adafruit_StepperMotor *myMotor1 = AFMS.getStepper(200, 1); Adafruit_StepperMotor *myMotor2 = AFMS.getStepper(200, 2);
2016-02-16 at 14:02 #8954DanKeymasterArduino 1.6.7 made changes that broke the code. Please read the latest makelangelo-firmware to see the changes we added that fix this problem. The github diff will be especially useful.
2016-02-16 at 14:15 #8955AnonymousInactiveThanks Dan,
I see the changes; however, I am not sure which firmware to upload:
firmware_ams/Adafruit_MotorShield/Adafruit_MotorShield.cpp or
firmware_ams/Adafruit_MotorShield/Adafruit_MotorShield.hAlso there is a servo firmware too. Do I need to add these changes into the firmware_arms or just upload one of these new firmware files?
Thank you in advance,
Erik2016-02-16 at 14:23 #8956DanKeymasterNeither. In fact, you don’t need to copy anything to the arduino/library folder any more.
firmware_ams.ino is the file you should open and upload.
If you are following our recipe for building a Makelangelo then the only thing you need to change is the MOTHERBOARD.
If your steppers are not moving, you probably have crossed wires. The coils in the stepper will fight each other and you will get a vibration, at best, and nothing, at worst.
2016-02-16 at 14:38 #8957AnonymousInactiveGreat. I am a novice when it comes to downloading from Github so I copied the file to a new arduino sketch and get this error:
Arduino: 1.6.5 (Windows 7), Board: "Arduino/Genuino Uno" Build options changed, rebuilding all Using library SPI in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI Using library Wire in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire Using library Servo in folder: C:\Program Files (x86)\Arduino\libraries\Servo Using library SD in folder: C:\Program Files (x86)\Arduino\libraries\SD Using library EEPROM in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire -IC:\Program Files (x86)\Arduino\libraries\Servo\src -IC:\Program Files (x86)\Arduino\libraries\SD\src -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM C:\Users\ERIKSV~1\AppData\Local\Temp\build2111247330064447615.tmp\sketch_feb16a.cpp -o C:\Users\ERIKSV~1\AppData\Local\Temp\build2111247330064447615.tmp\sketch_feb16a.cpp.o sketch_feb16a.ino:127:43: fatal error: AFMotorDrawbot/AFMotorDrawbot.h: No such file or directory compilation terminated. Error compiling.
2016-02-16 at 15:10 #8958AnonymousInactiveI apologize, but I can’t figure out how to get this file on my computer from Github. Copying the source code directly to Arduino yields these errors that claim I am missing the ‘AFMotorDrawbot/AFMotorDrawbot.h’ file. Which I have. I think.
Thanks again,
Erik2016-02-16 at 15:37 #8960DanKeymasterin #8954 I said there were changes made for 1.6.7. Your post above says you’re using Arduino 1.6.5. Please update your Arduino and try again.
2016-02-16 at 18:53 #8962AnonymousInactiveOk great, I updated and am getting a compiling error where the director for #include “utility/Adafruit_PWMServoDriver.h” can’t be found.
Do you know if this library is supported by the new release?
I have it installed in the correct location.Thank you again,
Erik
2016-02-17 at 10:16 #8963DanKeymasterYou’ve done something to your setup. I can’t tell what from your explanation.
Try to start again fresh. I believe you have an arduino/library that you don’t need, and it’s breaking things.
maybe it’s an old version of the Adafruit motor shield library *from adafruit*, which should also be updated. (It’s not used by our code but the names are similar and it could cause a problem.)2016-02-17 at 21:55 #8972AnonymousInactive<img src=”http://www.screencast.com/t/wrK5gGuh9il
” alt=”Library Image” />
I have attached an image of my updated libraries. It seems like I have everything in order. I just reinstalled. I can try again if you think its worth it. I agree something is off.
Thanks for all your help.
Best,
Erik2016-02-18 at 10:03 #8974DanKeymasterPlease
– move AFMotorDrawbot, Adafruit-PWM-Servo-Driver-Library-master, and Adafruit-Motor-Shield-V2-Library-master from your libraries folder to your desktop.
– restart arduino
– recompile the sketch
– if no error, move Adafruit-PWM-Servo-Driver-Library-master back into the libraries folder and try again.
– if no error, move Adafruit-Motor-Shield-V2-Library-master back into the libraries folder and try again.This way you will find which one is the problem. You should not need AFMotorDrawbot in the libraries folder since Arduino 1.6.7
2016-02-18 at 11:37 #8975AnonymousInactiveThank you for your extended efforts Dan,
I have followed your instructions and unfortunately got the same error after moving the libraries to the desktop and restarting Arduino. As a result, I could not troubleshoot to find which one was causing the issue. I am still getting the pesky error, #include “Adafruit_MotorShield/Adafruit_MotorShield.h” no library found
Is it possible that Arduino is looking for it in the wrong place? That wouldn’t make much sense.
Anyway, I have started working on writing my own program with your tutorials which are very helpful.
Thank you very much,
Erik2016-02-19 at 15:39 #8978AnonymousInactiveIn my case it doesn’t matter whether I have an adafruit-lib located in documents/arduino/Libraries/ or not, it compiles as it should.
(did have to check quite a lot of libraries and have a nagging non-downloading library manager after upgrading to 1.6.7 though, Aaaargh…)Anyway,
If you open the folder documents/arduino/Makelangelo/firmware_ams, where the firmware-sketch is located, you should see two maps Adafruit_MotorShield and AFMotorDrawbot. They’re included in the update and should be left untouched.2016-02-19 at 16:19 #8980AnonymousInactiveIn my case, it doesn’t matter whether I remove adafruit-libs from the documents/arduino/libraries – map or not, the firmware compiles as it should. (Still have a nagging, non-downloading library-manager, after upgrading to 1.6.7, Aaaargh ):
Anyway, in the documents/arduino/makelangelo/firmware_ams/-folder, where the firmware-sketch is located, you should see 2 folders, Adafruit_MotorShield and AFMotorDrawbot. They’re included in the firmware and should be left untouched.
-
AuthorPosts
- You must be logged in to reply to this topic.