วันเสาร์ที่ 1 ตุลาคม พ.ศ. 2559

Variable frequency power inverter using Arduino เผยแพร่เมื่อ 29 มิ.ย. 2015 Smoothly controlling the speed of AC motors: A while back I got a very sturdy PTZ base, the Vicon V390 in the attached picture. This ptz head can handle up to 80 pounds. It looked perfect to handle the heavy and very nice refractors scopes with apertures of 4 inches or more, these refractors are heavy because the glass used in the objective lens is heavy, around 20 pounds or more. This base even have potentiometers in the pan and tilt assembly that will allow to incorporate azimuth, elevation data in real time to the captured video as I had done with other bases. The "only" detail is that this base uses constant speed 120 volts AC motors for pan and tilt. Then to be able to track "local" objects as anomalies, the more fascinating objects that you can find anywhere, that can be as static as an astronomical object or move as fast as a bird or an airplane we need a way to control smoothly the speed of these AC motors. And then the idea of using a variable frequency power inverter using arduino solved the problem. //Source code with some notes. #define MOSFET1 9 // Digital pin 9 to drive half a cycle #define MOSFET2 10 // Digital pin 10 to drive second half cycle int MaxFrequency = 60; // The maximal frequency to use int MinHalfCycleDuration = 1000000/(2*MaxFrequency); // The minimal time for a half cycle in microseconds int MaxHalfCycleDuration = 500000; // The minimal time for a half cycle of 1 hertz in microseconds int CurrentHalfCycleDuration = 0; int HalfCycleMiliSeconds = 0; int HalfCycleMicroSeconds = 0; int FrequencyPotPin = 0; // Ad0 int FrequencyPotValue = 0; void setup() { pinMode(MOSFET1, OUTPUT); // MOSFET 1 pinMode(MOSFET2, OUTPUT); // MOSFET 2 } void loop() { FrequencyPotValue = analogRead(FrequencyPotPin); // Value from 0 to 1023 CurrentHalfCycleDuration = ((MinHalfCycleDuration-MaxHalfCycleDuration)*FrequencyPotValue)/1023 + MaxHalfCycleDuration; HalfCycleMiliSeconds = CurrentHalfCycleDuration/1000; HalfCycleMicroSeconds = CurrentHalfCycleDuration - HalfCycleMiliSeconds*1000; digitalWrite(MOSFET1, HIGH); // MOSFET1 on delayMicroseconds(HalfCycleMicroSeconds); delay(HalfCycleMiliSeconds); // wait for HalfCycleMiliSeconds mS digitalWrite(MOSFET1, LOW); // MOSFET1 off digitalWrite(MOSFET2, HIGH); // MOSFET2 on delayMicroseconds(HalfCycleMicroSeconds); delay(HalfCycleMiliSeconds); // wait for HalfCycleMiliSeconds mS digitalWrite(MOSFET2, LOW); // MOSFET2 off }// end loop

ไม่มีความคิดเห็น:

แสดงความคิดเห็น