CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Driving lots of servos for a robot
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hillcraft



Joined: 22 Sep 2003
Posts: 101
Location: Cape Town (South africa)

View user's profile Send private message Send e-mail Visit poster's website

Purpose of the project
PostPosted: Sun Oct 16, 2005 10:09 pm     Reply with quote

Is this a hobby project?

What have you accomplished to date?
yannp



Joined: 12 Oct 2005
Posts: 13

View user's profile Send private message

PostPosted: Mon Oct 17, 2005 9:28 am     Reply with quote

I am making a bipedal walker, similar to KHR1:

http://robosavvy.com/Home/1

I am an IT teacher and hope to use it to demonstrate control....
Ttelmah
Guest







PostPosted: Mon Oct 17, 2005 10:33 am     Reply with quote

Consider using the RS232 driven five servo control chips, that I already posted details of, and implement one for each 'leg' and perhaps another for the body movements. You will find it easier to build a 'leg' assembly, that just receives power, and position for it's servo 'set', than trying to control all the servos from one chip. Another alternative, would be a high speed I2C or asynch bus, sending a 'packet', with each value corresponding to the position for one servo, then adding a small pic which controls a single servo from this. This will give better demonstrability, since you can build from showing the one chip receiving a data byte, and positioning it's servo according to this, then move onto building the entire packet, with the positions for each, This is the approach used in most commercial systems, since it reduces the cost with a lot of repeated parts.

Best Wishes
yannp



Joined: 12 Oct 2005
Posts: 13

View user's profile Send private message

PostPosted: Mon Oct 17, 2005 12:34 pm     Reply with quote

If I used four sets of servos, each set was a 232 driven 5 servo limb, how would I communicate with the 4 sets, I thought I could only really use 1 com pin on the PIC. Also where are the details of the 5 servo controller?

Thanks.
Ttelmah
Guest







PostPosted: Mon Oct 17, 2005 2:45 pm     Reply with quote

<http://www.sourceresearch.com/elab/EDEFT639.cfm>

The standard chips, offer one hardware serial port, but you can implement any number (limited only by pins), of software serial connections. Alternatively, you can use a chip that has two UARTs, or add external UARTs using a chip like the Max3100. You could also just multiplex the hardware port.

Best Wishes
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE
PostPosted: Mon Oct 17, 2005 10:09 pm     Reply with quote

Hello All,

Or you could use several PICs (five in all) to control the system, each PIC being 'intelligent' by itself.

thanks
arunb
yannp



Joined: 12 Oct 2005
Posts: 13

View user's profile Send private message

PostPosted: Tue Oct 18, 2005 8:58 am     Reply with quote

Is there any sample code for 4 serial pins on a chip? I'm using 16c74a....

Thanks,
asmallri



Joined: 12 Aug 2004
Posts: 1636
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Oct 18, 2005 9:17 am     Reply with quote

Interesting ideas.

You could have a master controller that you communicate with via RS232 and multple slaves that communcate to the master over the SPI bus at 10Mbps. I would be inclined to do this rather than mess around with multiple serial ports implemented in software.

Alternatively use the I2C bus, this is slower but saves having separate chip selects and you can keep expanding devices.

How about the CAN bus or if you really want to take a walk on the wild side, a wireless add hoc network configuration. In this case your limbs do not even have to be attached to a common body. etc etc....

I also like the approach of multiple PICS, one per servo. You could use the little PIC10F devices and enter Microchips current competition with this innovative approach.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Oct 18, 2005 9:43 am     Reply with quote

Quote:
I also like the approach of multiple PICS, one per servo.
I like this idea too. Instead of just implementing commands for 'move to new position' you can use the PICs for more advanced commands as well, for example: 'move to position x with speed y'. This will reduce the number of commands required for a complex movement by at least an order of magnitude and makes the move more natural.
Ttelmah
Guest







PostPosted: Tue Oct 18, 2005 10:12 am     Reply with quote

On the 'code for four serial ports' question, just define multiple streams on the pins you want. there have been dozens of examples posted here in the past.
However I definately 'favour' the idea of some type of distributed processing. You could relatively easily have a single serial link running at a good fast data rate like 38K4, and use RS485 drivers for longer links if the noise is bad, or otherwise just use the TTL connection directly. Though using one chip per motor sounds good, I think it'd probably be easier/better to consider something like the little pulse train decoder circuit I already posted a link to, and a single PWM output from a PIC. A 16F628, could receive the serial train, and generate the train to control six servos this way. The command format can be very simple, and could have a 'moving' signal sent on a single line from each controller, to say a command has been seen, and is being responded to. If each of the 'control' PICs, has an ID, settable with a couple of external inputs and jumpers, and the control stream contains an 'ID' to identify which chip to control, then a stream of perhaps 40 bytes, could set the position for 18 servos, and at this data rate, could have them all updating in about 1/100th second. the big advantage is how little work the core processor has to do, leaving it the time to respond to sensors, and work out where the motors want to be going to.

Best Wishes
yannp



Joined: 12 Oct 2005
Posts: 13

View user's profile Send private message

PostPosted: Tue Oct 18, 2005 1:55 pm     Reply with quote

If I use a 16c74a for a master controller that can send out a command from the serial port, can I connect four other pics to that same connection and each one reacts to a certain header string? Would this work or would each slave pic need a dedicated pin from the master for handshaking purposes?
newguy



Joined: 24 Jun 2004
Posts: 1911

View user's profile Send private message

PostPosted: Tue Oct 18, 2005 2:05 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=23953

The code found at the link should give you an idea of how to react to only a certain message so that multiple PICs can receive the same data string, and only react to the message that is intended for a specific one.
yannp



Joined: 12 Oct 2005
Posts: 13

View user's profile Send private message

PostPosted: Tue Oct 18, 2005 2:39 pm     Reply with quote

I'll try to combine this with some servo control code.....

Now then, a nice piece of code for servos.... any suggestions?

Cheers
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Tue Oct 18, 2005 2:51 pm     Reply with quote

yannp wrote:

Now then, a nice piece of code for servos.... any suggestions?


Suggestion: if you know C, you can write a nice servo code in half a day. What one writes oneself is always nicer than what one finds on the web random-assly.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Tue Oct 18, 2005 2:59 pm     Reply with quote

Distributed control is an extremely interesting topic. MIT "insect lab" have made several robots called Genghiz, Atilla and Hannibal, which had one controller per leg and didn't have a very distinct central controller.

http://groups.csail.mit.edu/lbr/hannibal/
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group