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

Using two SYNC_WRITE instructions

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

Using two SYNC_WRITE instructions

Post by freeforall » Tue May 22, 2007 9:30 pm

Post by freeforall
Tue May 22, 2007 9:30 pm

Hello

When I send two SYNC_WRITE instructions successively (in a C program), the Bioloid only executes the second one.

Is there any way to make the robot execute the second instruction exactly after the end of the execution of the first one?

Thank you.
Hello

When I send two SYNC_WRITE instructions successively (in a C program), the Bioloid only executes the second one.

Is there any way to make the robot execute the second instruction exactly after the end of the execution of the first one?

Thank you.
freeforall
Robot Builder
Robot Builder
User avatar
Posts: 19
Joined: Sat Nov 11, 2006 1:00 am

Post by JonHylands » Tue May 22, 2007 10:41 pm

Post by JonHylands
Tue May 22, 2007 10:41 pm

It probably does, but if you don't give it time to move the servos to the position specified in the first, it will effectively just execute the second.

You need to figure out how long it will take to move each servo to the new location, and pause that long before sending the next command.

- Jon
It probably does, but if you don't give it time to move the servos to the position specified in the first, it will effectively just execute the second.

You need to figure out how long it will take to move each servo to the new location, and pause that long before sending the next command.

- Jon
JonHylands
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 512
Joined: Thu Nov 09, 2006 1:00 am
Location: Ontario, Canada

Post by freeforall » Tue May 22, 2007 10:46 pm

Post by freeforall
Tue May 22, 2007 10:46 pm

ok. But how can I pause? Is there any function for that?
ok. But how can I pause? Is there any function for that?
freeforall
Robot Builder
Robot Builder
User avatar
Posts: 19
Joined: Sat Nov 11, 2006 1:00 am

Post by billyzelsnack » Tue May 22, 2007 11:55 pm

Post by billyzelsnack
Tue May 22, 2007 11:55 pm

Say you want to send this set of positions to a servo.

100
500
100

If you sent all 3 packets immediately the servo would pretty much skip the 500 because it never had any time to make it to 500. To "pause" you just wait before you send another packet.
Say you want to send this set of positions to a servo.

100
500
100

If you sent all 3 packets immediately the servo would pretty much skip the 500 because it never had any time to make it to 500. To "pause" you just wait before you send another packet.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by freeforall » Wed May 23, 2007 7:46 am

Post by freeforall
Wed May 23, 2007 7:46 am

yes I understood. but I don't know how to make a pause. there is no function for that. In <windows> for example there the function Sleep() but I can't use it for the Bioloid. If you know a function that I can use to make a pause please let me know.
thank you
yes I understood. but I don't know how to make a pause. there is no function for that. In <windows> for example there the function Sleep() but I can't use it for the Bioloid. If you know a function that I can use to make a pause please let me know.
thank you
freeforall
Robot Builder
Robot Builder
User avatar
Posts: 19
Joined: Sat Nov 11, 2006 1:00 am

Post by Bullit » Wed May 23, 2007 11:28 am

Post by Bullit
Wed May 23, 2007 11:28 am

freeforall you might want to lookhere for some library functions.
WinAVR contains a include delay.h you'll want to look at and _delay_ms function. Make sure you define F_CPU to 16E6 for the CM-5. and before the include of delay.h.
freeforall you might want to lookhere for some library functions.
WinAVR contains a include delay.h you'll want to look at and _delay_ms function. Make sure you define F_CPU to 16E6 for the CM-5. and before the include of delay.h.
Bullit
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 291
Joined: Wed May 31, 2006 1:00 am
Location: Near robot

Post by freeforall » Wed May 23, 2007 10:02 pm

Post by freeforall
Wed May 23, 2007 10:02 pm

Actually, I've already tried this function but it didn't work and I can't figure out why. In delay.h, I replaced #define F_CPU 1000000UL with # define F_CPU 16E6 but it doesn't work. I don't really know where the problem comes from. So if you have any ideas to help me I'd be grateful.

Thank you
Actually, I've already tried this function but it didn't work and I can't figure out why. In delay.h, I replaced #define F_CPU 1000000UL with # define F_CPU 16E6 but it doesn't work. I don't really know where the problem comes from. So if you have any ideas to help me I'd be grateful.

Thank you
freeforall
Robot Builder
Robot Builder
User avatar
Posts: 19
Joined: Sat Nov 11, 2006 1:00 am


7 postsPage 1 of 1
7 postsPage 1 of 1