Society of Robots - Robot Forum

Software => Software => Topic started by: Jdog on January 07, 2009, 03:09:52 PM

Title: Axon Photovore Problem
Post by: Jdog on January 07, 2009, 03:09:52 PM
I'm trying to make the Axon photovore. I uploaded this program to my axon: http://www.societyofrobots.com/axon/downloads/Axon_Source_070408.zip

When I turn it on and press the button my right servo rotates perfectly, but my left servo struggles to spin. I took off the top of my servo and I took out the gears to see if it would still struggle to spin because I had assumed I just did a bad job modding the servo, but it still struggled. I then tested it with a different servo and the same problem happened. This leads me to believe that it is a software problem.
Can the timing in the program be off?
Has anyone ever experienced something like this?
Are both of my servos' circuitry broken?
Title: Re: Axon Photovore Problem
Post by: pomprocker on January 07, 2009, 03:54:47 PM
Swap the header pins that the servos are plugged into, That is if Servo A is plugged into Port/Pin 5 and Servo B is plugged into Port/Pin 6, then plug A into 6 and B into 5. See if the known good servo has this problem. If it does, than it is either a programming problem, or an Axon problem not a servo problem.
Title: Re: Axon Photovore Problem
Post by: Jdog on January 07, 2009, 04:28:18 PM
That's what I did when I said that I tested it with a good one.
Title: Re: Axon Photovore Problem
Post by: Razor Concepts on January 07, 2009, 05:28:37 PM
In the code, find where the left servo and right servo are defined, and switch them. Now if the other servo struggles to spin, it is a code problem.
Title: Re: Axon Photovore Problem
Post by: Jdog on January 08, 2009, 07:10:20 PM
I switched the servo definitions as Razor Concepts had said, and the same servo span, so I think I'm going to change the port to a completely different port to see if it is a problem with the controller itself.
Title: Re: Axon Photovore Problem
Post by: Jdog on January 08, 2009, 07:52:51 PM
Well I figured that out, I don't know what happened but I tried programming it again and it worked so that's good. Now I realized that My wheels are spinning in opposite directions when the robot's trying to go straight. How do I reverse one of the wheels?
Title: Re: Axon Photovore Problem
Post by: Razor Concepts on January 08, 2009, 08:32:22 PM
I think on the Axon, a servo hold (no spin in either way) is a value of 700. So say the value to move foward is 800, but thats the wrong way - so change it to 600 and it should work.
Title: Re: Axon Photovore Problem
Post by: Jdog on January 08, 2009, 10:30:37 PM
Ok, I have the  wheels spinning the way they want to now, but when It's supposed to be going straight, the left wheel moves a little bit slower than the right, making a wide curve.
Title: Re: Axon Photovore Problem
Post by: Admin on January 09, 2009, 12:21:53 AM
Ok, I have the  wheels spinning the way they want to now, but when It's supposed to be going straight, the left wheel moves a little bit slower than the right, making a wide curve.
That just means that the servos aren't modified exactly the same. In the source code you can increase or decrease the servo speed value until its tweaked just right.
Title: Re: Axon Photovore Problem
Post by: Jdog on January 09, 2009, 08:35:38 PM
Ok, I have the  wheels spinning the way they want to now, but when It's supposed to be going straight, the left wheel moves a little bit slower than the right, making a wide curve.
That just means that the servos aren't modified exactly the same. In the source code you can increase or decrease the servo speed value until its tweaked just right.
I tried that.
I put the right servo at 602, and the left one at 800, and it still runs slower. (I have the servos plugged into different ports so the code is a little different.)
Title: Re: Axon Photovore Problem
Post by: Admin on January 09, 2009, 08:43:08 PM
You'll have to tweak that value a bit more than that.

It's impossible however to get both wheels *exactly* the same. You'll have to use sensors like a gyro or encoder to match the speeds, but even then there will *always* be some % of error.
Title: Re: Axon Photovore Problem
Post by: Jdog on January 09, 2009, 08:44:18 PM
Ok thank you all for your help.