This little beast is a highly featured piece of kit. It's not the cheapest servo money can buy, but it is certainly very versatile, and delivers a serious bang for your buck.
Feedback for position, temperature, load, voltage etc
It is really mechanically sound too, and comes with a mounting plate, a bracket to fit to the spindle and plenty of nuts and bolts to bolt it all together. It has been designed so that one servo canbe mounted on the spindle of another so you can do multple degrees of freedom just by mounting them on eachother.
I've tried the library and 'Hello World' out on my AX12+ and I'm having some issues getting it going. It's powered up with a separate 9v supply and wired as above, however, all I'm getting is a 'click' and the LED on the back flashing once (at the same time). I've tried two different servos and on different serial pins but I'm getting the same issues on all of them.
I'll have a more detailed look myself when I get the chance, just wondering if you had any insights for a possible cause.
Joe
I've tried the library and 'Hello World' out on my AX12+ and I'm having some issues getting it going. It's powered up with a separate 9v supply and wired as above, however, all I'm getting is a 'click' and the LED on the back flashing once (at the same time). I've tried two different servos and on different serial pins but I'm getting the same issues on all of them.
I'll have a more detailed look myself when I get the chance, just wondering if you had any insights for a possible cause.
Joe
Had another play with the servo earlier and found out that it is actaully moving, just very small increments with each command. Commenting out the SetGoal(240); showed that the servo is moving towards 60 degrees just very slowly, one small increment at a time. I tried a mode 1 with a speed of 1 and I get exactly the same issue. The servo is moving, just a ting amount each time it receives a signal.
Any ideas?
Joe
Had another play with the servo earlier and found out that it is actaully moving, just very small increments with each command. Commenting out the SetGoal(240); showed that the servo is moving towards 60 degrees just very slowly, one small increment at a time. I tried a mode 1 with a speed of 1 and I get exactly the same issue. The servo is moving, just a ting amount each time it receives a signal.
Any ideas?
Joe
However, I'm having trouble with the following code. I think my hardware is good because the attached motor is moving as directed. The problem is the reported position is always reporting 160 degrees instead of the actual position. I suspect something with the AX-12A. Maybe something needs to get initialized for position reports to work? Any ideas?
This is a brand new AX-12A that I just started using yesterday.
The AX12 class is really nice - thanks so much.
However, I'm having trouble with the following code. I think my hardware is good because the attached motor is moving as directed. The problem is the reported position is always reporting 160 degrees instead of the actual position. I suspect something with the AX-12A. Maybe something needs to get initialized for position reports to work? Any ideas?
This is a brand new AX-12A that I just started using yesterday.
Thanks,
Jim
<<code>>
#include "mbed.h"
#include "AX12.h"
DigitalOut myled(LED2);
AX12 myax12( p9, p10, 1 );
void vPrintPos( void );
int main() {
while (1) {
myax12.SetGoal( 150 );
myled = 1;
wait( 1 );
vPrintPos();
wait ( 1 );
myax12.SetGoal( 130 );
myled = 0;
wait( 1 );
vPrintPos();
wait ( 1 );
}
}
void vPrintPos( void ) {
float fPos = myax12.GetPosition();
printf( "Pos = %f\n", fPos );
}
<</code>>
= Position Request =
{{/media/uploads/jimk3038/pos_req.jpg}}
= AX-12A Response =
{{/media/uploads/jimk3038/pos_reply.jpg}}
Maybe a stupid question, have you already tried to get other values
GetTemp GetVolts, do they gives the right value ?
oops, when i am looking at your beautiful analyzer output, the return value=1FF > 511*300/1024=150 thats the position you send to the servo ??
Maybe a stupid question, have you already tried to get other values
GetTemp GetVolts, do they gives the right value ?
oops, when i am looking at your beautiful analyzer output, the return value=1FF > 511*300/1024=150 thats the position you send to the servo ??
Sorry to say this but I've found some serious problems with this class. The AX12::read() function has problems. To prove this to yourself, try adding a bit of code to clear the whole "Status" array before actually receive characters. This should not affect anything - but it does! So, for this code to work, multiple calls must be made to AX12::read() so that previous results combine with new results in the Status array.
Also, there are lots of missing function in this class. There is no way to set the torque maximum as an example.
I started over and wrote my own source code in plane old C. I can post the source if people are interested.
Jim
Sorry to say this but I've found some serious problems with this class. The AX12::read() function has problems. To prove this to yourself, try adding a bit of code to clear the whole "Status" array before actually receive characters. This should not affect anything - but it does! So, for this code to work, multiple calls must be made to AX12::read() so that previous results combine with new results in the Status array.
Also, there are lots of missing function in this class. There is no way to set the torque maximum as an example.
I started over and wrote my own source code in plane old C. I can post the source if people are interested.
Jim
Hi Jim,
I've got the same issue you described. The reported position is always 160 degrees, independent from the actual position the servo is at. Did you manage to find the bug? I really would be interested at your c-code.
Thanks, Benny
Hi Jim,
I've got the same issue you described. The reported position is always 160 degrees, independent from the actual position the servo is at. Did you manage to find the bug? I really would be interested at your c-code.
Thanks, Benny
OK, I finally got off my butt and posted some source code. Have a look at the following link: http://ph-elec.com/content/mbed-ax-12a-servo-motor-hacking
Let me know if you have any problems.
Thanks,
Jim
Nice work Jim, any chance of wrapping this up into a new library?
Yeah, thanks for your work Jim! I haven't been able to test your code yet, since I'm dealing with some other issues right now... When I get to it I will let you know if it works for as well, though.
Benny
<<quote ms523>>
Nice work Jim, any chance of wrapping this up into a new library?
<</quote>>
Yeah, thanks for your work Jim! I haven't been able to test your code yet, since I'm dealing with some other issues right now... When I get to it I will let you know if it works for as well, though.
Benny
Please login to post comments.