Group Assignment

Measure the power consumption of an output device

First, it is neccesary to notice that exist different output devices. I found something very useful that help me understand at Lydia Kuo - Fab Academy 2023 Web Page. We decided to test a stepper motor functioning process considering that my classmate and I will use this device for our final projects.

The Output: Stepper Motor

In our case we choose to test a step motor available at FabAcademy Inventory and because it is considered a digital input-output device. A stepper motor (sometimes referred to as a step motor or stepping motor). This product offer a shaft motion consists of discrete angular movements of essentially uniform magnitude when driven from a sequentially switched DC power supply, such being describe at Electromate.com . It works with digital signals. One digital pulse to a step motor drive or translator causes the motor to increment one precise angle of motion. As the digital pulses increase in frequency, the step movement changes into continuous rotation. So we can test it at full motion. It has windings in the stator and permanent magnets attached to the rotor. It provides fixed mechanical increments of motion (referred as steps, and generally specified in degrees). They are considered ideal for applications that require quick positioning over a short distance, Allowing the use of an open-loop controller, which simplifies machine design and lowers cost compared to servo motor systems.

This device holds a NEMA denomitation, that accounts for the National Electrical Manufacturers Association acronym. This mean that is standirized motor size, including designations that can help as learn more about the size and capability of practically any particular motor. Step motors are categorized by NEMA frame size, such as "size 11" or "size 23" or “size 34”. NEMA 17 stepper motors are those that have a 1.8 degree step angle (200 steps/revolution) with a 1.7 x 1.7 inch faceplate. They typically have more torque than smaller variants, such as NEMA 14 and have a recommended driving voltage of 12-24V. These steppers are also RoHS compliant (acronym for "Restriction of Hazardous Substances." A European Union directive that regulates the use of certain hazardous substances in electrical and electronic equipment - EEE).

The Controller Board for the Stepper Motor

We use a variation of Neil's hello.stepper.bipolar board that control a step motor using Arduino. And was develop by our instructor Jorge Valerio in Fab Academy 2016, and is still functioning. This board present the following components:

  1. 02 A4953 drivers
  2. 02 Capacitor 0.1uF
  3. 02 Capacitor 10uF
  4. 03 Resistors 0 ohm (jumper)
  5. 02 Connector 2x1
  6. 02 Connector 4x1
  7. 01 Connector Molex 4x1
The A4953 is a Full-Bridge DMOS PWM Motor Drivers, is designed for pulse width modulated (PWM) control of DC motors capable of peak output currents to +/-2A and operating voltages to 40 V. Input terminals are provided for use in controlling the speed and direction of a DC motor with externally applied PWM control signals. You can review the technical manual here

The Variable Power Supply

For the test we have available a variable power supply from GwInstek - Model 3303D. The technical manual provides functioning information. It has three independent outputs: two with adjustable voltage level and one with fixed level selectable from 2.5V, 3.3V and 5V. It consists of the following:

  1. AC input circuit
  2. Transformer
  3. Bias power supply including rectifier, filter, pre-regulator and reference voltage source
  4. Main regulator circuit including the main rectifier and filter, series regulator, current comparator, voltage comparator, reference voltage amplifier, remote device and relay control circuit

The following photo provides basic information regarding the power supply source, and also shows the terminals where the wires need to be connected

Testing

The test process consist on selecting a voltage and current and connect the board to the chanel terminal. For our testing we choose Chanel 1, because we tested a stepper motor we need to set the power supply with the following characteristics:

  1. Current: 1A
  2. Voltage: 12 V

To make the test we made the following connections:

  1. Connect the Arduino1 module to a PC to run the Arduino Software
  2. Connect the Arduino 1 with the board (A4953) by plugin 5V and GND in the respective connectors.
  3. Connect the PWM Chanel 1 outputs.
  4. Connect an external source in the terminal (12V @ 1A)

The Programing

For functional testing We write the following code in the Arduino IDE:

  1. #include "Stepper.h".
  2. const int stepsPerRevolution = 200;change this to fit the number of steps per revolution for your motor
  3. Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); initialize the stepper library on pins 8 through 11
  4. int stepCount = 0; number of steps the motor has taken.
  5. void setup() { initialize the serial port:
  6. Serial.begin(9600);
  7. };
  8. void loop() { step one step.
  9. stepCount = Serial.read();
  10. myStepper.step(stepCount);
  11. Serial.print("steps:");
  12. Serial.println(stepCount);
  13. delay(500);
  14. };

The following photo provides show all system connection to test. The Nema Motor have 4 pins and requieres 12V

The following video show the testing process. We set 1A as imput current and the consumption was 0.99A and 10V. Thus, we get 9.9W

Individual Assignment

Selecting the output device

With my instructor support, we review the components that I'm gonna need for my final project in order to decide which output could be the starting point. So I decide to start with a Servo motor that I'll probably use to open the hidden shelve. The following picture show the potential devices that I would use for my final project. I would use 2 Servo Motors, so the option could be to fabricate one or two boards. I decide to fabricate one.

Board Components

By acknowledging that servo motors function with 5V and common power supply sources provide 12V, we select the following components for this main board. It consists of the following:

  1. One terminal block 2x1
  2. Regulator LDO 5V 1A
  3. Male connector header 2x3
  4. Male connector header 90° 1x3 (GND+2DIO)
  5. 2 Servo Motors
  6. Capacitor 1uf

Regarding the Low Dropout Regulator, we review technical information here , and in summary its key technical characteristics are the following:

  1. It has 4 pins (IN, GND, OUT)
  2. Requires an output capacitor to maintain stability
  3. Dropout Voltage 500 mV
  4. Max Input Voltage 26 V
  5. Max Operating Temperature 85 °C
