Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
About SIMULINK and DAC
#1
Hi, I have some questions about the user servo algorithm.

I want to replace the default PID algorithm with active disturbance rejection control (ADRC) algorithm (P.S. If anyone has done it, please favour me you instruction).

Thus, I creat an ADRC servo algorithm with SIMULINK. However, in the frame of ADRC, the calculated control input (as u) into "PPMAC_Servo_RTN" is given an actual phycial meaning (i.e. control voltage). The value of u must be the same as the actual voltage.

Therefore, I want to know the relationship between the digital and analog quantities. In my opinion, if the 16-bit (i.e. ±32,768‬) DAC corresponds to analog output range ±10v, the value entered into "PPMAC_Servo_RTN" should be u*32768/10. Is that right?

(P.S.) Last week, in order to test the relationship, I created a SIMULINK program in which the constant module (value of 1) outputs directly to the "PPMAC_Servo_RTN". And then I wanted to measure the output voltage with multimeter to get the relasionship. Unfortunately, the ppmac made some mistake. Is it because the program can't be written this way?

Please leave your valuable comments. Thanks.
Reply
#2
If you want to run this as part of your overall system simulation, then to convert PMAC's +/-32,768 numerical command range to voltage, you will want to add a gain block that multiplies this value by (10V / 32,768 LSBs). Note that this is the inverse of what you suggested.

However, if you want to run your algorithm on the PMAC, you do NOT want to use this gain block. The result of your algorithm must be a numerical value in the +/-32,768 range. This is what the software will write when it is done.

The gain block you propose is to simulate the function of the hardware DAC. It is part of your model of the plant, not of the software algorithm.
Reply
#3
(06-19-2020, 11:14 AM)curtwilson Wrote: If you want to run this as part of your overall system simulation, then to convert PMAC's +/-32,768 numerical command range to voltage, you will want to add a gain block that multiplies this value by (10V / 32,768 LSBs). Note that this is the inverse of what you suggested.

However, if you want to run your algorithm on the PMAC, you do NOT want to use this gain block. The result of your algorithm must be a numerical value in the +/-32,768 range. This is what the software will write when it is done.

The gain block you propose is to simulate the function of the hardware DAC. It is part of your model of the plant, not of the software algorithm.

Thank you for your answer.

I'm sorry. Maybe I didn't express my question clearly. As we know, I can use SIMULINK to create a algorithm on the PPMAC. My algorithm must run in international units, that is, the units of feedback must be converted from counters to meters, which means all numerical values are assigned physical meaning. As a result, the control input calculated by the algorithm (as u) is going to be on the order of +/-10v. As you say, the result of algorithm must be a numerical value in the +/-32,768 range. So I want to know how to convert it to +/-32,768.

For example, if my plant need 6v voltages, the u calculated by the algorithm is around 6 (P.S. Although this is a numerical value, it has the physical meaning of being equal to the actual analog voltage). Therefore, in order to output 6v voltages, should I multiply it by (32768/10)? And then, when it goes through the DAC module, it's multiplied by (10/32,768). As a result, the plant gets 6v voltages. Am I making myself clear?

Thank you again for your answer.
Reply
#4
If I understand you now, you want to write an algorithm in the engineering units of the plant, so your core algorithm will produce a result in volts that would be supplied to the DAC.

In this case, you are correct that you need to multiply this value by 32,768/10 to get the numerical result that PMAC needs.

Of course, the hardware DAC circuit acts as a gain block that effectively multiplies this by 10V/32,768LSBs.
Reply
#5
(06-22-2020, 09:09 AM)curtwilson Wrote: If I understand you now, you want to write an algorithm in the engineering units of the plant, so your core algorithm will produce a result in volts that would be supplied to the DAC.

In this case, you are correct that you need to multiply this value by 32,768/10 to get the numerical result that PMAC needs.

Of course, the hardware DAC circuit acts as a gain block that effectively multiplies this by 10V/32,768LSBs.

I have understood. Thank you very much.

Best regard for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)