Custom Servo Controller board

Hi guys, I am trying to build a SSC board and I am not sure which way to go. There are 2 options right now:

  1. Build a SSC-32 board with a mega8 and use the existing code for it, connect it to another mega168 that will be the central brain of the bot.
  2. Build a slighty different board using a mega128 (and new code) to have just one big microcontroller as the brain for the bot.

My questions are:

  • is it hard to port the code from Code Vision to WinAVR? and to change it so it doesn’t use the shift registers?
  • is it worth it to have an all in one microcontroller brain?
  • I am going to use an AVRcam for vision, can it share the serial port with the SSC-32 board?
  • how is inverse kinematics working for a biped?

I am better at electronics than at programming and I am building a biped Pete or Nick, depending on funds…

Thank you for any info you can give me.
Gabe.

Note, the SSC-32’s bootloader and firmware were made open source in an attempt to receive, manage, support, and distribute user submitted alternate flavors of firmware for OUR hardware. We’re not really crazy about people making their own PC boards and using our code for it. You gotta wonder what’s in it for us?

There is nothing in it for LM which is why support for such a project should not be provided. However, there is nothing wrong if the design is their own, and they write their own code for it.

Personally, I feel it’s much better to just get the SSC-32. Why reinvent the wheel?

Just my .03 cents…

meh, he is probably trying to integrate the ssc-32 functionality into a larger hardware assembly without having to re-write the software. of course the next thing being asked is how to port platforms and change the way it works so you have got to wonder what the point is. :unamused:

What’s the point? :smiley:

What is the point? Maybe learn something in the process… Since money is a big issue, making a board that I understood is open source may lead to a better practice and understanding of electronics. For me it is easier to build stuff than program. As each one of us I like most of the SSC-32 features but wish I has something that would fit my project better. I understand that as a company that produces robotic parts they have to be universal so they will not make happy all the possible customers. But there I thought was this open source thing coming handy. Anyone can make a customised board for it’s personal use based on an open source desing but they have to give credit for the person who created the original design. I am not trying to copy it to make money. I apologise if I ofended anyone, especialy the designer.
I used to live in a place I had the oportunity to learn robotics and became adicted. I suffer now because I lost the ability to buy online whatever I liked to use in my projects. So I have to build myself almost all of the parts for the project. This is how I learned to use Eagle, drill and etch a board and even if it’s without solder mask and silk screen it looks great. I don’t want to reinvent the wheel, just to adjust it to the particularities of my project. I guess I made everyone curious: what’s the project? Well, it is like yours, build a humanoid robot, like Pete or Nick or Robonova. I wish I can sell my car to buy one of them, but I am afraid I still have to add some money to make it all. Unfortunately the servos I cant build myself and have to buy them. I was looking into those cheap servos but I heard a lot that made me change my mind. Oh well. Looks like I have to scrap all my other projects and sell them to get the money for good servos. I was happy to see that in my country there is a Lynxmotion distributor, but the price for 20 HS-475 servos is double my monthly salary. And they are the bare minimum for a robot…
Now about the SSC board. I guess I’ll have to wait anyway for the servos, so there is no rush to build one right now. Like most of the robot builders I want to have some sensor inputs available and some room for programming. Also I2C available, a serial port (TTL) to work with the AVRcam that I have and never used. I still have some old parts that I coudn’t sell here mostly because of the afordability. I think 24 servos are about the right number for a biped so what ever you can spare, use it for sensors.
Software is another issue for me since I’m a beginner in programming. I can write some code to make the robot react to its soroundings but from here to port the code from Code Vision to WinAVR is a long run. I would like to learn about the inverse kinematics for bipeds, like I am learning about PCB making, has anyone of you managed to make it work in your projects? I mean if you can share some code of course. Maybe I’m too used with the old group where everyone would share with the others what he had found new and let the others improve if possible. Here in Romania everyone is all about the money and stealing someone elses work is a habit even I got close to do. Sharing is for fools and naive geeks that don’t know nothing about making the money. Is this real? Is this how roboticians think? At least I didn’t thought so.
I gues I’m all done here with my rant. Sorry if I hurt someone, my appologies. I just had a bad day after another bad day, after another bad day…
Gabe

I need to apologize. The “what’s the point” comment was directed to Eddie and not you. I can relate to making something verses programming. I built my own board to best suit my needs also. The board I made was to have as many sensors that would fit on a 3" x 3.5" board if I remember correctly. What Jim was saying is the code is open source, but the board design is not.

