This is the first post of a series. Creating a set of motorised camera tools for the range of professional DSLR cameras and video cameras the entire project has been divided in a series of independent posts. This motor controller will be used in this motion project but aims to be a precise and reliable general purpose stepper motor controller available for any needs, easily connectable with a wide series of micro controllers.
Intelligent
As far as I know most of the low cost stepper motor controllers has not on-board logic; no more than the minimum needed to to move the motors. This means that all the math process is in charge to the micro controller. This is the case, just to mention someone, of stepper motors controlled by Arduino, Raspberry PI, BBB etc.
Speaking of one of the widely diffused cases, there are many Arduino-like board (tiny, mega, sanguino and more) used to drive 3-axis CNC, 3D printers and many other kind of motor-controlled devices. In all these cases the effective reliability of the devices depends on the micro controller features; as a matter of fact one of the most impacting limits of these electronic architecture is the limited power of the devices: low speed for first.
The approach of this stepper controller instead is to deliver a very low cost and simple hardware easy to interface with the most diffused inexpensive boards without penalising the resulting power.
To reach this goal what we are used to see all included in the micro controller firmware has been split in two parts; The micro controller manages the high level process, like interpreting the source g-code managing the user request and eventually interfacing a PC, updating the display, managing the user interaction etc. The motor controller should be able to accept high level commands, i.e. simple g-code, specialised for its single task in a very reliable way.
To make the thing simple the controller can accept two kind of connections: serial TTL and I2C, two serial communication protocols available on all micro controller processors from AVR to PIC, probably all the ARM based micro controllers family and the more advanced embedded Linux platforms like the Raspberry PI.
The PSoC 4 Architecture
After studying for a while the Cypress PSoC micro controler series I had the opportunity to appreciate some of the core features that are just what is needed as the base of this project:
- Fast and full-featured processor.
- Fast clock respect most of the other processors
- Low power
- Very cheap
- Widely configurable I/O pins
- Easy and hardware oriented programming
- Stable and reliable
- Very good development environment
- Reasonable large amount of programming memory and data storage memory
All these features together demonstrated that PSoC 4 was the right choice: despite some controls and LEDs signals the external electronic parts to be added was just the power section. Thanks too to the inspiring article of cy.wbz PSoC 4 Pioneer Kit Community Project#045 – Stepper Motor Example
In-depth details of the firmware features will be discussed in the second part article related to the controller software.
PSoC 4 schematics
As one of the features I have most appreciated is the possibility to produce the base code designing the schematic template with the PSoC Creator the first prototype has been developed working with the development environment and designing the base schematic; as shown in the two images below it is divided in two parts: the power control (first image) and the control settings (second image)
Accordingly with the schematics below four pins are dedicated to the setting of the I2C physical address. A switch permits to set the interface to be used: I2C or TTL serial.
Controller design schematics and layout
The following image shows the controller design schematics
Due to the limits of the PSoC 4 only two motors can be managed by the board. The design is ready for use with a 1-1,5 A dual phase stepper motor powered by max 5V. Is a more powerful motor should be used the power LED should be removed or a bigger limiting resistor should be applied. Note that the L293 can support no more than 1,5 A but this chip can be piggybacked (up to three chip soldered one over the other) so that the controller can manage up to 5A stepper motors.
The video below shows the first test of the controller.
The following image shows the routed PCB based on the schematics above.
Top Comments