Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

frequency to bipolar voltage converter using dsPIC

Status
Not open for further replies.

ee307014

New Member
Hi,

I am working on a project, frequency to bipolar voltage converter using dsPIC30F4012, the important point is without any time lag.

any help would be highly appreciated.
 
To reduce time; do not measure frequency but measure time period. F=1/t
You can measure t for each 1/2 cycle.
 
Thanks for Ronipson, for you reply actually, i have attached for the reference what i am trying to work on,

the mentioned 1,2 and 3 are the tasks i have to perform.

How i am going to convert this frequency to Voltage,
 

Attachments

  • IMG_2913.JPG
    IMG_2913.JPG
    1.1 MB · Views: 296
  • IMG_2913.JPG
    IMG_2913.JPG
    1.1 MB · Views: 250
Having tested HDD's for many years from the inside out, I have yet to find a servo system more sophisticated , fast and accurate as those use in hard disk drives.

Although the motor can seek to within 10u" accuracy is a rotary voice coil DC motor, the servo feedback is quadrature differential pulses embedded between each track and sector.

The position error signal (PES) from these servo dibits differential amplitude and then differentiated to create velocity and again for acceleration. The HDD servo auto-calibrates magnetic force gain in each directions and compensates the gain error also as a function of temperature with sensing. Each zone may have a different servo profile. The servo control is not simply PID feedback but PID target and PID feedback. This gives the fastest most stable loop. In other words, each servo seek has an acceleration profile, max velocity speed limit and a position error profile to prevent all overshoot in the shortest time. a few milliseconds. Even when we were using 1 Hp linear voice coil motors in 14" HDDs in the early 80's , our best product could seek with a large mass in 50ms avg with embedded servo.

Always start a big project with specs. ( before you start asking for F/V converters, as those are easy with a PLL and position encoder that multiplies frequency of RPM for high bandwidth.

So do me a favour and define your servo in simple point form.
Mass range, max acceleration, max velocity , position error, maximum seek time, power requirements, ambient specs.
 
Last edited:
Having tested HDD's for many years from the inside out, I have yet to find a servo system more sophisticated , fast and accurate as those use in hard disk drives.

Although the motor can seek to within 10u" accuracy is a rotary voice coil DC motor, the servo feedback is quadrature differential pulses embedded between each track and sector.

The position error signal (PES) from these servo dibits differential amplitude and then differentiated to create velocity and again for acceleration. The HDD servo auto-calibrates magnetic force gain in each directions and compensates the gain error also as a function of temperature with sensing. Each zone may have a different servo profile. The servo control is not simply PID feedback but PID target and PID feedback. This gives the fastest most stable loop. In other words, each servo seek has an acceleration profile, max velocity speed limit and a position error profile to prevent all overshoot in the shortest time. a few milliseconds. Even when we were using 1 Hp linear voice coil motors in 14" HDDs in the early 80's , our best product could seek with a large mass in 50ms avg with embedded servo.

Always start a big project with specs. ( before you start asking for F/V converters, as those are easy with a PLL and position encoder that multiplies frequency of RPM for high bandwidth.

So do me a favour and define your servo in simple point form.
Mass range, max acceleration, max velocity , position error, maximum seek time, power requirements, ambient specs.

Let me make it simple, this is the setup for CNC machines, i have the controller but it gives STEP/DIR output and the problem is the servo amplifiers that are already available takes input as +-10v, precisely i am talking about FANUC servo drives,
For the answer every machine is differnet from one another, having differnet Mass range, max acceleration, max velocity , position error, maximum seek time, power requirements, ambient specs.
I hope you got my point :)
 
I have a young friend who restored two Bridgeport CNC's with all new Servo electronics and interfaced to Windows. If this is same size CNC as yours, I can get details.

Step and Direction control output is the same method that was used on all HDD's and FDD;s in the 80's. The controller would send a burst of pulses with direction polarity and the drive would count them then control the stepper motor with an accelerated rate of quadrature driven outputs to the actuator to get the fastest and most stable response. It would use micropositioning PWM for fine positioning.

So it is not F2V conversion but pulse accumulator with direction for position control with datum switch sensing for resetting the position counter.

Linear controlled servo requires linear feedback and limit switches for sensing out of range.

Please define your requirement with all inputs and output parameters, budget etc.
Pulse counters are trivial.
 
If your controller does not have buffered Seeks, i.e. burst mode step and direction then the PID parameters are not as useful as your controller pulse rate over-rides the servo control and limits the maximum acceleration (torque ) and velocity (RPM) from encoder.
Therefore to optimize performance of UHU you need to have a buffered seek from your controller and then use a serial commands to create an optimized servo profile based on your system dynamics for load, stiction, torque and inertia. Otherwise the servo is sub-optimal.
After a self calibration routine, which you must design, parameters may be optimized for gain of PID. If not then you must do this by trial and measure the error response. The ideal servo maintains a small percentage error for minimum overall time, from 1) ramped Torque or acceleration Mode is step 1, Maximum velocity determined by encoder, sampling rate and system limits for eddy current losses on motor RPM is step 2 then back to step 1 for Deacceleration Ramp control until a target minimum velocity is reached , so that it can go into Mode 3 or Position error loop control.

