After working on HW6, I wanted to explore actuating a pendulum using feedback and magnetism. So I built a large scale pendulum as a test bed for this idea.
Wood for pendulum frame
4*AA battery holder
5V regulator – LD1117
Large magnet – (1/2” neodymium cube magnet ~25lb pull force)
Electromagnet – (homemade coil of magnet wire)
IR photogate or reflectivity sensor
Large mosfet or transistor to drive coil (Zetex ZXMN2A02)
Resistors for sensor and mosfet
(10-100uF) capacitor to handle spikes
As the pendulum swings the circuit needs to impart a force on the pendulum to keep it from slowing down. By using a large magnet as the pendulum mass, the circuit can affect the pendulum by switching an electromagnet. This has to be done very precisely, because the magnetic field from the electromagnet can increase or decrease the speed of the pendulum depending on how it’s switched. The goal is to switch the electromagnet on as the pendulum approaches and turn it before the pendulum moves halfway through the electromagnet’s field. This way the magnetic field doesn’t attract the magnet as both as the pendulum approaches and as it leaves, thus canceling out any increase in momentum.
The circuit consists of a microcontroller, mosfet, sensor and a voltage regulator. The sensor consists of an IR LED and an IR phototransistor. There are resistors to set the current through the LED and to set the gain of the phototransistor. The microcontroller will sample the reflectivity sensor voltage with an ADC pin. When a desired threshold is crossed the microcontroller will send a pulse to the gate of the mosfet to energize the electromagnet.
To actuate the pendulum I chose a very simple and effective algorithm. Since the max speed of the pendulum can be determined experimentally, I chose to energize the coil for a fixed amount of time corresponding to the speed of the pendulum at max amplitude. This proved the be extremely robust. Experiments with dynamic timing proved less reliable and, at best, only improved the pendulum’s start up time.