Sunday, July 5, 2015

Arduino driving Brushed DC Motor using PWM




It may not be brushless but the concept is the same. The Arduino receives a signal via the potentiometer into an analog pin, converts is to a digital value from 0 to 1023 which represents 0 to 5V. It does this using the analogRead() function. The PWM is implemented using the analogWrite function which takes values from 0 to 255 uses this information to adjust the duty cycle of the PWM.

The C/Arduino code is so simple I probably won't be bothered to post it.



From there is just pulses a transistor acts as a switch that drives the motor. The analogWrite() function on some of the pins, uses a frequency of 980 Hz. This equates to 1/980 = 0.0010204 sec or 1.02 ms period. so a 40% duty cycle would be 0.000408 sec or 0.408 ms high and 0.000612 sec or 0.612 ms low.

Next, I may try to drive a BLDC motor using an Arduino and back EMF or Hall Effect Sensors. Although 980 Hz may not be high enough to drive it at a fast speed.

Thursday, June 19, 2014

Oh Noes! Broken Belts!

Broken Belts from McGuire Bearing

New Belts from Polybelt.com (grey ones are steel reinforced)
Well broke 5 of the 6 belts I bought from McGuire bearing. I figure this could be due to a few reasons. One could be is that they just can't handle the load. They work for awhile then break while using the board. Also one of the bigger pulleys was off center a bit and had wobble. Another reason is because with the 1/5" pitch on the smaller pulley there are on 4 teeth in it at any one time. There possibly might need to be more to get a better grip and prevent as much wear. One solution is to buy better constructed belts. The old belts I think were neoprene with fiberglass reinforcement. I bought some of PolyBelt.com. 3 regular rubber belts and 3 steel reinforced polyurethane belts which will hopefully bet stronger and more durable. I also found some kevlar reinforced belts on sdp-si.com which might be worth trying if these don't work. Another solution if that doesn't work is to switch to MXL size (0.08" pitch) pulleys and belts which will have much more teeth per inch. And possibly wider belts.

Semi-Finished

Top View

Bottom View

Side View
The finished product for the time being. I got everything done mechanically I wanted to do. Next step is to add Hall Effect Sensors for the purpose of measuring rotor position to supply power better than the current sensing method which uses electromagnetic feedback to measure sensor position. Adding Hall Effect sensors will have the effect of smoother starts, hopefully more power with less energy and smoother operation. The current motor controllers can work with or without hall effect sensors but the one I want to design eventually I think will need it for the purposes of regenerative braking. Here is the what I want to add. It has a board and sensors specifically built for 50mm 14 pole motors. After that the electronics such as charger, pulse width modulator etc.

Battery Charging

Fabricated Charge Balance Splitter

Added DC Power Connector and Balance Connector (left middle)

Charger hooked up to the DC connector and balance connector

Charger/Power Adapter/Remote
The fabricated charge splitter was made so both battery packs can be charged at the same time. Also added a DC connector so I wouldn't have to take off the bottom plate everytime I want to charge it. The charger I got of Ebay and it is about 50W 2S-6S charger, the power source is a laptop power adapter I got off Amazon that puts out 15V, 16V, 18V, 19V, 20V at 6A and 24V at 5A. I just use 16V setting because the charger accepts an input voltage between 11 and 18V and the 18V setting on the power adapter puts out a little more than 18V. The adapter also has a USB port on the side so I can use it to charge the remote at the same time which is convenient.

Installed Motor Controllers and Wiring

Bottom of Longboard without cover plate
Bottom of Longboard with Plate (drive end)

Bottom of Longboard with Plate off (drive end)

Wiring/Receiver/Etc
Added Bullet Connectors and JST-XH Connectors to Battery Packs
Added Bullet Connectors to the Motor Controllers
5.5mm Gold Plated Bullet Connectors
Installed the Hobby King motor controllers (with double sided mounting tape) and receiver and wired them up to the battery packs. I also added bullet connectors to the battery packs and JST-XH connectors for charge balancing. I also added 4mm bullet connectors to the ends of the wires that connect to the motors. The motors already came with them.

Motor Controllers

I'm using two of the Hobby King 120A motor controllers mostly because I already had one from a different motor, even though the motors I'm using are only rated for 90A. The voltage is supposed to be from 2S (7.4V) to 4S (14.8V) but it will go up to 6S (22.2V). This is the link to the website that tested and looked at the circuitry and concluded that 6S was safe. Here is the link to the actual product website.
The transmitter/receiver I use to for the motor controllers. Basically the only qualification is that it was cheap and worked. Link to the product site.


Wednesday, June 18, 2014

Belts/Pulley - Parts fabricated and put together

Parts - Pulleys/Washers/Bolts/Belt

Parts Bolted to the Wheels

Parts Bolted to the Wheels (alt view)

Wheels and Motor connected together on the trucks

Wheels and Motor connected together on the trucks (alt view)
For the pulleys I drilled out the holes of the small ones to 5/16" to fit the 8mm shafts of the motors. For the larger ones it was a bit more complicated. I cut off the ends and drilled out the center holes to 1" so it would more than clear the 3/4" truck axle and drilled 6 holes in a diameter that would fit with the holes in the wheels. Also I bought some 1.5" O.D. by 15/16" I.D. washers and drilled holes so that they would fit with the large pulleys. The bolts I used are 2.5" 10-24 size to mount the pulleys and washers to the wheel.