I hope you did not take things the wrong way and decide to hang around us misfits. I would like to see your board design, so when you have a chance, post a pic of it. :smiley:

Ok, here is the schematic and layout of the new board, with through whole components, since my first board using SMD parts I had to scrap because it had some wrong connections.
img86.imageshack.us/img86/9712/sscthschah9.th.jpg

img81.imageshack.us/img81/5701/sscthbrdxx6.th.jpg

I kept most of Jim’s layout with a few modifications. Let me know if you find any errors in it before I get to make it. Thanks.

I’ll take a look at it for any obvious layout problems but I can’t offer any help on the overal circuit design.

By the way, how did you get a hold of the Lynxmotion gerber file?

Looks nice. If it were me, I would want a connector for JTAG. It makes it a lot nicer for debugging your code.

Kurt

question: If all of those 3-pin headers are supposed to be servo outputs, and you are driving them all directly from i/o pins on the micro, have you measured or calculated the pwm bit resolution you can achieve at the cpu clock rate you have selected?

Thanks for your input and questions.
I’ll try to reply to everyone without quoting.

  1. I didn’t have any gerber file, only the schematic that is in the manual and the jpg image also in the manual so I can see where the parts are located.

  2. Jtag I never used, so I didn’t include a header for it. And some servo pins are hooked to the Jttag pins. If those servos are not used, Jtag interface may be available.

  3. There are 6 groups of 4x3 pins, 3 on one side, 3 on the other side. These are intended for servo use, with a jumper for selecting power to be Vsv or Vin. There is one more 4x3 pins group that can be used for servos or digital sensors, with a jumper to select power to be 5V or Vin. The last group of 8x3 pins is for analog sensors, with power being 5V. There are 2 serial ports (hardware UART), one of them can be jumpered to the MAX232 level shifter. Also there is a I2C interface connector, and a baud rate jumper like in Jim’s design. There are a few more pins unconnected so there is a Buzzer possibility.

I have not calculated the pwm bit resolution because simply put I don’t know how to do it. The clock rate I think it will be the same as in Jim’s design. It has to be a specific value so the serial baud rate may be as high as possible with a small error percentage. As I said before, I am not a programmer, I am a computer technician. So all the software for this to work is something I am not sure how to do. Maybe a little help here :wink: ?

You will have to overcome the programming hurdle as even if someone writes 90% of your code for you, you will still have to be able to compile, program, and debug your project which will require an understanding of why it is doing what it is doing (or not.)
The ATMega128 has 6 hardware PWMs of varying resolution. If you google you can find some examples of people using them to generate servo pulses. BDMicro has a nice short chunk of C code available for their Mavric-IIB board to drive 6 servo outputs. Were this my project I would probably start there as it appears to be written for the gnu-c based WinAVR and therefore should work with the Atmel AVR Studio 4 freebie. You can probably use any number of in circuit programming tools but something like the ATAVRDRAGON will work with AVR Studio and suport anything from single-wire to JTAG debugging for many AVR controllers.
So anyway, if you can get 6 servo PWMs running then it should be a small matter to implement an external “hardware” multiplexer to route each of the 6 outputs to 4 servos. This allows the ATMega128s internal harware PWM channels to do the precision work and all you have to do is keep track of sending the correct set of PWM outputs to the correct servos. A quick overview goes like each servo output is active for 2.5mS of a 20mS period. So every 5mS you select which of the 4 banks of servos to route the pulse to, update the PWM trigger registers, and go find something else to do until the next 5mS time arrives.
Do I really think it will be that easy? No but who takes on a learning project because it is supposed to be easy, right? :wink:

This is exactly what I am having to do as I get more into using Pete’s (sapian59) dualPIC code. I have a real good understanding of how both the PIC and dsPIC code works now, but it has taken me a few weeks to get to this point.

Very well said, and I agree completely. :smiley: I am finally starting to reap the rewards of the time I have spent digging through Pete’s code, which is a very good example to learn from in my opinion. I am starting to customize and add new code to what Pete has already done now. For instance, I can now jumper the I2C device address and master/slave mode of an 18F PIC. I just haven’t got the interrupt code working yet.

8-Dale