In regard of the servomotor, a device similar to a direct current motor, has the ability to be located in any position within its operating range, remaining stable in that position. In this case I use a 0 to 180 degree servo.

Schematic Development with KiCad

We select KiCad to design our board, taking into account that when working on schematics, we need to be careful with labeling each component in/out or GND adequately. Further we need to phycally recognise each component, because we made a mistake on regulator pins order, so when working on PCB editor traces were crossing, and took me sometime to understand the problem.

This is the schematic where you can see all the components. You can download Schematic design file and the PNG file here.

PCB Designing

To obtain PCB design and fabricate it, we need to take the following steps:

  1. Select the PCB Editor File from the KiCad Principal Menu.
  2. Update PCB from Schemnatic option located at Tools Menu on PCB Editor.
  3. Set track sizes (width) and appereance (material) option located at Edit Board SetUp Menu. Here we set 0.4 for traces width and 0.8 for ground and energy traces.
  4. Setup constraints option located at Edit Board SetUp Menu. The most important it is to setup cleareance at 0.4 to no exceed the end mill diameter
  5. Start drawing the traces selecting width and material correctly

This is the pcb design where you can see all the components. You can download design file and the SVG files here.

PCB Machining Setting

To fabricate PCB design we use SVG files applying following steps within FabModules Software:

  1. Upload SVG Board file.
  2. Convert SVG image inverted it using 1000dpi.
  3. Set mill traces (material) using 1/64" end mill (select 2 as offsetting number).
  4. Calculated Mill raster 2D.
  5. Visualize the image selecting width and material correctly
  6. Send file as final step
  7. Applied same steps for Cutting Edges but use 1/32" End Mill

The machining was made with a Modela MDX-20. I have got the following problems while machining:

  1. I machined a previous used board, and it seems that it wasn't attached firmly and moved while milling, so I had to stop the machine to avoid a broken end mill (photo 1)
  2. I made a mistake while stablishing coordenates when cuting edge layer, and affect my traces (phot 2)

PCB Soldering

To proceed with soldering I fix the PCB with double contact tape. Thus, we can avoid any movement when tin soldering

  1. I started soldering the small components
  2. I kept as strategy was to fix one (pin) of each component and then the others
  3. At The final step I soldered the terminal block, because it needed pcb perforations

I have a major problem with the terminal, because when selecting the componnets at the schematic, I didn't choose the correct model, and the distance between pins was shorter. Thus, after perforating the PCB the connector didn't fit. Thus I decided to fold the pins and tried to solder them. However the space between the capacitor and terminal's pins was short, and while soldering the cooper layer sliced. The following photo registered the problem. Thud, I have to machine another board and use new components

The Programing

For functional testing I used a modified coding provided by Adrian Torres and follow this Arduino IDE coding:

  • Open Arduino IDE software.
  • Connect the serial port to the board.
  • Copy the original code provide by Adrian Torres.
  • I only replace the pin number that correspond (Pin 3) at the begining, setting the output like shown in the code shown below:

  • 
    	
    #include 
    
    Servo myservo;  // create servo object to control a servo
    // twelve servo objects can be created on most boards
    	
    	
    void setup() {
      myservo.attach(3);  // attaches the servo on pin to the servo object
    }
    	
    void loop() {
      int pos;
    	
      for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    	// in steps of 1 degree
    	myservo.write(pos);              // tell servo to go to position in variable 'pos'
    	delay(15);                       // waits 15ms for the servo to reach the position
      }
      for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    	myservo.write(pos);              // tell servo to go to position in variable 'pos'
    	delay(15);                       // waits 15ms for the servo to reach the position
      }
    }
    
    

  • The #include see Source file inclusion, in this case identifies Servo.h file from Arduino IDE library which need to be compiled and link with the code.
  • The void setup is a function that contains the initialization of the component that I want to control (output), or that will send me information (input)
  • myservo.attach, attach the Servo variable to the pin 3 setting it as an output
  • void loop allows to repeat the code that follows over and over again
  • int pos;, it is creating a variable called position, which limits will be set in the following code lines
  • for (pos = 0; pos <= 180; pos +=1), for statement is used to repeat a block of output behave enclosed between curly braces. In this case, we are establishing position variable to move from 0° to 180°
  • myservo.write(pos); will call the variable set in the previous code line, in this case to move in relation to "for" statement from 0° to 180°
  • delay (15) will set the time that will took the servo movement to go from 0° to 180°
  • for (pos = 180; pos >= 0; pos -= 1)In this case, we are establishing position variable to return from 180° to 0°
  • myservo.write(pos); will call the variable set in the previous code line, in this case to move in relation to "for" statement from 180° to 0°
  • delay (15) will set the time that will took the servo movement to go from 180° to 0°

    The following photo shows all system connection to test. I used XIAO RP2040 from Week 8 to test the board and the output device (Servomotor)


    The final test was made runing the conding Arduino IDE and using a variable energy source, like shown in the following video

    You can get access to the servo code here.

    Reflections

    1. KIDCad software has really friendly interface, even for a newbee on electronics like me. I reocmmend to take a look to KidCad Tutorials
    2. It is very useful to review previous FabAcademy's students work that bring us some information regarding previous coding and tips about problems or common mistakes that we could repeat. And it is recommendalbe when using codings, review the assignment's files, because sometimes what was included on web pages have some missing coding lines
    3. For every further electronic design it is recommendable to work on PCBs that we'll need for our final project. Thus, integration will be less complex
    4. The noise produce by the servomotor shows that the soldering needed to be reviewed, due to false contact