Raspberry Pi Simulink Driver Blocks ADC DAC PWM

버전 1.0.0.0 (36.9 KB) 작성자: John Whittington
Driver blocks allowing Simulink models to interface with PWM, MCP3008/ADS1115 ADC, MCP4725 DAC
다운로드 수: 4.1K
업데이트 날짜: 2015/6/18

라이선스 보기

Support for the Raspberry Pi beyond toggling GPIO. Joshua Hurst did some good work creating these blocks: http://uk.mathworks.com/matlabcentral/fileexchange/41529-raspberry-pi-pwm-driver-block-sfunction but there were a number of errors/steps lacking to get them compiling and working on a Raspberry Pi.
Uncomment or copy into another Raspberry Pi model the blocks you wish to use.
# Usage
* You must open the S-Function driver block and click 'Build' to generate the
embedded coder files otherwise you will receive an error 'sfcn\_.... does
not exist'.
* If using the ADS1115 and MCP4725 you will require my fork of wiringPi:
https://github.com/tuna-f1sh/wiringPi-mcp4725 see the README for
installation instructions.
* If using the PWM block, you will need to enable SPI in Raspbian - see: http://uk.mathworks.com/help/supportpkg/raspberrypiio/examples/analog-input-using-spi.html or enable via SSH.
* The scopes work in real-time on the Pi to see the correct data is going
to/coming from blocks.
* The discrete timestep is set to 'Ts' throughout the model. This is
initialised as 1e-3s at model load - it seems to be the sweet spot for
performance/usage. Remember to consider quantisation that this can create
with signals driving the blocks.

# Notes

* wiringPi softPWM:
https://projects.drogon.net/raspberry-pi/wiringpi/software-pwm-library/
* Do not sure both ADC blocks at once without changing the wiringPi 'pin'
assignment - it won't work.
* See the post on my blog explaining how these work: http://wp.me/p2C0Bi-bK

# Install wiringPi Fork

1. Login to the Pi via SSH.
2. `git clone https://github.com/tuna-f1sh/wiringPi-mcp4725`
3. `cd wiringPi-mcp4725`
4. `./build`

www.jbrengineering.co.uk - @j_whittington - 2015

인용 양식

John Whittington (2024). Raspberry Pi Simulink Driver Blocks ADC DAC PWM (https://www.mathworks.com/matlabcentral/fileexchange/51232-raspberry-pi-simulink-driver-blocks-adc-dac-pwm), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2014b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Simulink Supported Hardware에 대해 자세히 알아보기
커뮤니티
 Power Electronics Control 커뮤니티에 더 많은 파일이 있습니다

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

rpi-driver-blocks/

버전 게시됨 릴리스 정보
1.0.0.0

Added link to my blog
Forgot link again....