So I just purchased this kit from Sparkfun, the Actobotics 4WD chassis: https://www.sparkfun.com/products/13141 (It was a tough choice between that or the tank!!).
I intend to make this thing controllable entirely via an app I write either for Android or for iOS (haven’t decided yet). I haven’t figured out which sensors I want on it for autonomous drive yet, I have the following goals, in order of difficulty:
Make it driveable using Spark cloud (worried about latency) [wondering if I need to expose a socket server and send raw commands to the Spark rather than use the REST cloud API for control]
Rig up all kinds of outrageous LEDs (All Jeep modders can sympathize with this desire)
Add a bunch of sensors so I can track things like inclination angle, GPS coordinates, etc.
Explore semi-autonomous driving
I am a hardware newb, but I’ve been writing code for 30 years, so I have some hardware questions:
Can I control these 4 motors directly from the Spark?
If I need a separate motor controller, which one should I use? Should I just wait for the Spark motion shield? If so, can I rig up something that will simulate the Spark motion shield in the meantime?
How do I deal with power? I’m assuming I’m going to have a big fat RC battery in there somewhere, but I don’t know if the Spark will get its power from that as well, or if they’re different power sources and the Spark is effectively the switch?
Basically I’m just looking for general guidance on where to go from chassis to something I can drive? I am committed to being able to do this whole thing with a Spark and not fall back on existing Arduino kits.
Latency should not be a problem as the internet is fast(if you have good internet speeds)
but if you are worried you can go with the exposed socket server and sending raw commands)
Leds should not be a problem you could use an led controller so they take up less pins
A bunch of sensors might take up a lot of pins but as long as you keep the number of inputs and output and use the most valuable sensors you should be fine.
Semi-autonomous should be fine easy to do maybe find a program premade and try to convert it to spark.
On to the hardware
Motors are not recommended to control using only the spark core.(thats why they made a shield)
To drive motors You might want to buy a motor shield(for arduino) and a shield shield(from spark) it can drive 3 motors(two back one front steering). This shield gives you a lot more pins for sensors, lights, gps. etc. Keep in mind spark core runs on 3.3v.
Thanks so much for the information. I’ve been doing a bit of research since then and I’ve actually ordered a shield shield (assuming I would have to expand the Core’s pins).
Some additional thoughts:
I love the idea of being able to power the Core with a 9V battery. Can I really power the whole system on this, or should I power the core with the 9V battery and the motors with separate batteries?
The motors (there are 4, not 3) that I need to drive are 313RPM HD motors, with a max stall current of 20A. I’m not sure what that means, but I’m assuming it means I need to be able to supply at least 20A to each of 4 motors while driving… This is what led me to the RoboClaw motor controllers… Do I need 2 of these instead of the Arduino motor shield? Could I make the rear 2 motors controllable in parallel as a drive motor with 2 steering motors in front and still use the Arduino motor shield?
[quote=“ZombieKiller, post:3, topic:10965”]
I love the idea of being able to power the Core with a 9V battery. Can I really power the whole system on this, or should I power the core with the 9V battery and the motors with separate batteries?The motors (there are 4, not 3) that I need to drive are 313RPM HD motors, with a max stall current of 20A. I’m not sure what that means, but I’m assuming it means I need to be able to supply at least 20A to each of 4 motors while driving… This is what led me to the RoboClaw motor controllers… Do I need 2 of these instead of the Arduino motor shield? Could I make the rear 2 motors controllable in parallel as a drive motor with 2 steering motors in front and still use the Arduino motor shield?
[/quote] What It looks like is that you can power the motor shield using the 9v battery not separate for the shield. You could if you want longer battery life(but you will have to check the amps to make sure it wont fry) you could use one of the rc car lipo batteries. You might want to take a look at www.rcarduino.blogspot.com from the looks of it he uses an arduino to control motors so that might work out. He has diagrams and maybe a purchase list and code.
Sorry about the wrong amount of motors, I thing you can make the back motors parallel because those are just moving forward and backwards so yes (but that might take more amps so you might have to look into that) with the front motors keep them separate so they can be controlled separately.
The ardumoto shield is apparently only able to push 2 amps per channel. I can’t figure out from the link I posted to the 313RPM motor how many amps that draws but I’d be willing to bet it’s a lot more than 2. Again, this is all new to me so sorry for slathering so much newbsauce on this post.
There are so many different motor driver controllers and options available that it’s overwhelming and hard to figure out which one I should use.
So I called spark fun and asked them what they thought was an appropriate motor controller for this chassis. I was highly disappointed in that the tech support guy didn’t have a recommendation off the top of his head, e.g. they hadn’t actually thought that question through before deciding to sell the chassis.
That said, he recommended this board: https://www.sparkfun.com/products/11593 - it’s a 4-channel motor controller that he thinks should be able to drive all of my motors on the 4WD chassis.
It looks like it’ll do the job, but I’m confused as to how to supply two different sources of power - 1 for logic and 1 for motor power…and still power my Spark Core (which would likely still be inside the shield shield).
There’s so much to take in, it’s enough to make a guy throw in the towel.
@ZombieKiller Don’t give in!!! “Hardware is hard” -unknown
Sorry I did not get to you sooner(still in school). Ok I’ve read the page for the 4 channel motor controller so with power you should be able to use 5v from the shield shield and then just get one of these but connect it to the motor supply http://cdn.instructables.com/FL1/XYOU/HD4VHR8D/FL1XYOUHD4VHR8D.LARGE.jpg
that will power motors and the spark core will power the logic power. Now you can use 3.3v or 5v to power logic. then you just hook up the pins and use digital write 1 or 0. 1 is on 0 is off. I hope this helped!
Arg. Got an e-mail from tech support saying that the 4-channel motor controller is horribly underpowered, and I need something that can control 20A per channel… so I might need to get 2 of the roboclaw controllers.
Also looked up this same kit on ServoCity, and right on the page for that kit it recommends the RoboClaw 2x30A motor controllers…
Do an eBay search for “ETC 150A Dual brushed motor Climbing RC”
At about $45ea you can’t complain… you will need one for each side of the truck for skid steering
Climbing RC trucks use brushed DC motors as they give the highest torque @ stall unlike other RC cars which have mostly changed to brushless as they have more torque a the top end.
These RC speed controllers use a pwm input which can be driven easily using the servo commands built into the core.
The other totally awesome part is they have a built in BEC or battery eliminator circuit for powering the RC receiver. . In this case the spark it will provide 1A at 5V (don’t use the 3A the instructions say) Just make sure you add some filter caps to smooth the power… The core doesn’t like noise on the power lines. And because you have 2 of them you could use the other to power other sensors like a pixy or lidar
And for power I would use a 4s lipo battery somewhere around 5000mAh… cheapish super light and heaps of go go juice!