nerosmile.blogg.se

Creating falling blocks in mathlab
Creating falling blocks in mathlab










After filtering the pulses we need to fourfold multiply the resolution using finite state ma- chine (FSM). 5 μ s can be considered to be a jitter (which was confirmed experimentally. Considering the fact that duty cycle is 50 %, the shortest impulse lasts 10 μ s, so it is guar- anteed that every impulse shorter than 2. It follows that minimal duration of a single encoder impulse is T = 20 μ s.

creating falling blocks in mathlab creating falling blocks in mathlab

In that case total number of impulses generated in one minute is 3 000 000, or 50 000 imp/sec. For example, we can say that encoder resolution is 1 000 impulses and motor rotation speed 3 000 rpm. This number of impulses depends on encoder resolution and motor rotating speed. In order to determine minimum duration of impulses t under which every short impulse is considered to be jitter, it is necessary to define the largest number of impulses that are generated by the encoder. Their presence has negative effect on correct counting of impulses that as a result provides incorrect information about the position. Signals that are accepted from encoder output may contain noise and jitters. Clock pulses for noise filtering of inputs A and B are connected to the input T enc. Outputs of encoder A and B are connected to inputs E1 and E2. 5) serves for the purpose of accepting and processing the signal from encoder. There are also encoders which provide unprocessed signal, in other words sinus, usually with 1 VPP voltage at output, and they are not supported by interface cards which means that those signals have to be additionally processed. and those are encoders with embedded electronics. Encoder outputs support various logic standards and interfaces such as HTTL, TTL, RS485, RS422 etc. Incremental encoders are produced in wide resolution spectrums, from 500 to 5 000 impulses.

creating falling blocks in mathlab

Turning direction is determined by which pulse, A or B is ahead in relation to one an- other. At encoder output there are two symmetrical pulses A and B which phase 90 ◦ and index output Z. The number of openings is proportional to the number of impulses (encoder resolution), so by counting the impulses the information about angular displacement can be acquired. They have a source of light and light receiver where a disc with openings is positioned between them. Incremental optical encoders are used to generate two pulses, A and B used for calculating the corresponding angular displacement. The most common component for this purpose is an incremental encoder. In order to design position control structures that are common in robotics, mechatronics, etc., it is necessary to have information about real position of the controlled object. In this way, there is possibility to obtain responses of designed control structure immedi- ately without need for compiling FPGA circuit again. The idea is that values of parameters can be man- ually entered by buttons on FPGA DE development board in real time. 4 is shown PID controller block that has inputs for entry parameters of PID controller ( K P, K i and K d ). 3 ms causing certain mismatch between their responses. Analysing the responses of both PID controllers, it is possible to conclude that PID controller realized in DSP Builder has similar responses as PID controller realized with Matlab blocks, therewith that PID controller realized in DSP Builder generates output signal each T s = 1. The chosen clock period of 1.3 ms is commonly used for design of various control structures such as a motor drive, robotics, mechatronics, etc.

creating falling blocks in mathlab

The abscissa axis presents the time specified by number of clock periods T s where duration of one period is 1.3 ms. The one is deployed with standard Matlab blocks and the other by using DSP Builder. Figure 3 shows responses of two PID controllers. Open-loop response of deployed PID controller in Matlab environment for unit step signal at input has been tested by simulation. part of PID controller is accomplished by Tustin approximation that gives better results than Euler’s forward and backward approximation.












Creating falling blocks in mathlab