It's possible use Arduino instead of a TL494 to make this Circuit:
How it's possible to emulate the TL494???
Thanks.
It's possible use Arduino instead of a TL494 to make this Circuit:
How it's possible to emulate the TL494???
Thanks.
The only problem I can see with using an Arduino instead is that the response time of the feedback loop may be a little slower; but I don't think that should be a problem. You'll need to read the Hall sensor and the pot from analog pins. Replace the thermistor by a temp sensor and read that from an analog pin too, so that you don't need the comparator.
Change the 68 ohm resistor to 120 ohm and the 820 ohm resistor to 10K. I suggest replacing the BUZ31L mosfet with another that has a lower Rds(on) at Vgs=5v so that it runs cooler.
Yes, i'm thinking that the slow response it isn't a problem...
But how i can use arduino to emulate the TL494 characteristic???
Thanks.
Rather then think about how to emulate the TL494, think about what an arduino would need to accomplish the same task. The output of the arduino could generate a PWM output signal using analogWrite() commands wired to a 'logic level' mosfet to control the current supplied to the magnet. The Arduino would also need a sensor input to be able to detect (measure) the distance that the object if from the magnet face, and that would use some sensor that can generate a 0-5vdc measurement value for wiring to a arduino analog input pin.
The rest is all just software. As the object gets closer to the magnet the PWM command would lower the duty cycle value and as the object gets further away the PWM could increase the PWM duty cycle. Looks like a interesting project.
Lefty
I once had a student do this for me for his final year degree project in physics. Note that the electronics is the simplest part of this. He did get it working but the mechanics was the most difficult part. It is very tricky getting it "just right".
Good luck.
Yes, I believe that the mechanical part is not to be neglected at all.
The measure of distance is apparently regulated by the potentiometer which in turn handles the change of the PWM signal sent to the MOSFET, so the more the object is close to the electromagnet will be low as the PWM duty cycle and vice versa ...
But then, that is the function of the hall effect sensor??
Now I'm wondering if there is a procedure for doing Arduino to do this work.
Thanks
alternatively if the circuit is easier I could build this ...
But how can I get the same function without using the OP-AMP and using Arduino???
Thanks
looks like an interesting project
do you want the metal object to float in the air ?
i suggest you use a steel ball that has a uniform mass and density to start with and pwm the coil using a potentiometer
you can then find out what roughly pwm duty cycle the device needs to remain stable
then you can fine tune the pwm using software from that point in closed loop
can you show us some pics of the parts you are using for the electromagnet
To emulate the TL494 in that circuit, your main loop will need to look something like this:
read temp sensor
if temp is too high then turn mosfet off
else read Hall sensor
adjust offset and scale reading to get a value in the range 0 to 1023 for values of the height you want
read pot
compare pot reading with adjusted Hall sensor value
use difference to adjust PWM output to mosfet (there are various ways of doing this, but a PID algorithm is the most flexible)
If you haven't used an Arduino before, I suggest you work through the tutorials, in particular how to use analogRead and analogWrite and how to set up the pins to the correct mode.
Thanks for the replies very fast and rich in content,
@ dc42:
reading the temperature sensor has already been made.
I do not know as they once compared the signal between the sensor and the potentiometer how to adjust the intensity of the PWM, I'd need something simple that can make it clear.
in other words, after comparing the two signals (compared how??) in a manner that resulted in sending the result to the change in PWM MOSFET?
Thank you.
To adjust the PWM, use something like this:
int oldError = error;
error = potReading - adjustedHallValue;
accumulatedError += error;
int pwmOutput = 128 + P * error + D * (error - oldError) + I * accumulatedError;
analogWrite(outputPin, (pwmOutput < 0) ? 0 : (pwmOutput > 255) ? 255 : pwmOutput);
where P, D and I are constants you need to adjust to get it stable. Start with D = 0 and I = 0. I'd suggest starting with P about 10. Too low and and the solenoid will probably drop the load; too high and it will be unstable i.e. too much height oscillation.
Depending on the sense of the error signal, you may need to negate 'error' at the start (you want 'error' to increase when the solenoid needs to pull more strongly). You can use the serial interface to display on the PC the readings from the Hall sensor and the pot, and the error and output values, so that you can see what is going on. However, calling Serial.print in the loop will slow it down, so if/when you remove it, you will need to decrease the value of D if it is not zero, or else insert a dely call in place of the Serial.print calls.
The P and D constants are a user defined costants or Potentiometer constants.
i don't understands this two lines of codes:
int pwmOutput = 128 + P * error + D * (error - oldError) + I * accumulatedError;
analogWrite(outputPin, (pwmOutput < 0) ? 0 : (pwmOutput > 255) ? 255 : pwmOutput);
What is the 128?
It's possible to regulate the P D and I constants automatically???
you may better describe the three variables P D and I?
Thanks
What is the 128?
Half of 256.
The Arduino's PWM is eight bit/
Sorry!!!
You do know that the levitation distance from the magnet is going to be very small, in the order of a couple of mm.
A couple of MM??? What??? is impossible... it will be around 1/3 cm...
The P and D constants are a user defined costants or Potentiometer constants.
i don't understands this two lines of codes:
int pwmOutput = 128 + P * error + D * (error - oldError) + I * accumulatedError;
analogWrite(outputPin, (pwmOutput < 0) ? 0 : (pwmOutput > 255) ? 255 : pwmOutput);
It's possible to regulate the P D and I constants automatically???
you may better describe the three variables P D and I?
Thank You
int pwmOutput = 128 + P * error + D * (error - oldError) + I * accumulatedError;
Simple PID.
This:
analogWrite(outputPin, (pwmOutput < 0) ? 0 : (pwmOutput > 255) ? 255 : pwmOutput);
is simply setting up the PWM, making sure it doesn't write a value less than zero or greater than 255.
A couple of MM??? What??? is impossible... it will be around 1/3 cm...
2mm vs 3.3mm doesn't seem to me to be that big a deal.
I don't understand...why 3 mm?
I don't understand...why 3 mm?
You said a third of a centimetre, which is 3.3mm
it will be around 1/3 cm.
Depends on size of the magnet, weight of the object to be levitated. Magnetic force decrease at square of the distance.