Since load is extremely dynamic with backlash and milling loads, it is suboptimal to simply assume your controller will issue the commands to match your needs without sensing Acceleration erro, velocity error and position error simultaneously while issuing commands to generate a target profile that will generate the least squared error of the system. With this servo design in mind, you can reduce seek times of servo systems in half and while having <10% overshoot or make it critically damped. Note the UHU examples do not accomplish this.

I can simplify or expand the ideal servo system design parameters, if you can define your output and inputs and expected response requirements. this is the same job defined for all stepper and linear servo controlled disk drives that became the fastest in the world 30yrs ago. with position errors < 5% of the resolution of the encoder and the fastest rates supported by the motor torque, mass and distance to be traveled. this design method is still used today and far exceeds the resolution, speed and performance of typical CNC controllers like FANUC.

this can all be accomplished by providing good phase margin in each A,V,P control modes especially with dynamic system resonance frequencies. HDD resolution today is 1% of 50nm track pitch. Your system is large but the plant system parameters are similar.

It all depends on your overall requirements. e.g. just make it work, or make it work at the best performance and stability possible with dynamic disturbances. (step loads, no load, back EMF, anti-backlash)

This may be possible using UHU and perhaps bigger motor drivers, but you must define the input and output response characteristics first and then the PID loop variables and target profiles come out as a result.
 
Last edited:
If you wish to have the best performance control, rigidity and disturbance immunity then defining all inputs outputs and characteristics is necessary.

THe result uses not just PID parameter but PIV and feedforward target profiles to eliminate stimulating system resonance at maximum bandwidth.
You start by defining all inputs outputs and desired process response, then the intermediate variables are defined before a solution is chosen. e.g. max encoder pulse rate vs sampling rate ( which affects RPM and encoder choices as well as jitter or error signal)
 
This is a diagram of a Feed Forward Servo profile with a smooth trajectory desired and with feedback for Acceleration, Velocity and Position each loop if proportional can be very stable but with PID on multiple sensor feedback (d,v,a) is far superior to simple PID loops from position encoder but much faster, less jerk and machine wear, more torque, less disturbance error and much less jog time between operations, and less PES with stiction and loading effects.
upload_2015-11-13_13-36-0.png
 
The controller would send a burst of pulses with direction polarity and the drive would count them then control the stepper motor with an accelerated rate of quadrature driven outputs to the actuator to get the fastest and most stable response. It would use micropositioning PWM for fine positioning
Now this is exactly the point i need to implement, the information you provided is really great.. i have read all of your post, now compiled some data to post to make the picture clear

1) I have the CNC controller which send burst of pulses with direction, this is controller is open loop
2) I have fanuc Servo amplifier and motor with encoder (2000ppr quadrature encoder), servo amp takes +-10v input
3) but what i don't have is the interface between the CNC controller and the fanuc drives, what i need

attached is the picture of original system

i have underlined with Red, what i needed.
 

Attachments

  • IMG_2946.JPG
    IMG_2946.JPG
    77.4 KB · Views: 260
  • IMG_2947.JPG
    IMG_2947.JPG
    154.2 KB · Views: 270
  • IMG_2955.JPG
    IMG_2955.JPG
    107.1 KB · Views: 235
Clearly this is not a design spec and just a simple connection diagram.

I guess this is not a design project, and just a buy project to integrate

**broken link removed**
 
Last edited:
Dear Tony Stewart,

Thank you for your help, Honestly writing i didn't have the idea this problem is this much complex for me as i don't have much experience, i tried my best to explain but the problem seems to be really complex.

i might get some plug n play solution i could buy,

For the answer this is all i know, having differnet Mass range, max acceleration = 200ms, max velocity = 3000mm/min , position error= 0, maximum seek time, power requirements = 1.5kw

Any Other solution than UHU, as it has its own limitation?

Thank you once again you surfed a lot of time on me :)

Best Regards,
Faisal
 
How much basic Physics do you know about mass and acceleration, torque , RPM. Power of motor, supply etc

What do you have & need to do exactly and your budget and time avail.

THese affect your incomplete specs. Do your homework then finish specs.
 
after specs are done fully...
A simple frequency to voltage converter is slow and affects rate of change of loop, but a tach circuit or 1-shot with high order low pass filter requires a frequency multiplier to reduce ripple at low speeds thus a faster method is to integrate of each period and hold restart integration and update hold capacitor with a CMOS switch choosing current source and Cap to operate at the lowest desired speed control after slowing down and using position feedback instead. This is done digitally in DSP's or uC software for lower part count by a accumulating a clock count between pulse intervals over the range in which Velocity feedback is used. It is not used in Position tracking mode as the interval is too long. Acceleration Error Signal (AES) is also used based on the derivative of velocity changes per measurement interval.

Thus thresholds for Position Error Signal (PES) frequency bandwidth and Velocity Error Signal (VES) bandwidth are determine by your Heirchical Input Process and Output specs (HIPO), which is a style of spec writing defined by IBM in the 60's. Each branch or layer of the design (top>down) specification gets into more and more detail before implementation begins by defining all of these parameters, which ultimately determine your encoder resolution and index (IDX) mark sensor ( once per rev). In linear servo systems, this reference is usually called the Datum or HOME position. There are also limit switches for safety.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top