Instead of copying the SSC-32 and replacing the micro, why not make it all yourself but base some of it on the original. Learn how the SSC-32 works and make something similar to it. Copying an existing project is a fair way to learn, but sometimes you can learn a lot more if you do it yourself and don’t copy something. Look at it as an example. I find that its a better way to learn.

As for the layout of the new board, looks amazing. How long did that take you to make? It takes me a few hours to put a few parts down in eagle ><;;

That is what we are doing on the new dualPIC board design. I’ve finally gotten comfortable enough with Pete’s code (after several weeks of digging through it) so I can add modifications of my own. Some of my modifications are pretty major changes. I sure am learning a lot about PICs and dsPICs though! :smiley:

Copying from an existing example is fine, as long as you learn from it, and can make it do what you want it to do. I sure am learning a lot from Pete’s work.

8-Dale

So you guys say it is best to use the 6 hardware PWM generators and multiplex that to drive 24 servos? That will look like the SSC-32 board. And that will open up lots of I/O pins. I thought it is best to direct drive the servos. I’m still learning…

“best” is a pretty relative assessment.
it depends on whether you want to have cycles available to do anything other than run servos.
If you are just looking for a DIY replacement for the SSC-32 then you can probably bit-bang timing loops that will allow you to direct drive all 24 servo outputs from port pins. But you are going to chew up 70 to 80% of your CPU time doing that which leaves not much time for any sort of sensors or advanced logic beyond pre-canned sequences drawn from a table. so if this is your goal then bit-bang x 24 might be the “best”.
If you want decent resolution and a lot of CPU time to do other tasks then the 6 PWM x 4 mux is a decent choice but you need (6) 2-to-4 decoders to implement it (there are typically two 2-to-4 decodes in a chip so 3 chips), or a single suitibly programmed PAL/CPLD/FPGA.
If I remember correctly only 4 of the 6 PWM channels are 16-bit resolution so for the highest resolution you could multiplex them out to 24 or 32 channels and use the other two for digital-to-analog conversion or some other non-servo type PWM. The existing SSC-32 runs 4 (bit-banged I think) PWM lines and multiplexes them with the (4) 8-bit shift registers with good effect. If you can use hardware PWM channels to do the same thing the CPU load will be almost negligible and you can use only 3 PWM and shift register to get your desired 24 channels.
Were I doing this project and if I had the opportunity to define the hardware on the PCB the 3-to-24 is the approach I would take so it would be my “best” choice. I would pick the 3 PWM channels that deprived me of the least number of other functions on the chip. I would have a good idea of what sensors and I/O I needed other than the servos and make sure I could handle their I/O efficiently. Then I would try to add or make available many of the other things people tend to ask for when interfacing to other products like I2C, UART, MOSFETs outputs, op-amps on the A/D inputs and a dedicated VREF buffer, and use one or two of the remaining PWMs to make a DAC output w/buffer. Lastly I woud make certain the JTAG lines were brought out so I could use the 50USD ATAVRDRAGON module to program and debug through the free AVR Studio and WinAVR packages. While I use the IAR compiler at work and appreciate the way they access the onchip FLASH and EEPROM I could not even begin to afford their tool suite at home… which is part of the reason I don’t do Atmel home as it would mess my head up switching back and forth between the two. :stuck_out_tongue:

:mrgreen:

Looking around on the net I have found the ServoPod board. Man, I was astowned by the cappabilities of this little board! And by the price too! So here are some of the features that got my attention:

  • DSP56F807 MPU, 16-bit processor
  • Up to 40 MIPS at 80 MHZ core frequency
  • 60K x 16-bit words Program Flash
  • 2K x 16-bit words Boot Flash
  • 8K x 16-bit words Data Flash
  • 2K x 16-bit words Program ram
  • 4K x 16-bit words Data Ram
  • JTAG/OnCE port for debugging
  • Serial Peripheral Interface (SPI)
  • Two Serial Communication Interface (SCI)
  • Up to 22 GPIO lines(16 dedicated + 6 shared)
  • Two 8-channel 12-bit ADCs
  • Up to six General Purpose Quad Timers
  • 12-channel PWM module
  • 6-current sense pins
  • Onboard Header Connectors for 26 RC-Servos

And the IsoMax is suposed to be a Virtually Parallel Machine Architecture
Programming Language…

expensive at $200 but if you have the cash and not the time it si probably not a bad deal. a “best” solution is quite a relative term. :wink: