About 6 months ago we were invited by RS Components and DesignSpark to help exhibit on their stand at the Electronica exhibition in Germany. The requirements; create a demonstration which would showcase our software and its benefit in rapid prototyping, it had to run using the Arduino hardware platform and be interactive for exhibition visitors. Luckily for us, our Flowcode software is ideally suited to rapid prototyping, and programming Arduino devices is just as simple. Coincidence? Perhaps not.
Next we just needed to think of a project that would allow audience participation.
We decided to make a 6 Degrees of Freedom (DoF) Platform with a simple maze placed on top. Users would rotate the platform, attempting to get a ball from the edge to the centre of the maze. The platform movement would be controlled via 6 servo motors, connected to an Arduino. The calculation of rotation was derived from X and Y data from an Android tablet over a Bluetooth connection. The final element was to provide data back into the PC running Flowcode so we could have a ‘real-time’ demo running, which replicated the platform movement alongside providing near real-time data back into the Flowcode console.
In a series of 3 blog articles we will step through the design process of the 6 DoF platform. In our first blog article we will discuss rapid prototyping; specifically how Matrix software and hardware enabled us to create a working proof of concept demonstration within 7 hours. In the second article we will discuss the addition of Bluetooth connectivity and the creation of an Android application to pass XY data from tablet to Arduino. In the third, and last, blog article we will discuss deployment and test with the Arduino hardware, alongside conversion to a PIC based microcontroller.
In this article we will discuss the rapid prototyping abilities of Flowcode and Matrix hardware. The first step was to create some simple hardware that would allow us a proof of concept; could we even create a 6 DoF platform?
The 6 DoF platform requires something called ‘Inverse Kinematics’. Kinematics is a mathematical process which is largely used when dealing with systems such as robotic arms where you have fixed translations and variable rotations. If you think about your arm, the fixed translations are your bones and the variable rotations are the joints between the bones.
Forward kinematics is a way of taking the translations and rotations, summing them all together using translation matrices and coming up with the position and orientation of an end tool such as a drill or a gripper.
Inverse kinematics is a way of knowing where the end tool needs to be and calculating what the various variable angles need to be to obtain the required position. The human brain does this by trial and error and is commonly known as hand eye coordination. To do this in electronics we have to try and replicate this trial by error technique. Using forward kinematics with successive approximations of joint angles we try and achieve as close to the target end position as we can. In doing this there may be no real answer or there may be multiple correct ways of achieving the required tool position. An example of this might be if you wanted to get your hand behind your shoulder blades, it might be possible by going over your shoulder or under and behind your back but it also might not be possible. It’s only by trying to get there that we know for sure.
In the 6 DoF Platform there are essentially six end tool coordinates compromising of X, Y and Z movement and X, Y and Z axis rotation.
The first iteration of the product used an Arduino Mega 2560 microcontroller mounted onto a Matrix Arduino Shield. The shield allows users full access to each pin of the Arduino with a simple 9-way D-type connector. From here other Matrix eBlocks, or custom hardware, can be simply interfaced with the Arduino. In the image below you can see we connected to two ports of the Arduino. On one we used an EB059 Servo controller board, which easily allows us to connect 6 servo motors to the Arduino. The second port we used a male 9-way D-type and connected a small section of veroboard with 6 potentiometers. (Remember, the 6 potentiometers replicate X, Y and Z movement and rotation, where we are only considering X and Y rotation, so therefore 4 of the potentiometers were redundant and used only for testing purposes).
We created the inverse kinematics code in Flowcode to calculate the required rotation of the 6 servo motors in relation to the potentiometer values. Later in the design, X and Y data would be received from the Android tablet and the potentiometers would be removed.
We also created a simple demo rig to mount our servo motors. We found some examples online and used their designs to create a similar platform base attached via connecting rods to the servo. Our design was to be cut from 3mm clear acrylic on our laser cutter. At this stage we did not design the maze, as we were prototyping the movement of the platform only. Once we had the platform moving as desired, we would create the maze.
With our demo rig constructed we were able to test our code and hardware. As we adjusted the X and Y rotation potentiometers the platform rotated as desired. The inverse kinematics code would take the X and Y data and calculate the necessary rotation and direction for each of the six servo motors.
We found that in our first example the on-board regulator for the Arduino was not capable of providing enough power for the servo motors, which occasionally caused the Arduino to reset. Therefore we connected an external power supply for the servo motors, and only sent control signals from the Arduino. This created a much better solution, and was a design that went into the final product.
In the next article we will discuss how we introduced X and Y rotation data from an Android tablet. This data was made available through the creation of a simple application to run on the tablet to transmit data over Bluetooth. Alongside this, we also introduced a small Bluetooth module to our platform to receive the Bluetooth data. Finally we will also discuss the creation of the maze which sits on top of the platform.
5,242 total views, 1 views today