ToorCamp
June 29th, 2009I’ll be at ToorCamp (with Fabr) July 1st through July 5th, at the Hackerbot Labs Campsite.
See you there?
I’ll be at ToorCamp (with Fabr) July 1st through July 5th, at the Hackerbot Labs Campsite.
See you there?
Fabr v2 uses a moving platform for the Z axis. This means it has a maximum volume is quite difficult to change. The platform requires a significant number of moving parts. I had been wondering if I could change fabr so that one axis could be changed out…
For Fabr v3, I wanted to see if I could replace the Y axis with a replaceable platform, driven by an edge motor. With this arrangement, I could replace the platform with any length I needed for the job at hand. I’m not quite sure if this will work, but something I’ve been thinking about.
“I love it when a plan comes together”
The Fabr motherboard is complete, and the firmware refactor I’ve been working on is ready for testing.
Here are some glamor shots of the motherboard (which are reprap firmware and connector compatible, just in case).
Hoping to have this thing up and running for the Robotics meeting this weekend.
I purchased a 328 upgrade from Adafruit, and am wondering if I got a bad firmware. My symptom is failure to sync during a firmware update. Happens in both the TextMate plugin as well as Arduino 14.
You’ve coded your project with your x-axis step pin on GPIO11. But my device has it on GPIO3. Or even worse, I use a a servo and counter, which doesn’t have a concept of a step. How do we resolve this?
If instead of considering the device itself when coding the logic, what if we were to abstract the meaning of the device from its behavior? That’s the basic idea behind Behavior-Device abstraction.
Say I’m building a Unmanned Aerial Vehicle (UAV). I have a navigation behavior which needs realtime orientation data. A typical orientation circuit requires a Gyro and accelerometer for accuracy and drift compensation. If the navigation system had to deal with those calculations, that code becomes unwieldy. However, if it were coded to a single OrientationDevice, then the implementation of that device could be two sub devices – the GyroDevice and AccelerometerDevice, and can build a homogenized notification of orientation changes. What if a manufacturer were to build a single chip that handles both and provides a single interface to it? All one would need to do is replace out the Orientation device without rewriting the Navigation behavior.
The example above described a composition – Each component has a singular responsibility. These are aggregated into a composite or logical device, which then can be actioned upon or notified from independent of the internal implementation.
RepRap has 1 main behavior – The GCode interpreter. It receives commands from the host machine, and drives two logical components – the extruder and the Cartesian bot. The Cartesian bot is composed of 3 linear actuators. The Extruder has a temperature sensor, heater and feed device.
The RepRap project uses Stepper motors for linear actuation, with end stops for collision avoidance and homing. It could be implemented using a servo motor or linear stepper driver. Since driving the linear actuator is now abstracted from the behavior, changes to the driving mechanism becomes much less complicated.
In other words, the behavior tells the bot where to go, the bot figures out how to get there, and the linear actuators figure out how to do it.
Making an LED blink or driving a single stepper using the Arduino is very easy – pulse a pin in the Arduino loop handler is all you need. However, as builds become more complex, there is often the need to manage multiple devices.
The RepRap firmware is such a project. The firmware has numerous steppers, motors, heaters, fans and sensors – it is chalk full of features. The developers have literally performed magic with the tiny little Arduino. However, I believe they will admit that the code base is becoming a little unwieldy and difficult to modify.
As an operating systems developer, my job is to identify patterns in application development, build abstractions which simplify these common cases and generate boiler plate or error prone code. In my post on the RepRap firmware refactor, I described several design patterns which are applicable to not just RepRap, but many other complex embedded projects. The best place to start is with the root of all evil – the event loop.
Event driven programing is a staple of modern application development. In my experience, event driven patterns are not as prevalent in embedded development – it’s a shame, because it is very useful. The main conceptual leap requires the developer to give up control to the power of the loop – a leap that is often very difficult as they are used to complete control. I’ve completed an implementation, which in its current state is more of a timer loop, but will grow to enable queued events (both on and off board).
This code is currently checked into the RepRap source forge repository. It is only dependent on the Dynamic Array implementation checked into the tree as well.
There are several features of this event loop:
(NOTE: It is not interrupt safe at the moment)
I updated the Arduino plugin with the following features:
Let me know if you have any issues. (or send a quick note to say you use it)
Brian Schmalz’s easy driver, offered by SparkFun is a nice little stepper driver. There are two major deficiencies however: It is hard wired to eighth step mode, and the ground pin is opposite the signal pins. I decided to fix these as I reassemble the extruder.
The step mode on the A3967 is selected by pin 12 & pin 13. By bringing these pins low, we can select full step. This is achieved by clipping the pins from the pads and soldering a wire to ground – the same ground I wanted to route over to the signal pins. In order to seat the polarized header, I filed a pin slot and soldered the ground jumper.

Entries (RSS) and Comments (RSS) or Log in.