Controlling hexapod’s 18 servos with ATXmega128a1

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would like to control my hexapod and its 18 servo motors with ATxmega128a1 microcontroller. I have been looking and in the end chose the Ready for XMega Board.
Correct me if I am wrong but it has enough PWM-s to control the robot. My question is this: Is this 8 bit microcontroller enough for me? I have to also do inverse kinematics with it.

http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-8067-8-and-16-bit-AVR-Microcontrollers-ATxmega64A1-ATxmega128A1_Datasheet.pdf

http://pdf1.alldatasheet.com/datasheet-pdf/view/241104/ATMEL/ATXMEGA128A1/+Q_Q227VYSL.LcEXcylxIzDIME+/datasheet.pdf

https://download.mikroe.com/documents/starter-boards/ready/xmega/ready-xmega-manual-v100.pdf

Last Edited: Tue. Oct 3, 2017 - 10:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please provide links to the things you are talking about.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, now its there.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

slapeeh wrote:
Is this 8 bit microcontroller enough for me? I have to also do inverse kinematics with it.

The standard way to start a project is to review the current state of the art; ie, what are others in the field doing?

 

Surely, there are standard platforms for controlling these things nowadays?

Have you looked at them?

What do they use?

How do you intend to improve on them?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't need to use hardware PWM. Just do soft PWM. You can easily do 18 servos from an AVR - in fact the limit is usually just the number of IO pins you have. Even lowly mega16's and similar have been shown to control 20+ servos.

 

The key thing is not to try and do all the 18 servos 1ms..2ms activity window in the same part of the 20ms cycle. In fact 20ms lends itself quite nicely to doing each servo staggered in the "next" 1ms window. So their "frame starts" are all offset by 1ms.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for the answers. I have been looking at other hexapod projects and I only saw 16 or 32 bir microcontrollers. Thats why I asked that in your opinion is the 8 bit microcontroller enough for angle calculations?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

slapeeh wrote:
 is the 8 bit microcontroller enough for angle calculations?

Why risk it?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just because I have it on me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"when the only tool you have is a hammer, every problem looks like a nail"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

slapeeh wrote:
Just because I have it on me.

Eh??

 

But in the OP, you said you specifically went out and found it:

you wrote:
I have been looking and in the end chose the Ready for XMega Board.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am sorry, I meant I was looking at other boards too, but in the end I decided to go with my Ready for XMega Board. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

These guys used a Cortex-M4 at 168 MHz:

Research and Implementation of PID Algorithm for Quadcopter 

 

Abstract: In order to solve the problems in quadcopter system, such as real-time response, heavy workload
and difficulty in control, this paper applies the embedded real-time operating system (RT-Thread) to the
quadcopter. The PID algorithm has been considered in two structures in respect of the optional control signal
applied to the quadcopter. For the better performance of quadcopter during flight the cascade control algorithm
has been proposed. The practical test indicates that the quadcopter control system based on the embedded
operating system can not only respond real-timely, but also can fly smoothly under the control of PID algorithm.

 

http://www.atlantis-press.com/ph...
 

They don't discuss the actual computing power requirement, though.

 

EDIT

 

ArduPilot seems to be a popular open-source controller

 

Everything on the supported Open Hardware list seems to be at least Cortex-M4; some Cortex-A.

 

http://ardupilot.org/copter/docs/common-autopilots.html#common-autopilots

 

 

Last Edited: Tue. Oct 3, 2017 - 04:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But he's talking about a six legged land based robot (3 servos per leg) not a flying machine? You have loads more time to respond to navigation calculations in that than a quad. So a lower spec CPU could be OK

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh yes - I've been mis-reading "hexapod" as hex-copter all along!

 

D'oh

 

blush

 

Indeed - a very different beast!

 

blush

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you guys :) I think I will go with it and then hope for good results :p