Assignment - Output Devices
- I -- group assignment:
- measure the power consumption of an output device
- II -- individual assignment:
- add an output device to a microcontroller board you've designed, and program it to do something
- Individual assigment
Datasheet for M42SP-7:
- Rated Voltage DC 12V; DC 24V
- Working Voltage DC 10.8~13.2V; DC 21.6~26.4V
- Rated Current/Phase 259mA ;173mA
- No. of Phase 4 Phase ;4 Phase
- Coil DC Resistance 50Ω/phase±7% ;150Ω/phase±7%
- Step Angle 7.5˚/step; 7.5˚/stepv
- Excitation Method 2-2 Phase excitation (Unipolar driving)
- Insulation Class Class E insulation; Class E insulation
- Holding Torque 49.0mN·m ;52.9mN·m
- Pull-out Torque 23.5mN·m/200pps; 33.3mN·m/200pp
- Pull-in Torque 19.6mN·m/200pps; 29.4mN·m/200pp
- Max. Pull-out Pulse Rate 600pps; 650pps
- Max. Pull-in Pulse Rate 420pps; 430pps
- Group assigment
I used step and servo motors to solve this weekly task. I especially used the M42SP-7 Mitsumi stepping motor which I will use for my final project.
In order to be able to use my motor I had to study on what principle step motors work and I found an interesting video with an explanation. Step motor. A stepper motor, also known as step motor or stepping motor, is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor's position can then be commanded to move and hold at one of these steps without any position sensor for feedback (an open-loop controller), as long as the motor is carefully sized to the application in respect to torque and speed. There are three types of stepper motors based on rotor arrangements. They are as follows: - Stepper motor variable resistance (VR) The variable reluctant motor is divided into two types. They are known as single-flow motor with variable resistance and Multi-stack motor of variability. - Permanent magnet stepper motor (PM) - Hybrid stepper motor (combination of VR and PM type)
Step angle in stepper motor is defined as the angle at which the rotor of a stepper motor moves when a single pulse is applied to the stator input. The position of the engine is determined by the step and is expressed in degrees. The resolution or number of motor steps is the number of steps in one rotor revolution. A smaller angle increases the positioning resolution of the stepper motor.
There are two basic winding arrangements for the electromagnetic coils in a two phase stepper motor: - bipolar - unipolar. The picture shows the unipolar step motor Mitsumi M35SP-9T, which has 5 wires. A unipolar stepper motor has one winding with center tap per phase. Each section of windings is switched on for each direction of magnetic field. Since in this arrangement a magnetic pole can be reversed without switching the direction of current, the commutation circuit can be made very simple for each winding. given a phase, the center tap of each winding is made common: giving three leads per phase and six leads for a typical two phase motor. Often, these two phase commons are internally joined, so the motor has only five leads. Resistance between common wire and coil-end wire is always half of the resistance between coil-end wires. This is because there is twice the length of coil between the ends and only half from center (common wire) to the end. A quick way to determine if the stepper motor is working is to short circuit every two pairs and try turning the shaft. Whenever a higher than normal resistance is felt, it indicates that the circuit to the particular winding is closed and that the phase is working.
Bipolar motors have a single winding per phase. The current in a winding needs to be reversed in order to reverse a magnetic pole, so the driving circuit must be more complicated, typically with an H-bridge arrangement There are two leads per phase, none is common. A typical driving pattern for a two coil bipolar stepper motor would be: A+ B+ A− B−. I.e. drive coil A with positive current, then remove current from coil A; then drive coil B with positive current, then remove current from coil B; then drive coil A with negative current (flipping polarity by switching the wires e.g. with an H bridge), then remove current from coil A; then drive coil B with negative current (again flipping polarity same as coil A); the cycle is complete and begins anew. Because windings are better utilized, they are more powerful than a unipolar motor of the same weight. This is due to the physical space occupied by the windings. A unipolar motor has twice the amount of wire in the same space, but only half used at any point in time, hence is 50% efficient (or approximately 70% of the torque output available).
To work with the M42SP-7 engine, I first studied the datasheet and then studied a few videos I found to connect the engine as successfully as possible and control its rotation. Datasheet for M42SP-7. Videos that helped me: Interfacing of Stepper Motor Mitsumi M42SP-7. Stepper Motor Basics - 5 Wires Unipolar / Bipolar Motor. 28BYJ-48 Stepper Motor and ULN2003 Driver Intro.
I didn't want to use a ready-made shield for the arduino but I wanted to connect the L293D engine driver to the engine myself. And so I took everything I needed and went step by step. to make it easier for me, I sketched a diagram according to which I connected the inputs and outputs of the L293D controller and the M42SP-7 motor, as well as the Arduino connectors.
In the picture on the left are the L293 D pins and on the right is my wiring diagram.
I placed the L293D on the experimental board at one end and placed wire leads from the motor at the other end. To find out which wires were connected and how I used an LED and spun the motor. If the LED is lit these two wires are connected.
In addition to this method, I also measured the resistance between the wires. Once I figured out which wire belonged to which coil I could move on. I grounded pins 4 and 5 and 12 and 13.
After grounding, I connected pin 1 to pin 16 - Enable 1,2 and VCC, and Enable 3,4 -pin 9- with pin 8 - VCC - left image. I separated the GND and VCC into the bottom of the board so I could later connect them to the arduino - right image.
After grounding, I connected pin 1 to pin 16 - Enable 1,2 and VCC, and Enable 3,4 -pin 9- with pin 8 - VCC - left image. I separated the GND and VCC into the bottom of the board so I could later connect them to the arduino - right image. I could now connect all the inputs and outputs to the arduino and on the motor. All pins from the L293D controller - 3,6,11 and 14 are connected to the motor, while the inputs - 2, 7, 10 and 15 are connected to the arduino digital pins - 11, 10, 9 and 8. I connected the VCC and GND pins from the board to the arduino and switched the program via the arduino interface.
I used a speed control program and a stepper_oneStepAtATime program. In the stepper_speedControl program, I changed the settings, ie the number of steps from 200 and lower to 20. At the first selection, the engine rotated quickly - film - and the lower the number, the slower the engine rotated.
Now I have to make a PCB board with the help of my scheme.
I made schema with Kicad program - Eeshema.Since I had already entered the required library in weeks 4 and 6 - fab, there was no need to repeat this step. To make it easier to navigate, I put a global label because that way I can write exactly what is connected with what and it is easier to follow the scheme.
After I made the scheme, I had to make a net list, to know which component is connected where. I saved the net list to my hard drive and then opened the second part of the Kicad program - Pcbnew. Inside it, I loaded the saved net and list. Now comes the fun part. Everything should be arranged so that nothing crosses :)
Now comes the fun part. Everything should be arranged so that nothing crosses :)
After a while ... tadaaa ... nothing crosses anymore, I had to reload the net list a few times and update the schema and pcb but it worked.
In the board setup, I set Clearance to 0.4 mm and then exported the svg file.
I loaded the SVG file into the Inkscape program to create the layers and export them in png format.
I created layers - background for the background with which I do other layers for png. The backgroun is a black square - a rectangle. Then there’s the layer of traces - to which I moved all the tracks and painted them white. White because it must be an inverse image for milling. Then a layer of holes with holes for the L293D engine driver
The outline, holes, and traces layers in the image to the left are exported as a png file.
Once I had exported all the files - like png - I could start making g code for CNC. To do this at modsproject. I opened the program for Roland MDX-15, inserted the file capture module and loaded all three png files. I saved the traces rml file.
For the outline I loaded the outline png and then set the parameters for the outline. I saved the outline rml file.
For the holes I loaded the holes png and then set the parameters as I did for the outline. I saved the holes rml file.
Using DropOut, I loaded each individual file and .....
Now it was necessary to clean the board and solder the components and program the controller.
To work with a servo motor I used SERVO MOTOR TOWERPRO SG90. A servo motor is a type of motor with which we can very precisely control the angle at which it is set. This small servo motor is great for education and demonstration, but can also be used for larger items that do not require a large turning force (e.g. small valves). • Control: analog (best to use Servo library) • Voltage: 5V • Speed: 60 degrees in 0.1s • Weight: 9g • Dimensions: 23mm x 12mm x 29mm Data sheet.
To control and start this motor I used a CROduino instead of an Arduino. Croduino Basic2 PB. The Croduino is a version of the Arduino. Croduino is the first Croatian Arduino compatible board. The Croduino Basic and Basic2 are identical to the Arduino Nano, it is slightly smaller in size and has two more pins. First I had to install the drivers for the Croduin and choose its tile. Drivers for Croduino Basic2 PB.
In the picture on the left is the diagram of the Croduino Basic2 PB pins and on the right is the way of connecting the servo motor with Croduino Basic2 PB.
To better see the displacement of the motor I used a ramp that is printed for this motor as the motor can be placed inside the ramp column. In the program, we determine the angle at which the engine will turn and thus the ramp will open.
For the group task, I took the motor from the toy and connected it to a voltage of 1.5V with the help of a battery. I then used a multimeter pen to measure the current of 195.6 mA. Power is the current multiplied by the voltage in my case 1.5 * 0.1956 = 0.2934 W
Second motor I connected it to a voltage of 1.5V with the help of a battery. I then used a multimeter pen to measure the current of 11.6 mA. Power is the current multiplied by the voltage in my case 1.5 * 0.0115 = 0.01725 W