Arlo hardware, activity bot software, drive_speed(0, 0), ubuntu and no happy sunset
chronoglass
Posts: 15
Now that i've spent a day or two trying this and that to be able to laugh like frankenstein as this guy chases my cat around the house.. it's time to call in the guys with bigger guns than me..
before that.. thanks guys for the pics and work you all did before me sharing how you got yours going.. it's been invaluable. (though it could be useful to mention which pins the activity bot code expects the motors/encoders on as well as the jumper settings/reasons for them in the motor and/or ping documents) i think i killed a ping sensor with a bad jumper setting (totally my fault for bravehearting the build though, haha)
the bot, arlo
uses the motor diagram paint shopped so proudly from these very forums
I have the power distribution board installed
I am using a dual battery config
I have 1, you heard me 1 set of sensors at present. one ir and one ping on the front (wanna make the thing work before I add all the complexity in the world to it right?) (planning on migrating the sensor array to one of my defcon badges anyway.. so none too concerned beyond the initial POC phase)
this is running on the parallax activity board
motor controller left - p12
encoder left - p13
motor controller right - p14
encoder right - p15
ping center 1 - p16
IR via adc 0
the happenings, or rather not happenings?
I run the calibration program.. hunkey dorey.. i try chrisl8's arlo-turtle madness and it seems to hang when i communicate with the board.. so i start with the gratuitous print("that worked if you see this") style of troubleshooting, and I find that the moment drive_speed(0, 0); is called to init the drive.. we have cut out.
So, for the sake of argument, I made basic app that sets drive_speed(0, 0) and then sends me a "it worked!" line via the confuser. it indeed hung, no magical "it worked!".. when that was the only other command... I can only conclude, that it did not.. in fact.. work
I had read on chrisl8's blog about a serial issue with a recent linux kernel update.. so i dropped back to his last know working one, with no change
EDIT: forgot to mention the ubuntu version.. haha
ubuntu 14.04.1 x86_64 lts
current kernels tested:
3.19.0-30 (from base ubuntu install)
3.13.0-63 (as chrisl8's last known working) a .06 change!.. was no change!
my cat.. he needs a chasing! thanks guys for any insights you can provide to keep my brain in my head and my cat healthy
edit: related link for future googlers
https://github.com/chrisl8/ArloBot/issues/7
before that.. thanks guys for the pics and work you all did before me sharing how you got yours going.. it's been invaluable. (though it could be useful to mention which pins the activity bot code expects the motors/encoders on as well as the jumper settings/reasons for them in the motor and/or ping documents) i think i killed a ping sensor with a bad jumper setting (totally my fault for bravehearting the build though, haha)
the bot, arlo
uses the motor diagram paint shopped so proudly from these very forums
I have the power distribution board installed
I am using a dual battery config
I have 1, you heard me 1 set of sensors at present. one ir and one ping on the front (wanna make the thing work before I add all the complexity in the world to it right?) (planning on migrating the sensor array to one of my defcon badges anyway.. so none too concerned beyond the initial POC phase)
this is running on the parallax activity board
motor controller left - p12
encoder left - p13
motor controller right - p14
encoder right - p15
ping center 1 - p16
IR via adc 0
the happenings, or rather not happenings?
I run the calibration program.. hunkey dorey.. i try chrisl8's arlo-turtle madness and it seems to hang when i communicate with the board.. so i start with the gratuitous print("that worked if you see this") style of troubleshooting, and I find that the moment drive_speed(0, 0); is called to init the drive.. we have cut out.
So, for the sake of argument, I made basic app that sets drive_speed(0, 0) and then sends me a "it worked!" line via the confuser. it indeed hung, no magical "it worked!".. when that was the only other command... I can only conclude, that it did not.. in fact.. work
I had read on chrisl8's blog about a serial issue with a recent linux kernel update.. so i dropped back to his last know working one, with no change
EDIT: forgot to mention the ubuntu version.. haha
ubuntu 14.04.1 x86_64 lts
current kernels tested:
3.19.0-30 (from base ubuntu install)
3.13.0-63 (as chrisl8's last known working) a .06 change!.. was no change!
my cat.. he needs a chasing! thanks guys for any insights you can provide to keep my brain in my head and my cat healthy
edit: related link for future googlers
https://github.com/chrisl8/ArloBot/issues/7
Comments
What is the smallest piece of code that we can write that breaks?
Then we can post that here, and everyone can try it and see if they get the same results as you do.
I'll start working on it, but if you already know where it breaks maybe you can just start erasing code until you come up with the smallest code that should work but breaks and we'll all try it.
Thanks!
robot still isn't moving, but it's at least moving past that bit
edit: to show my future googlers some love, this is where i obtained it
https://d9d46cb6fc558ba1db5c3aa51f1eb3a56e713404.googledrive.com/host/0B8ruEl5BL0dfZzZfdHRiX2pYNm8/
The only way to use arlodrive.h is to install SimpleIDE 0.9.66
This was reported a long time ago here: http://forums.parallax.com/discussion/160037/build-error-for-arlo-calibrate-help-please but there was no response from Parallax.
Parallax, can you look into this and either fix SimpleIDE or arlodrive.h so that they work together?
Let us know what we can do to help you debug and or test this and we will happily help you.
Thank you!
EDIT: Thanks chronoglass for the link! I've added it to all of my documentation along with a stern warning not to use the latest version of SimpleIDE.
Parallax, let me know when I can take down the warning.
Or better yet, let me know how I can help you debug the issue with arlodrive.h
Sorry that we haven't responded before now. There are several folks in the company that follow the forums, and they do their best to forward links of problems they see to someone who can help. However, the earlier thread got missed because it just isn't possible for these folks to track every issue in every post. I would recommend also sending a link to support@parallax.com if something we have published isn't working right.
It should be pretty easy to correct and recompile the library, but I want to make sure I'm working from the same file as you. Did you download the library from the third post on this page?
http://forums.parallax.com/discussion/comment/1230592#Comment_1230592
Andy
Also, chronoglass, please verify for me that this does displays the message:
Important: For downloading and serial messages to display, I had to open a terminal and enter:
sudo usermod -a -G dialout MyUserName
...where MyUserName is, well..., your username.
A restart of Ubuntu was also required after the terminal usermod.
That was using the examples Arlo IR Controlled Nav and Talk With WAV (Test for SimpleIDE 1.0.zip) with SimpleIDE 1.0.1 RC1 on Ubuntu 64-Bit 14.04.3 after entering sudo usermod -a -G dialout MyUserName into the computer and restarting.
I'm wondering if something went badly with the calibration, which causes the freeze. Could you please run Arlo Display Calibration.side, and paste the SimpleIDE Terminal output into a post? Here is an example of a reasonably healthy terminal output:
http://forums.parallax.com/discussion/comment/1232417/#Comment_1232417
Hope it helps.
I talk all of my frustration back.
chronoglass, keep posting here until you get it working. We all want to help you get it going!
I'd go back to just trying to make basic scripts work, and once you have that down, use my code with the direct serial port testing.
It is always best to keep thing simple until you have it working reliably.
I'm kind of betting on an issue with getting the motors turned on at the right time.
I've done a 1 count.. A 3 count, a 5 10 20.. On to a few mins (went and got a sandwich) ha-ha
Right now I seem to be in a state it won't even return the calibration info.. So I just reran the calibration, full steps.
Flash
Power it all down
Power up main.. Wait a seconsecond
Power motors (observe motion)
Reset activity board
Wait for Amber lights to go bye bye
Will power cycle and try the show calibration again
Agreed, keep working at it chronoglass, and you'll get it working. Our cats used to really make sure our Boe-Bot robots knew who was boss.
but the function seems to never return.. example
drive_speed(10, 10)
left wheel turns
edit: sorry, this is doing both of em, though they are going opposite directions.. heh
drive_speed(0, 10)
right wheel turns
drive_speed(10, 0)
left wheel turns
after each of them I have a print("it worked!"); and I never see it
comment drive_speed out, and i see that it did in fact work heh
and.. wow, they both just decided to go on a joyride with no interaction from me.. glad it was on blocks
Double check your wiring. Use the link Andy posted and also look at how the ActivityBot is wired, because the motor controllers just work in the place of servos.
It could be a simple wiring mistake, which would cause random behavior.
Remember that the last two pins, 14 and 15, are actually the pins used by the servo controllers, so you cannot use them for anything else.
I also have "pull up" resistors on them like shown here: http://learn.parallax.com/activitybot/electrical-connections
I'm not sure if they are required, but if they are and you don't have them, things would act strangely.
P.S. Repeating the link Andy posted: http://forums.parallax.com/discussion/comment/1232417/#Comment_1232417 It is like the de facto "how to wire an Arlo" post.
P.P.S. Also note the position of the jumpers on the Activity Board. It is important.
Scraped off sensors, and gave it a few go's to the same effect.. Its time for some liquid therapy before my head explodes. Ha-ha, back to it tomorrow! Thanks for all of the suggestions folks!
RE: Power
I start by turning all power off. Then:
1) Set Activity Board power to 2
2) Turn on MAIN
3) Wait a second
4) Turn on MOTOR
The reason for this is we want the HB25s to see servo signals as soon as they wake up.
The exception to this sequence would be during calibration. I'd say start with some program that sends servo signals with a drive_speed call in EEPROM and take it through the sequence above. Then, put the Arlo on blocks and leave all power on. Use the Load RAM & Run button with Arlo Calibrate. Verify that the left wheel turns for a while, then the right wheel. Then stop and P26 P27 lights go out. After that, run the calibration display program and post us the numbers.
If there is more than one wiring and/or mechanical prob, we may have to repeat this cycle more than once.
It should make one wheel turn one direction for 3 s, then the other direction for 3 s, then stop. After that, the other wheel does the same motion. Each wheel's encoder states should be reflected by the P26 and P27 LEDs on the Activity Board.
It's similar to something I use this with ActivityBot robots to make sure that the servo and encoder cables are connected correctly. If the connections are correct on the ActivityBot, it causes the left wheel to turn counterclockwise (forward) for 3 s, then clockwise (backward) for 3 s, and the P26 LED flickers as the wheel turns. Then, the right wheel turns clockwise (forward) and then counterclockwise (backward) for 3 s each as the P27 LED flickers. The light for the wheel that's not moving may either be on or off, depending on its encoder state. Likewise, the light for the test wheel may end in either on or off when it's done turning.
If it's moving too fast to see the LED flicker, reduce the speeds from +/- 40 to 30, 25, etc. If it's too slow to get the wheel to move, it is also possible to push the servo harder briefly, for example with servo_speed(12, 100); pause(500) before continuing at the slower speed.
I'm not sure if that's the exact same behavior with an Arlo, and won't have access to one until Monday. Perhaps someone with a working Arlo and stock connections could verify?
I did the sensible thing again (which I had done.. but i must've been following a flawed checklist or something) and disconnected everything, and put it all back together, including resetting jumpers, and reseating power lines.
i am now getting motor love by giving it a 2 count after starting the main board!
looking at my initial post, when i had one wheel turning and not the other, I see that i had the encoders connected to the same "powered" pins as the controller
//this is incorrect
p12-13 set for one motor/encoder pair
p14-15 set for the other
both jumpers set for VIN
//end incorrect part
i NOW have the jumper on p12-13 set to vin and both motors attached there
and the jumper on p14-15 set to 5v and both encoders located there
and p16-17 set to 5v with the first ping attached to p16
it seems to me that these controllers should be able to return a status response of some variety to SAY that they have gone into timeout or shutdown mode so it could be caught with software, and corrected for, but for now.. I'll just be happy with the fact that i have a rolling platform! thank you all for all of the help! now to see how many sensors i can stuff on this thing!
Happy cat chasing!
For me the "solution" to the motor controller init problem was the USB Relay board. It really isn't very expensive, and it lets me program the robot to be, well, a robot, where it automates tasks, including turning on the motor controllers AFTER the Propeller board is running and actively sending "servo" signals.
While things don't always work with the serial connection (that is what that "watchdog" is all about), I never have an issue with the motor controllers not being in the right mode and responding.
This is the relay board I use:
http://www.amazon.com/SainSmart-Eight-Channel-Relay-Automation/dp/B0093Y89DE/ref=sr_1_1?ie=UTF8&qid=1443987391&sr=8-1&keywords=usb+relay
There is also a 4 port version that is smaller slightly less expensive, and I'm sure you can shop around.
Either way though, knowing how to get it going by hand is very important.
ChrisL8 - cool relay board!
Andy - you are the best!
I had the guy moving around a bit.. but the right motor was really intermittent.. I tested a few things (swapped power, the problem stayed on the right, swapped signal, the problem moved)
So i assumed it was calibration related, and decided to redo the calibration.
So if i have the theory correct, the controllers just need to not wake up in safe mode to get the "ball rolling" as it were. I've got the usb relay in the mix now so my calibration process was SLIGHTLY different.
***************edits*************************
edit 1. using this to keep track of what ELSE i've done
i just went and grabbed the libraries from the post mentioned above instead of using the ones that got grabbed from chris' script.. will report back if there is any change
*********************************************
step 1. power everything down
step 2. power on main
step 3. send the calibration program to the PAB
step 4. wait for amber lights then trigger the relay to start the motor controllers
step 5. wait for motor movement
step 6. reset the PAB
step 7. wait for the motors to do their voodoo and the amber lights to go away
step 8. power everything down
step 9. power the board back on
step 10. push the display calibration table code
step 11. watch the terminal for data
step 12. ???
step 13. chase cat
my process is hanging at step 11.
to extrapolate step 11 attempts, I have done the following
1. skip step 8 and go directly to 10
2. insert step 10a. reset PAB with terminal running/waiting
3. leave motors running, reset PAB after pushing displaycalibration code with terminal running
4. cycle motors after resetting pab, after pushing displaycalibration code with terminal running
5. start terminal after a few seconds of displaycalibration code running
6. use "run with terminal"
7. use "load ram and run" with terminal waiting
8. add 20k with of resister across 14 and 15 and try all of the above again
9. use backup PAB and try all of the above again
10. rewire without relay again... (not yet.. but that's about where I am)
#include "abcalibrate.h"
is not the same as
#include "arlocalibrate.h"
scanning em side by side to see if i can find why they are acting differently for me
both the calibration file in the post above and the one included in the arlobot stuff from chrisl8 seem to never actually write their info to the eeprom memory (guessing here, I didn't actually go disect it)
BUT the abcalibrate does.
the arlobot calibrate starts the wheels spinning FAST, then slows down, and reverses up to FAST again.
the left side seems to take much longer than the right
abcalibrate goes through both of them really slowly.. the right side takes a LOOOONG time
arlocalibrate.h is for the Arlo
That seems strange that arlocalibrate isn't working for you. That is what I use, and I think that is what Andy from Parallax uses too.
Are you sure you are giving it time to finish?
Also, remember that once your run the calibration once, it will not write to EEPROM again, no matter how many times you run it!
It only writes to EEPROM the first time.
To run it again you have to reinstall it.
I'm 90% certain it's something on my end, and of course will keep poking around
something just occurred to me, can anyone confirm which side of the encoder boards they are using for each motor? (I don't have all 4 connections plugged in, so maybe I'm not powering one of them(will play swap the sensor when I get home regardless), or it's giving wonkey info and hence not actually calibrating?)
looking at the two calibrate.h files.. the only real difference I am seeing is the encoders and the speeds used.. (not going to lie, there are a few places I got lost jumping back and forth.. but based on the diff it seems to be true)
edit: side note, chris, the arduino code for the 2nd board replacement seems to be pretty stable now and is actually running at full speed! I'm confident enough to let others use it if they feel inclined.
https://github.com/chronoglass/arlo-arduino-sensor_board
Looking to add support for the xv11 and the https://www.sparkfun.com/products/13680 lidar lite modules soonish if I can get away with it
If i run the arlobot calibration I can never run the displaycalibration, it just never does anything.
I've tried replacing the xbee ifdefs with straight serial writes and those aren't coming back to me.. so I started trying wonkey things.
Since I know that the abcalibrate completes, I ran it and looked at the data it's giving me on the display side. and that looks thusly
now i have noticed that it spends about 3 times the time on the left side as the right when calibrating. which lists all of the readings as 0.. or am I crazy, because it shouldn't even be looking at them?
it would appear that the arlocalibrate just silently fails on a busted encoder, but the activitybot code happily churns along (maybe because it's not really expecting encoders?) or again.. has my mind left me?