Does anyone know of a voltage isolator which can be used to isolate power circuitry from the Arduino computer?
To be more specific, I am using a 110V dc motor, 0.1 Hp, fed from a full wave diode bridge rectifier connected to the 120VAC domestic household service and intend to control the motor speed and position with regulators via the Arduino computer and a MOSFET transistor. This will require motor terminal voltage feedback to the Arduino.
The problem is that the domestic service has one side grounded so the output of the rectifier cannot be tied to ground yet the Arduino will require a voltage signal with one side connected to ground. Thus an isolator is required which will accept a grounded or ungrounded voltage input and give an output voltage referenced to ground for the Arduino. Obviously a voltage reduction is necessary but this is easily done.
In industry this is done with a "High Voltage Isolator" the size of a big shoebox and several thousand dollars. I am looking something more appropriate to the Arduino.
Well, if you don't need high accuracy, an analogue optoisolator circuit will work. You haven't given us any details about the isolation in the control direction. How experienced are you? Mains power is extremely dangerous.
I've considered the opto isolator idea and it's a maybe.
The isolation control to power circuitry will be PWM Arduino output to opto isolator to MOSFET gate. Obviously this will require a bit of circuitry at the MOSFET gate control but this is doable.
As for experience, master degree in electrical engineering and 28 years industrial control system design.
Yes, I know the 120VAC can be dangerous and the final product will have to meet the appropriate safety standards.
At the moment it is at the breadboard stage.
The master degree was from the days of the 2N107 transistor rated 10 ma. I probably have a few around.
Well, that is certainly reassuring! Assuming that you are reading fairly high voltages, the opto LED forward voltage becomes relatively insignificant, the linearity of the transfer function is not ideal, but it might serve as is, or could be calibrated in software.
This will require motor terminal voltage feedback to the Arduino.
No... Since the Arduino is controlling the "voltage" (PWM, I assume) the Arduino already knows what the DC output is.
You do need to isolate the MOSFET from the Arduino, but PWM is digital and an opto-isolator will work fine. Assuming you have position sensors and possibly a speed sensor, those are mechanically isolated and can run from low voltage.
AC dimmers and motor controllers do need to detect the AC zero-crossing, so you do need an isolated input for the phase information as well as an isolated output. But that's all timing-related, not voltage-related so again optical isolation can be used (although, I used a transformer for phase-detection when I did it.)
The more I think about your opto isolator idea the better it looks. I'll have to do some calibration measurements then program in either a lookup table or curve fitting calculation.
DVDDoug
The motor terminal voltage is a function of applied voltage which is a rectified sine wave, the motor CEMF which will be pretty flat dc and the motor IaRa drop which will depend on motor current. All the Arduino controls is the on/off time ratio which it puts on the PWM output, hence the need for the Arduino to know what voltage it is actually getting at the motor terminals so that it can adjust the time ratio.
The usual way to get a well behaved position regulator is with 3 nested loops.
1/ An internal high speed voltage or current control loop. Whether voltage or current is a question I will have to decide.
2/ A speed control loop which uses a measured speed feedback and generates a voltage reference for the voltage loop.
3/ A position control loop which uses a measured position feedback and generates a speed reference for the speed loop.
Speed feedback can come from a pulse tach on the motor shaft.
Position feedback can come from the same pulse tach with the addition of an index pulse which tells the Arduino where to start counting.
These 3 loops must be designed with progressively slower responses from the inner to the outer loop;
3 to 1 ratio is a good rule of thumb but I've shaved this some when necessary.
Some may think this is complicated but my experience is that it less complicated than trying to get it to work with multiple unknown time constants some of which are sure to be oscillatory.
Hi,
I assume you are using a motor with a geared output, so you can stop at set positions?
Motor/gearbox specs please and what is the intended rotational speed?
phoxx:
The motor terminal voltage is a function of applied voltage which is a rectified sine wave, the motor CEMF which will be pretty flat dc and the motor IaRa drop which will depend on motor current. All the Arduino controls is the on/off time ratio which it puts on the PWM output, hence the need for the Arduino to know what voltage it is actually getting at the motor terminals so that it can adjust the time ratio.
Based on the information you have provided so far, won't the motor terminal voltage be something like this (ignoring effects of inductance and any smoothing capacitors)?
TomGeorge
I figured sooner or later someone would be interested in the application; but first a bit of background:
I have a metal turning lathe which is theoretically capable of cutting both metric and imperial threads.
The hooker in this is that it's impossible (according to the maker) to have a threading indicator dial which works with both metric and imperial threads so it is necessary, once a thread is started to keep the split nut closed on the lead screw until the thread is finished and to reverse the spindle rotation to come back for the next cut. I find this a very awkward way to work and some configurations near impossible.
What I want to do is power the lead screw with the motor and to position regulate the carriage with the cutting tool so it follows the spindle rotation. Sounds complicated but imagine the carriage travel divided into portions of 1 screw pitch length--then for each position of the spindle in one rotation there will be a specific position of the cutting tool within the screw pitch length and the task of the position regulator is to maintain this position. On the next turn of the spindle the carriage will start on the next portion. Thus the motor will not stop; it keep moving to keep up with the spindle.
The motor which I have is rated 0.1HP 110vdc 700 rpm after the internal gear reducer which as far as I can make out is 5:1. It's a real antique, made to admiralty specs in Leaside which is now part of Toronto in 1944.
Archibald
Yes I expect something like you've shown. The motor current, and thus torque will probably be in pulses during the time the voltage is above the back emf and off otherwise.
The job of the terminal voltage regulator is to provide a reasonably linear transfer function for speed regulator output to terminal volts with a fairly fast time constant .
We seem to have run out of new ideas so I will take the opto isolator working in analog mode approach.
It seems a little strange to me that no one has run into this problem before.
If the motor terminal voltage went to zero between PWM pulses, the average terminal voltage would be proportional to the PWM duty cycle (108 times the duty cycle) so you would not need to measure the voltage. Do you want your measured average voltage to be highly dependent on the back-EMF?
It's not clear to me what will actually be driving your motor. If it's a power MOSFET, will you need to include a diode to prevent the MOSFET being reverse biased by the back-EMF?
If the motor terminal voltage is as shown in my previous post, then you will not be able brake the motor electrically: you would have to rely on friction etc. In other words there will be a nasty non-linearity of the transfer function.
As you will probably be making several cuts for a screw thread, with the lathe tool being advanced a little after each cut, it is vital that each cut starts at the correct position on your workpiece and that position of the apron remains accurate during each cut, even on a long thread. On your second cut the lathe spindle may run slightly slower than on the first cut due to increased load. How would your motor adjust lead screw speed accordingly? Are you placing shaft encoders on the lathe spindle and on the lead screw?
While I appreciate you may have a budget restriction, I think you should consider driving the lead screw with a stepper motor (directly or via a toothed belt) and using essentially digital control between a shaft encoder on the lathe spindle and the stepper motor. This should make it much easier to get each cut of a thread to start at the correct position. Also it should make it easier to cut multi-start threads.
If you still think you need to measure motor terminal voltage, you may be able to use a version of this circuit.
The motor terminal voltage will not go to zero between pulses but the current will probably go to zero between pulses. The terminal voltage is caused by the motor acting as a generator while coasting between current pulses and its value depends on the speed. Each time the voltage pulse from the rectifier goes above the Tv the motor will draw some current and so produce torque to meet the load and keep turning. The PWMing(to invent a word) from the arduino will control the rectified voltage and thus the motor current which generates the torque. A fundamental equation for a dc motor is:
Terminal volts=CEMF + IaRa and you can re-arrange this to: Ia = (Terminal volts - CEMF)/Ra
Ia = Armature amps and Ra = armature resistance. The torque produced is Ia x Kt where, in the imperial system Kt is the lbft/amp.
There can't be any reverse current between pulses because the rectifier bridge will block it. Perhaps I should have said that the output of the rectifier bridge, the MOSFET and the motor are connected in series.
Your concern with braking is valid and I am depending on friction load to provide sufficient braking. If it does not a resistor across the motor will give more braking. Your concern with controlling where the cut starts and with motor speed are the precise reason why a position regulator is needed. Yes there are pulse tachs on the spindle and lead screw drive with the addition of an index pulse to give a reference to the real world. I've already made the spindle PT from a CD disk and it works like a charm to give rpm.
phoxx:
I looked at your reference and it is a more or less standard isolator. Only problem is that 160v peak is much too high for it.
Thanks for your replies.
My reference has a voltage divider on each input so it can work with high input voltages. You would need to interchange the inputs if you ever cut a left-hand thread.
I assume you will be smoothing the voltage with a simple capacitor-resistor network (or equivalent) before it reaches the Arduino. Incidentally, this could have a serious effect on your control. While I'm happy with your theory for ordinary DC, I wonder whether you have considered sufficiently the implications of using a rectified waveform and PWM. Much of the time within a waveform cycle the voltage may be only the back-EMF. I think it would be better to monitor the current as you have suggested. How about measuring current with a shunt resistor, one end of which is connected to ground?
1/ I've been looking more at the opamp isolator and, yes the voltage can be bridged down to something suitable for an input. This leaves the problem of a pos and neg power supply for the opamp. If you look at the rectifier bridge + terminal to ground it is a + 1/2 wave and the - terminal is a - 1/2 wave. A suitable capacitor to ground on each terminal will give +/- reasonable dc which can then be used with a pair of zener regulators to give a pos and neg supply for the opamp. It just might work! I'll have to try it.
2/ Filtering a feedback is usually a bad idea. It introduces a lag, that is a 1/(1+ts) factor into the loop gain which then forces you to lower the dc loop gain to maintain regulator stability. That said, you sometimes add a bit of noise filtering but you have to keep the time constant very short.
3/ The matter of regulating voltage via PWM is interesting and I've put some thought into it. If the voltage regulator can be made fast enough it will reduce applied voltage at the peaks and increase it when below the CEMF. I know that with SCR converters the loop gain must be kept lower for a single phase supply than foe a 3 phase supply. This is something to be learned.
4/ The use of a current rather than voltage regulator may be better and this is why, in an earlier post I said I would have to decide it. Speed/Current regulators are much used in industry where a high performance drive is needed. For some applications they have a major disadvantage in that the load plus motor inertia is a factor in the loop gain so if the connected inertia changes it can affect stability. The load inertia connected to the motor is multiplied or divided by the gear ratio squared so on a substantial gear down as I have here, with any luck it will be insignificant.
I appreciate your comments on the design as it brings up questions to be answered. Sort of like defending a masters thesis!!
Archibald--
I thought about a stepper at first and it may be the way to go but it still requires a good position regulator.
I guess I'm fixated on a dc drive because in the distant past I did much the same thing---
a 4000 HP dc generator used as a motor to bring an MG set up to speed then position match the 8000 HP synchronous motor rotor to the power system 60 Hz supply so that the breaker could be closed whenever desired. It could have been done with a synchronizing relay but the customer wanted it this way---and he was paying.