Run ActivityBot C Code in the Arlo!
![NikosG](https://forums.parallax.com/uploads/userpics/Q9GJURHCQI0N/nDHKRCE6L2Z8D.jpg)
Hello everybody,
Ken announced on Parallax insider News that the Andys Arlodrive is ready for use! Does anyone tried to run any code from ActivityBot into an Arlo robot or any other large robot with Arlos motor and wheel kit?
Where we can found the arlodrive.h? What exactly steps we must follow in order to use this new ability?
Any diagram in order to connect the encoders with the HB-25 end the Propeller Activity Board?
I hope that Andy has given parameters in his code on characteristics like: wheel diameter, turning radius and speed in order to give the opportunity to users with other large robots (not necessary Arlo robots) to take the benefits of his code!
Nikos
Ken announced on Parallax insider News that the Andys Arlodrive is ready for use! Does anyone tried to run any code from ActivityBot into an Arlo robot or any other large robot with Arlos motor and wheel kit?
Where we can found the arlodrive.h? What exactly steps we must follow in order to use this new ability?
Any diagram in order to connect the encoders with the HB-25 end the Propeller Activity Board?
I hope that Andy has given parameters in his code on characteristics like: wheel diameter, turning radius and speed in order to give the opportunity to users with other large robots (not necessary Arlo robots) to take the benefits of his code!
Nikos
Comments
Apologies for it not being uploaded to that web page - it's attached to this post.
Ken Gracey
No problem, Thought it might have been posted on the Learn site but could not find any Libs with a recent change date. Looking forward to giving this a try when I get back. Already downloaded and got it loaded in SimpleIDE.
Thanks for the update!
Dave
but that just made it go in a circle. I actually had to change it to
to make it go forward. I suppose this is because one of the encoders has to be installed in reverse from the other. Going to have to look up some of the ActivityBot examples now.
Thanks Ken!
I have both Blue wires going to M2 on each HB25 and each Red wire going to M1. So each is wired the same unless they are wired wrong inside the motor. I can reverse one so that Red=M1/Blue=M2 and Red=M2/Blue=M1 and check that.
Alright reversed the polarity on one of the motors then re-ran the calibration and now all is well, a +/+ drives forward and -/- reverse.
Edit:
For others, the way I have it setup now is:
Left Motor
Red=M1
Blue=M2
Right Motor
Red=M2
Blue=M1
(Left and Right are figured while looking at Alro with the Parallax logo on the base of Arlo pointing at you)
I think is useful to make clear which one is the Motor Left and which one is the Motor Right.
Instead of Motor 1 and Motor 2 use Motor Left and Motor Right. For instance when you said Motor 1 you mean the Left or the Right motor?
I edited the post to be clear on that.
Don't reverse the + and - power on the HB-25's. Only reverse the outputs (that are connected to the motors).
That's the bi-directional output to the motors (I know you know this, but it's for others that may come across this thread that might not).
...and for the record, every Arlo I've ever built gets *stolen* by somebody in this building - I don't have one that's functional right now...I'll fix that on Friday :thumb:
so that I've got test-case machine too! -Perfect.
-MattG
Yep, Just reversed the M1/M2 terminals as noted. To also avoid confusion, the Red/Blue are wires from the Parallax Wheel Kit. Problem was resolved after doing this, just wanted to document it for others.
I can see that being a problem, At least they are fun to build!
Hi Matt,
I' m trying to build an Arlo Robot with the motors from the MadeUSA Robot Base Kit.
I replaced the old encoders with the NEW 36-position Quadrature Encoder Set
The old motors wires was yellow and Blue, The NEW Arlo motors have blue and Red wires.
Can you tell me please in wich cable correspondence the blue and the Red ?
If you want to figure this out before Matt responds, you can wire them up assuming Yellow=Red. If you are wrong when you send a +/+ command to go forward and it goes in reverse you just have to reverse each side and you are good. As Matt said, just do not reverse the input power (From the battery) on the HB25's.
What mode of operation do you use for the HB-25s Connections ?
Mode -1 or Mode-2 ?
I suppose that we must use the mode-1 because the Propeller Activity Board uses two pins in order to control the servos.
Have I right?
Yeah you have to use Mode 1 with this code. Just figure each HB25 is a 'Servo' in the example above.
None go to the HB25, I ran the A line to the Activity Board and left the B line unplugged for now. The code as it is now does not support the quad encoders yet, I hear its coming some day but for now I just used the one side.
Dave
according what you said, you and Matt (post #12) ,
the Arlo wiring diagram in order to run the Andy's Arlodrive must be the next?
I've just verified your diagram with an Arlo in Ken's office, and they match! So yes, your diagram is correct.
Jessica
Happy new year!!!!
Im trying to create a big differential robot using the benefits of the ActivityBot and the Andys Arlodrive code. I use the Eddie motors instead of Arlo motors but I replaced the old encoders with the new 36 position encoders. As Ken said in this thread Arlo motors are about 100 RPM but Eddie motors are about 150 RPM. Is this a problem? Must I change any parameter on arlodrive code?
Nikos
The library will hopefully work as-is. I'd say try it out (unmodified) and let us know how it goes. Make sure to run the calibration code first, and let it completely finish with P26 and P27 LEDs turning off. Then, try some navigation code.
Although it should work, it'll probably work better with some tuning. I usually use Control System Test and Display.side, which is in the zip, to monitor and display frequency and magnitude of position errors with an XBee. I also go back and forth between testing with that and updating libarlodrive -> arlodrive.c. There's some additional info in Control System Test and Display.side, but it's pretty terse. Let me know when you get to that point, and I'll supply details and clarifications as needed.
Andy
and Happy New Year!!!
Thank you for your Alrodrive code!
This new ability is very promising! I’m looking forward to finish my new Robot in order to test your code. Unfortunately I have some technical problems with my 3d printer but I hope that I’ll overcome the problem soon and my Robot will be ready to test the Arlodrive.
Of course you will have feedback, I’m sure that I’ll have a lot of questions.
Nikos
Dear Andy,
Your Arlodrive Library code is excellent! Congratulation for another time!
Few lines of code in conjunction with Parallax Hardware were enough to make my robot (The Artist) to do amazing things! The accuracy and the control of the robot’s movement are Amazing!!!!
I have 3 questions:
1) When will be ready the drive_distance (int left, int right) Function?
(At the moment I use the drive_goto as you suggest in the help Documentation)
2) I want to use for the “Artist” brain, the Propeller Boe of Education Instead of the Propeller Activity Board. Can I use the Arlodrive with PropBOE? (Is it compatible with the "Arlo robot philosophy"?The problem is that I must use different pins for the servos. Isn’t it? (So I tried to use for servo Pins the 18,19 that has the PropBOE instead of the 12,13 that uses the Activity Board). So I used your function: drive_servoPins (18,19) in order to change the servo pins but I had not result. Why? Can you give an example please?
3) The version of Arlo Library that I have is the V0.5 . Which is the current version? Have you release a newer version from the v0.5? Will be freeware and the new versions?
Thank you,
Nikos Giannakopoulos
Hey, that's great! I'm really glad to hear it's working, and thank you very much for the favorable comments.
(1) The abdrive and arlodrive library updates have been rescheduled a couple times, but I'm confident I'll get to start making adjustments soon. I'll let you know as soon as drive_distance is ready. Sorry for the delay. In the meantime, use drive_goto for straight lines and turning in place. In the next set of updates, drive_goto will be modified to support curves. For now, curves can be executed with drive_speed(a, b), where a > b or or b > a, and just make sure to run it for a certain amount of time.
(2) Have you tried making drive_servoPins(18, 19) the very first call in your main function? If you call it before any calls to drive_speed, it should work. If not, please let me know, there are some other things we can try.
(3) No updates yet, 0.5 is current.
Andy
I put the drive_servoPins(18, 19) first command in my main function but I had no result.
I suspect that the problem is on the procedure or calibration .. Must I do again the calibration? I did it, but the robot had no reaction during the calibration procedure with the PropBOE board.
In the newer version of the Arlodrive can you add two functions ?
The move_to(x, y) in order yo Move directly to the point (x, y).
And the arc_to(x, y, radius) '' in order to move to the point (x, y) via an arc of the specified radius ..something like the S2 code
it would be very convenient for many people .....
Nikos Giannakopoulos
The arlodrive library is designed so that you should only have to call drive_servoPins(18, 19) once. (Assuming calibration has been completed.) Programs after that should automatically use P18 and P19. If that doesn't work for you, please let me know so that I can add it to my repair list.
Great idea on move_to(x, y) and arc_to(x, y). On move_to(x, y), do we want to execute that in a polar coordinates fashion? If that's the case, move_to would convert (x, y) into (r, theta). It would first turn by theta, and then go in a straight line distance of r. Is that what you had in mind?
Andy
There is a problem when I try to add the "servo_pins(18, 19)" in my Arlo Calibrate program:
Why happens this?
That I have in mind is: When I give for example: move_to(1000, 50) I want the robot to move to a point 1000 to the right and 50 above the origin.
and when I give arc_to(1000, 50, -100) 'Move to the point 1000 to the right and 50 above the origin in a clockwise arc of radius 25.
Exactly as the functions s2_move_to and s2_arc_to in S2.spin
Of course these function must do the job of "move_by" and "arc_by" functions....
Nikos Giannakopoulos
Use servo_pins(18, 19) with the arlocalibrate library, not drive_servoPins(18, 19). For now, only use drive_servoPins with arlodrive. I will correct this in the next revision so that both arlocalibrate and arlodrive use the same function names.
Andy
I was completely heedless! Now everything is Ok!
The calibration with Propeller Boe was successful !