Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

RC servo on Bioloid bus.

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
8 postsPage 1 of 1
8 postsPage 1 of 1

RC servo on Bioloid bus.

Post by billyzelsnack » Wed Nov 25, 2009 9:59 pm

Post by billyzelsnack
Wed Nov 25, 2009 9:59 pm

I modified Jon Hylands bioloid-io code to put a servo on the bus. He already did 99% of the code work for me so the changes were very small.

phpBB [media]


I just barely got this working, but I plan on adding support for two servo ( for my pan-tilt camera control ) as well as taking gyro and accel data and returning kalman filtered results. Funny enough the gyro and accel data will come from Jon's IMU. The CM-5 using roboplus task will read in the data from the IMU and then write that data to this device. The roboplus task will then read the results back. Kinda silly going back and forth like that, but roboplus task can't do any real math.

Here's the code..
http://www.mediafire.com/?sharekey=e01a ... 998cb4ca21


(here's the pan-tilt in action)
phpBB [media]
I modified Jon Hylands bioloid-io code to put a servo on the bus. He already did 99% of the code work for me so the changes were very small.

phpBB [media]


I just barely got this working, but I plan on adding support for two servo ( for my pan-tilt camera control ) as well as taking gyro and accel data and returning kalman filtered results. Funny enough the gyro and accel data will come from Jon's IMU. The CM-5 using roboplus task will read in the data from the IMU and then write that data to this device. The roboplus task will then read the results back. Kinda silly going back and forth like that, but roboplus task can't do any real math.

Here's the code..
http://www.mediafire.com/?sharekey=e01a ... 998cb4ca21


(here's the pan-tilt in action)
phpBB [media]
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Looks Good

Post by profmason » Thu Nov 26, 2009 11:06 pm

Post by profmason
Thu Nov 26, 2009 11:06 pm

The code looks good. You updated the bioloid-io.c module to use the high resolution timer, added a new functions pwm_set and pwm_init to handle and set the servo and commented out the motor.c module. Folks will still need the rest of Jon and Davids Bioloid IO code from their repository.

I have been working on a generic IO board as well starting from the same code base. I appreciate you sussing out the settings for the 16bit timer. I had it on my list to sit down with the datasheet one of these days. I couldn't get close enough to 20ms with the low resolution timer.

Any problems with any of the other IO when you changed the timer? (I wouldn't expect it.) Any ideas on how to get the second servo working in this mode? Can you just use com1a1? Or is this out because of the high resolution timer? Maybe I will have to look at the datasheet after all, or go back to the 8 bit timer? I will give this a test over the weekend.

Thanks for this!
mmason
The code looks good. You updated the bioloid-io.c module to use the high resolution timer, added a new functions pwm_set and pwm_init to handle and set the servo and commented out the motor.c module. Folks will still need the rest of Jon and Davids Bioloid IO code from their repository.

I have been working on a generic IO board as well starting from the same code base. I appreciate you sussing out the settings for the 16bit timer. I had it on my list to sit down with the datasheet one of these days. I couldn't get close enough to 20ms with the low resolution timer.

Any problems with any of the other IO when you changed the timer? (I wouldn't expect it.) Any ideas on how to get the second servo working in this mode? Can you just use com1a1? Or is this out because of the high resolution timer? Maybe I will have to look at the datasheet after all, or go back to the 8 bit timer? I will give this a test over the weekend.

Thanks for this!
mmason
profmason
Robot Builder
Robot Builder
Posts: 7
Joined: Tue Oct 27, 2009 1:38 am

Post by billyzelsnack » Fri Nov 27, 2009 6:07 pm

Post by billyzelsnack
Fri Nov 27, 2009 6:07 pm

I was working on the second servo last night, but my knowledge of cryptic avr timers is minimal. I hope to have it working today though. I'll post the code when it's done.

As far as interference with the IO. I dunno.
I was working on the second servo last night, but my knowledge of cryptic avr timers is minimal. I hope to have it working today though. I'll post the code when it's done.

As far as interference with the IO. I dunno.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Fri Nov 27, 2009 8:01 pm

Post by billyzelsnack
Fri Nov 27, 2009 8:01 pm

ok. I have two servos working now. Here's the code..

http://www.mediafire.com/?sharekey=e01a ... aacf568dab
ok. I have two servos working now. Here's the code..

http://www.mediafire.com/?sharekey=e01a ... aacf568dab
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Sat Nov 28, 2009 4:59 am

Post by billyzelsnack
Sat Nov 28, 2009 4:59 am

phpBB [media]


I've run into a hitch. As soon as a motionpage is set I can no longer communicate with my board. I'm not sure why. I wonder if I need to do my work inside the callback.

Update: Nope. Looks like you can only do reads inside a callback.

Update2: So it looks like I can write to AX-12's after a motionpage load so I have no idea why I can't write to my board after a motionpage load. Anybody have ideas?
phpBB [media]


I've run into a hitch. As soon as a motionpage is set I can no longer communicate with my board. I'm not sure why. I wonder if I need to do my work inside the callback.

Update: Nope. Looks like you can only do reads inside a callback.

Update2: So it looks like I can write to AX-12's after a motionpage load so I have no idea why I can't write to my board after a motionpage load. Anybody have ideas?
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Sun Nov 29, 2009 12:08 am

Post by billyzelsnack
Sun Nov 29, 2009 12:08 am

Phfeww. Got it working.

http://www.mediafire.com/?sharekey=e01a ... af670496da

Looks like some of the other bioloid-io code that I was not using was messing with the pins ( as it's supposed to!) I just commented all the original functionality out and its working even when a motionpage is set now.

phpBB [media]
Phfeww. Got it working.

http://www.mediafire.com/?sharekey=e01a ... af670496da

Looks like some of the other bioloid-io code that I was not using was messing with the pins ( as it's supposed to!) I just commented all the original functionality out and its working even when a motionpage is set now.

phpBB [media]
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Mon Nov 30, 2009 4:40 am

Post by billyzelsnack
Mon Nov 30, 2009 4:40 am

More progress.

phpBB [media]


Here's the camera test tsk..
http://www.mediafire.com/?sharekey=e01a ... 8345cbe4ce
More progress.

phpBB [media]


Here's the camera test tsk..
http://www.mediafire.com/?sharekey=e01a ... 8345cbe4ce
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by PeterKesel » Mon Nov 30, 2009 7:46 am

Post by PeterKesel
Mon Nov 30, 2009 7:46 am

Excellent video.Got it working is good.

Fog Light
Excellent video.Got it working is good.

Fog Light
PeterKesel
Newbie
Newbie
Posts: 5
Joined: Sat Oct 24, 2009 5:07 am


8 postsPage 1 of 1
8 postsPage 1 of 1