I'm trying to decide between 2 things before I get stuck into either, help!
Basically I want to try implementing some inverse kinematics on my custom humanoid, but it's running on a picaxe so I can't do it autonomously as the picaxe can't do floating point...
Am I better spending a few hours writing a program in VB that can work out servo values and send them via serial to the robot (gotta learn VB a bit better first though), or am I better getting a more powerful controller (if anyone can suggest one with a free compiler that can fit into an 18 DIP that'd be brilliant)
Floating point math is not a requirement for IK itself, just for certain methods of calculating IK values. Fixed point or DIY floating point math can also be used to perform IK - ‘normal’ floating point is just nicer for humans to understand =)
Working out how to do IK using a fixed point system might pose something of a challenge however, and I’m not sure you’d find any pre-built code suitable for what you want.
Do you plan on adding any other PC <—> robot comms? If you want to add remote control or anything like that later, then building a VB program for the IK is probably a good start. If you never intend to have any other data moving between the PC and robot, then perhaps you should look at other controller options. Do you have any preferences on programming language for alternative microcontrollers?
This comment doesn’t directly address the inverse kinematics question, but I thought it could be helpful to note that you can setup more complex math equations on a PICAXE than might be immediately obvious. Like other programming tasks, math is accomplished by breaking the problem down to its component parts and solving it step by step. Sometimes a compiler or interpreter does all of the setup for you, other times you have to do some of it yourself. Some of the limiting factors in doing heavy math on a micro are having enough program space to setup the equation, having enough variable space to manipulate the numbers, and having enough time to work through the required steps while taking care of whatever else it is you want the micro to be doing. In this regard, many of the popular, inexpensive micros are going to have challenges. As Revolution Education continues to release faster PICAXEs with more memory, the possibilities for handling more advanced math expand. The new 18M2, for example, has twice as many general purpose variables and is four times faster than the 18X that it replaces.
Over at the PICAXE Forum, Jeremy Leach has posted some excellent discussions and code samples addressing various math topics. A particularly interesting posting is Maths ‘Module’ for more accurate calculations in which he describes a method called Q16.16 and how to apply it to PICAXE for handling larger numbers and achieving greater precision in the four basics - addition, subtraction, multiplication and division. Even if you don’t plan to use it yourself, you might find it to be an interesting read. (You’ll need to register at the forum to download the discussion and code.)
I’ve had a look in my head to see where I want this project to go, and pc comms let me do a load more stuff that the robot can’t. I think I’ll get cracking on the vb, and invest in a wireless serial connection Thanks for your help!
That fits quite nicely cos I’m using an 18M2 for this bot already I’ve been experimenting with a couple of different ways of using numbers differently now I’ve got so many variables to play with, seeing how easy matrix transformations are with it… Watch this space but for now I’m gonna learn VB and do it that way…