View previous topic :: View next topic |
Author |
Message |
hillcraft
Joined: 22 Sep 2003 Posts: 101 Location: Cape Town (South africa)
|
Purpose of the project |
Posted: Sun Oct 16, 2005 10:09 pm |
|
|
Is this a hobby project?
What have you accomplished to date? |
|
|
yannp
Joined: 12 Oct 2005 Posts: 13
|
|
Posted: Mon Oct 17, 2005 9:28 am |
|
|
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
|
|
Posted: Mon Oct 17, 2005 10:33 am |
|
|
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
|
|
Posted: Mon Oct 17, 2005 12:34 pm |
|
|
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
|
|
Posted: Mon Oct 17, 2005 2:45 pm |
|
|
<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
|
RE |
Posted: Mon Oct 17, 2005 10:09 pm |
|
|
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
|
|
Posted: Tue Oct 18, 2005 8:58 am |
|
|
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
|
|
Posted: Tue Oct 18, 2005 9:17 am |
|
|
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
|
|
Posted: Tue Oct 18, 2005 9:43 am |
|
|
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
|
|
Posted: Tue Oct 18, 2005 10:12 am |
|
|
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
|
|
Posted: Tue Oct 18, 2005 1:55 pm |
|
|
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
|
|
Posted: Tue Oct 18, 2005 2:05 pm |
|
|
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
|
|
Posted: Tue Oct 18, 2005 2:39 pm |
|
|
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
|
|
Posted: Tue Oct 18, 2005 2:51 pm |
|
|
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
|
|
Posted: Tue Oct 18, 2005 2:59 pm |
|
|
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/ |
|
|
|