All running off the battery... FINALLY. Still a lot of work to go |
- Pan and Tilt:
- The distance sensor is.... sorta working. Not sure if it is a bad sensor (cheap sainsmart unit) or bad programmer at the moment. It is mounted by rubber band which I need to sort out at some point.
- Camera is throwing a stream up (that is the window on the monitor in the first picture)
- Arduino UNI is talking to the RoboClaw motor controller and I have a serial command solution for fwd/bkwd and pan/tilt control
- back is negative 1-127
- command takes a positive number, fun part was figuring out how to split a ramp that went from front to back or back to front...ie if I was going forward and wanted to go backwards I didn't want it to just throw over to the backwards speed. It slows down forward motion to zero before increasing the backward rate to the requested setting.
- forward is positive 1-127
- 128 - 307 controls pan
- 308 - 487 controls tilt
- Reading values from the RoboClaw (more on this in a bit) so I can figure out encoding for more accurate motor/movement control. Right now it is just giving me the main battery pack voltage.
- Multiple Serial lines are up and confirmed, this stopped some cross talk I was getting between controlling the motors and the Arduino sending data to the Pi.
- The big news: It is now working while self contained. Batteries are connected to the motor controller, it has a 5v 3a circuit that I built a franken USB cable to use to power the pi. Still using the UNO so it is powered via USB from the pi for now. Intend to move to the much smaller Trinket pro and power it from the 5v pass through pin from the Pi.
A picture of the growing rats nest |
What is left:
- Still need to work on a serial line between the Arduino and Pi GPIO pins. Now that I have the multiple serial lines setup that should be easy
- Means I also need to spin up a serial connection program on the pi instead of using the command line or the Arduino IDE serial interface Ultimate goal there will be to connect to the remote system (Macbook initially, iPad, Android apps eventually).
- Decide between 5v trinket pro
and 3.3v trinket pro - 5v will require logic shift to talk to the pi, definitely doesn't require logic shift to talk to the servo's, sensors and motor controller. You can see this setup below on my new pi Hat, trinket is to the right, logic shifter is to the left, camera ribbon goes between them. This is just mocked up right now. Still have to transfer all the wiring from the uno to this board if I can make it all fit. If you zoom in you can see my learning process on the solders. The hat is a bit scorched in places. No idea yet if I over did it or not. Same on the trinket and shifter...
- 3.3v doesn't require logic shift to the pi but may require a shift for the motor controller or sensors. I have a 4 and 8 line shifter if needed.
- If the cabling for the above doesn't work right I may go to the 3.3v trinket to simplify the wiring coming out of the hat. Supposedly the Roboclaw outputs are 3 volt logic tolerant.... so I shouldn't need the shifter for it. Not sure about the ping sensor. Think it needs 5v...
- Sort out some servo freak outs. Getting some random servo jerks when sending serial in and out. Guessing I need to pull the pin low with a resistor or something or maybe add a cap or two. Right now the signal wire is plugged straight into the Arduino so I suspect the pin is floating and getting pulled high here and there. Also possible I fried something on the Arduino so I am going to wait until I have the trinket wired it to try and nail this one down.
- Start building a control program to replace using a VNC session to the Pi desktop. Eventual architecture will be
- Remote (laptop/mobile device) <-> Pi WiFi interface via bi directional packet traffic <-> Pi to Arduino <-> Arduino -> Roboclaw, servos, sensors etc...->->->
- Joystick or other analog process (mifi from mobile?) for motion control
- Pi Camera -> Netcat stream or HTTP webcast -> remote receiving system (laptop/ mobile)
- Joystick or other analog process for pan/tilt control (wifi for mobile?)
New enclosure, pi hat, wi fi (increased range I hope), and camera housing. 4 line logic level shifter and 5v trinket are sorta mounted
|
You can see the scorch marks... as homer simpson might say... "DOUGHT !!!" |
RoboClaw 15a Review:
So far I have liked this controller lineup from Orion Robotics. Prior to these units (ranging from 2x5a - 2x60a) popping up it seemed the only easily available higher amperage hobby controller that wasn't R/C based were the SaberTooth modules you see on most of the various robo building sites. Of particular interest here to me where the various modes of control (usb, serial, PWM) and encoder capability. With a decently encoded motor you can effectively turn relatively cheap DC motors into powerful stepper motor/servos with these controllers if you so desire. While this level of precision is not something I am after with my initial rover setup it is something I want to explore down the road. Until this it looked like I would be doing a separate encoding solution through a micro controller.
It has so far survived my idiocy (see previous post for my infinite current goof) with the exception that the voltage information is reading high. I got the same problem from the circuit I had on the UNO and the RoboClaw was a part of that configuration. I suspect a resistor got partial fried or something. Unfortunately I had no readings prior to that event so I do not know if I caused it or if it was reading high (compared to my multi-meter) originally. I suspect the problem was me... just no way to know for sure short of buying another one.
My only real complaint thus far has been the somewhat sparse documentation. Orion's site forums are not terribly extensive and there seems to be few other places with info beyond some regurgitation of the built in examples they provide and... well they are in some cases not easy to pick up. At least not for this particular noob. They consist of working examples more or less... but none of the 'why' or what the different choices mean. For those familiar with this kind of gear I am sure what is provided is more than sufficient to get your bearings. But, if you are a novice these controllers may not be the best choice. I am not a complete novice... but my basic electronics knowledge is definitely lacking. You can read up on my various learning experiences with this controller in the previous posts on this project. Hopefully they will pop up on google searches if anyone else hits similar snags.
All in all though the units are similar priced to the Sabertooth controllers, seem to have more options and are built well. Definitely worth a look if you are in the market.
No comments:
Post a Comment