About Me
My Project
FabAcademy

Sergio Subrizi

About Me

The Assignments
  1. Principles and Practices, Project Management
  2. Computer-Aided Design
  3. Computer-Controlled Cutting
  4. Electronics Production
  5. 3D Scanning and Printing
  6. Electronics Design
  7. Embedded Programming
  8. Computer-Controlled Machining
  9. Molding and Casting
  10. Input Devices
  11. Output Devices
  12. Composites
  13. Networking and Communications
  14. Mechanical Design, Machine Design
  15. Interface and Application Programming
  16. Applications and Implications
  17. Invention, Intellectual Property, and Income
  18. Project Development
  19. Project Presentation

Output Devices

With my fully connected Atmel 328 - Fabuino I'm going to control a stepper motor. Something I will need on my final project. For the moment I will use the Arduino IDE, C++ is still out of my range for now and time is not on my side :-). I started to map my Fabduino pins, using the picture below:

  1. Adc0-23 = jp2 pin 3
  2. Analog input 0
  3. Adc1-24 = jp2 pin 4
  4. Analog input 1
  5. Adc2-25 = jp2 pin 5
  6. Analog input 2
  7. Adc3-26 = jp2 pin 6
  8. Analog input 3
  9. Adc4-27 = jp2 pin 7
  10. Analog input 4
  11. Adc5-28 = jp2 pin 8
  12. Analog input 5
  13. Adc6-19 = jp2 pin 2
  14. Analog input 6
  15. Adc7-22 = jp2 pin 1
  16. Analog input 7
  17. Pb0-12 = jp4 pin 1
  18. Digital pin 8
  19. Pb1-13 = jp4 pin 3
  20. Digital pin 9 pwm
  21. Pb2-14 = jp4 pin 5
  22. Digital pin 10
  23. Pd2(int0)-32 - jp1 pin 1
  24. Digital pin 2
  25. Pd3(int1)-1 - jp1 pin 2
  26. Digital pin 3
  27. Pd4(t0)-2 - jp1 pin 3
  28. Digital pin 4
  29. Pd5(t1)-9 - jp1 pin 4
  30. Digital pin 5 pwm
  31. Pd6(Ain0)-10 - jp1 pin 5
  32. Digital pin 6 pwm
  33. Pd7(Ain1)-11 - jp1 pin 6
  34. Digital pin 7
  35. Pb3(Mosi)-15 - ISP pin 4
  36. > Digital pin 11 pwm
  37. Pb4(Miso)-16 - ISP pin 1
  38. Digital pin 12
  39. Pb5(SCK)-17 - ISP pin 5
  40. Digital Pin 13 Led
  41. Pd1(TX)-31 - jp8 pin 5
  42. Digital pin 1 TX
  43. Pd0(RX)-30 - jp8 pin 4
  44. Digital pin 0 RX



I used an L298N stepper motor driver and old epson printer stepper motor connected to my Fabduino board. Many example were tested and did not work well or did not worked at all, the stepper was just making noise and vibrations but did not move, I thought my DIY board could have problems so I tested those code also on Arduino Uno but they were not working either. Once the right code was found and worked well on the original Arduino, I switched to my Alicina-Fabduino and it worked perfecly. All the problems I had were with the Accelstep library, when I svitched to the older Stepper.h library everything worked fine. As I am hard-headed, I tried again whit the Accelstep.h library, I partially succeed driving a Pololu driver with Step-Dir comunication, after a difficult setup I had the motor running and following my command but the speed and accelleration were very low, a test with original Arduino Uno gaved the same result so I concluded that was not an hardware problem. I am continuosly experimenting to find the best solution to drive the motor with the Step-Dir system, but the new experience with the Gestalt nodes seems to me the best and most versatile solution for my project.

This is the working code that gave no problem at all all the code written with Accelstep library were unsuccessful or worked with a very slow maximum speed no matter what setup I used.

#include Stepper.h
 
const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 2, 3, 4, 5);

void setup() {
myStepper.setSpeed(60); // set the speed at 60 rpm:
Serial.begin(9600); // initialize the serial port:
}

void loop() {
Serial.println("clockwise"); // step one revolution  in one direction:
myStepper.step(stepsPerRevolution);
delay(500);
Serial.println("counterclockwise"); // step one revolution in the other direction:
myStepper.step(-stepsPerRevolution);
delay(500);
}
                    
I'm going to experiment now whith an LCD display controlled by an encoder with push button .... work in progress ....
5 May Progress

Using the Menwiz library and a 20x4 LCD display Thet Fabduino is bring to life :-). I understood that some minor improvment to the Alicina-Fabduino board are welcomed. First of all I need to route a +5volt signal from the Usb to some of the connectors to help and easy drive of some componets I may need, and the LCD is the first, I also thought it would be nice to easily connect the LCD and a 10k trimmer to drive the luminosity/contrast of the display would help ... so a redesigned the Alicina Board adding a pin to the connector ... ending with the Fabduino v2 Lcd Display edition :-)

After the test of the Fabduino with the Pololu and stepper motors, the obvious part is to buil a Motor shield to rationalize the wiring, as molex screw conectors are needed, the circuit was made with through the hole technique ... a very relaxing thing after month of surface mounting welding :-). I added some microswitches to control the microstep pins of the Pololu. I think I going to design also a "control shield" that will carry the push buttons and the Lcd Display.