Closed brandonaaskov closed 8 years ago
@dtex might be able to help here
Hi @brandonaaskov , is that v1.2 of the motor shield? Sadly we don't have support this board in Johnny-Five. @xseignard and @alexbudin were working on it (#216) but I don't think they have anything ready to go. I'd be willing to look into it but those boards are no longer available. If you want to use Johnny-Five (and you do, it's awesome) you will have to use a different motor shield. To the best of my knowledge Johnny-Five supports every shield out there except for the Adafruits (including V2.0)
I just picked up the board, so it's V2.0. I'm trying to make some tutorials for the very beginners, and being able to grab a motor shield off the shelf is hugely helpful. I snagged the Adafruit one because I was already making an order. Is there a different motor driver (ideally a breakout board or shield for simplicity) that J5 supports? My goal is to use Johnny-Five for everything, but using readily available hardware always helps.
I'm wondering if there is misunderstanding here, Stepper and Motor are unrelated classes. I own the stepper motor that @brandonaaskov linked to and have used it with the Stepper class (+AdvancedFirmata). These drivers have been tested and confirmed with Johnny-Five's Stepper class:
@brandonaaskov I just ordered this: https://www.adafruit.com/products/1438, I'll report back when I know more
Doh! Yes I misunderstood. I overlooked all FIVE occurrences of the word "stepper" in the original question.
(I'm going to post a bunch of links and code snippets here, just so I don't forget them)
// M1 and M2 => port 1
// M3 and M4 => port 2
// `num` is decremented, so 0 => 1 and 1 => 2
if (num == 0) {
pwma = 8; ain2 = 9; ain1 = 10;
pwmb = 13; bin2 = 12; bin1 = 11;
} else if (num == 1) {
pwma = 2; ain2 = 3; ain1 = 4;
pwmb = 7; bin2 = 6; bin1 = 5;
}
Awesome! I'll pick up that EasyDriver from Sparkfun since I'm getting a few other things as well (missile switches ftw!).
Just so that I can wrap my head around it, is the Adafruit board more difficult because of the 74HC595 latch? It seems like that's the case since the Arduino has to speak to that instead of the PWM pins directly, but like I said, I'm treading water here :)
@brandonaaskov you must make absolutely sure to provide the necessary amount of power to the driver board. I literally ruined 3 boards by not paying as close attention as I should've
Looks like it can take 7V-20V for a power supply. I would imagine not giving it enough power would just cause brownouts and weird behavior. Underpowering it wouldn't fry the board... would it?
Heh. I meant that I was providing too much :) I literally burned the boards with electricity.
Ok, my board was delivered, but I'm about to go on vacation for 10 days, so please be patient with me :) thanks!
Perfect timing! I just got back from a week-long vacation and my sparkfun motor driver just arrived!
Well... I won't be back until late next week :|
Have fun! I'll see how far I can get with the replacement board.
I re-opened this because the issue was specifically in reference to stepper motors which are not yet supported.
Ugh. I'm the worst.
Have you ever had a chance looking into this again? I was hoping to hook up a stepper motor the adafruit motor shield, but haven't had any luck so far :-(
@dtex are you still working on this?
No, but I did get a 12V stepper motor to test with.
Please let me know if there is any way I can help. Happy to test with the motors that I have available.
I hate to pass the buck, but if you want to get unblocked, the EasyDriver or the Pololu Drivers work great ;)
hi all... i'm developing a automower and have adafruit shield 4 directional motors (no stepper) connected to a mega .. i'd like to know if i can connect through johnny ... thank you ...
@spokke which adafruit shield motor shield? v1 or v2?
Edit
The v2 is simple to connect: https://learn.adafruit.com/adafruit-shield-compatibility/motor-slash-stepper-slash-servo-shield-v2#arduino-mega-2560-r2
The V1 shield should also work with a Mega per the Adafruit site and both V1 and V2 are supported by Johnny-Five.
The V1 shield supports stepper and servo connections in addition to regular motors. When I wrote the V1 driver (ShiftRegister), I only got regular motors working. IIRC, the code for steppers is a bit more complicated than regular motors, but not as much. They both use the shift registers to use 3 pins to control lots more. The Motor.js:Controllers["ShiftRegister"] code was loosely based off of this code: https://github.com/adafruit/Adafruit-Motor-Shield-library/blob/master/AFMotor.cpp
thank for all response .... the shield is this http://www.amazon.it/gp/product/B00E19VXR0?psc=1&redirect=true&ref_=oh_aui_detailpage_o02_s00 ... i will try soon .. which pin must i use ? thank you
That is a V1 shield.
ok i will take an example and try in a few days (i hope) :)
Again, this shield won't work with Stepper motors without writing new code inside J5. It will only work with regular motors. B
On Wed, Jun 24, 2015 at 4:17 PM spokke notifications@github.com wrote:
ok i will take an example and try in a few days (i hope) :)
— Reply to this email directly or view it on GitHub https://github.com/rwaldron/johnny-five/issues/380#issuecomment-114997791 .
Ok i need for normal motor no stepper
Inviato da iPhone
Il giorno 24/giu/2015, alle ore 23:26, Brian Genisio notifications@github.com ha scritto:
Again, this shield won't work with Stepper motors without writing new code inside J5. It will only work with regular motors. B
On Wed, Jun 24, 2015 at 4:17 PM spokke notifications@github.com wrote:
ok i will take an example and try in a few days (i hope) :)
— Reply to this email directly or view it on GitHub https://github.com/rwaldron/johnny-five/issues/380#issuecomment-114997791 .
— Reply to this email directly or view it on GitHub.
I'm going to close this issue due to it's age, but if you'd like to continue with it feel free to comment and we'll reopen.
For those who landed here looking for help with the Adafruit Motor/Stepper/Servo Shield V2, it is now supported in Johnny-Five. See the example here: https://github.com/rwaldron/johnny-five/wiki/Motor#adafruit-motorstepperservo-shield-v2
My particular use case is to drive a 12V stepper motor. I have the AdvancedFirmata that I need. Even have the motor shield and Arduino on two separate power supplies. But I realized I have no idea how to address the pins with this thing. The motor terminals I'm using are "M3" and "M4" but that doesn't tell me which PWM pins to use.
Then I read this...
Give that, is this something that would get support at the firmata level? This is a bit low-level for me, so I'm just barely treading here.
I don't think it makes a difference, but here's my code for reference: