Anna Aflalo

Fab Academy 2015 | Wgtn

WEEK 11 | Output Devices

For this week's assignment I decided to focus on a DC motor. I've chosen this 12V DC Motor with a torque of 12.0kg/cm. I used Neil's files to design the board. However my motor was different motor so I made some changes.

The list of components
- 12V DC motor,
- ATtiny44,
- Conn Pwr Jack 2.1x5.5,
- H-Bridge (40V, 2A),
- Regulator (5V, 1A)
- Header 3x2
- Screw terminal
- Resonator 20MHz,
- Capacitors: 0.1uF & 10uF (H-Bridge) || 0.47uF & 22uF (Regulator),
- 10kΩ resistor.

I also discovered Octopart website.
DC motor - V1
I used the schematic of an adjustable regulator instead of the regular one. It messed up my traces as you can see on the image. I only realized my mistake when I powered my board and I saw the smoke... Next time I'll pay more attention to my Eagle files.
I also learnt the meaning of the specification: " Current - Full load: 1380mA ". The board needs to provide less amps than the transistor. So from now on, I'll check the voltage AND the amperage output of the transistor before providing power.
DC Motor - V2
The second test was supposed to be the good one... But I only remembered that the H-Bridge bottom was conductive once I had to solder it. Some of my traces were going underneath this component. I didn't want to waste the board so I tried to put nail polish on the conductive area. Apparently it wasn't enough, the connections were wrong anyway.
DC Motor - V3
The motor is finally working!
You'll find the final eagle files here (schematic, board & traces).
I used Neil's C code to program the motor. Once I knew the board was working, I wanted to go further away in the code so I played with it. I changed the parameters (screenshot above) in order to understand their functions.

This is what I understood about this code:

- on_delay(): delay between forward and reverse in each cycle (slow, medium and fast);
- fast_off_delay(): changes speed rotation in "fast cycles"
- medium_off_delay(): changes speed rotation in "medium cycles"
- slow_off_delay(): changes speed rotation in "slow cycles"
- PWM_count: number of "forward cycles" and "reverse cycles" in each slow, medium and fast cycle
- cycle_count_fast: number of "fast cycles"
- cycle_count_medium: number of "medium cycles"
- cycle_count_slow: number of "slow cycles".

Click here to download the C code with some modifications and comments.