main content

implement field-凯发k8网页登录

this example shows how to deploy a field-oriented control (foc) algorithm for brushless dc motors to an soc device by using a custom board target. a custom board target for the trenz electronic motor control development kit, based on xilinx zynq ultrascale mpsoc, allows the foc application to be deployed as a mix of software to the arm cortex-a processor and hardware to the programmable logic of the device. this example uses the model and control algorithm partitioning developed in the example.

requirements

add trenz custom board support

this example includes file createcustomboard_te0820 script and premade te0820_ps.tcl. add the trenz custom board definition to the soc blockset board registry by running createcustomboard_te0820 script.

board registration files get generated into the same folder. for more information on how to create and register custom board support with soc blockset, see .

using the tool, you can create an empty model configured to the target the selected board and reference design. for information on how to create reference design, see (hdl coder). other elements of the model, such as algorithm, can then be added.

this example includes the soc_trenz_top model created with soc model creator tool based on a shipping reference design trenz te0820 with cr00140 containing the adc, encoder, and pwm components.

the model has been updated to include the design elements of the foc application from the example. run this command in matlab® command prompt to open the model.

open_system("soc_trenz_top.slx")

in the system on chip tab, you can see the current hardware board selection set to trenz electronic te0820 custom soc board.

set up the trenz electronic motor control development kit

connect parts of the trenz electronic motor control development kit as shown in this image.

  1. 5v dc power supply

  2. sd card

  3. micro usb cable for uart and jtag

  4. ethernet cable

  5. encoder connector

  6. 24v dc power supply

  7. motor power cable (a, b, c)

  8. 24v brushless dc motor

  9. switch 1 (s1) controls power to the driver board

download the prebuilt linux image from mathworks github repository. the linux image is built with builroot and kernel version 4.9. extract the zip archive onto the microsd card and insert the card into the sd card slot on the hardware board.

implement and run on hardware

click configure, build & deploy to launch soc builder from soc_trenz_top model and follow the steps.

in the step select build action, choose build and load for external mode to monitor the motor operation from simulink®. open the simulation data inspector and observe the velocity command and motor velocity response.

other things to try

you can use dashboard blocks to interactively set the reference speed from the generated software model. the soc_trenz_top_sw_exmode model is provided as a reference.

网站地图