5.0

5.0 | 2 ratings Rate this file 53 Downloads (last 30 days) File Size: 19.2 KB File ID: #41528
image thumbnail

Raspberry Pi DC Motor H-Bridge Driver Block SFunction

by

 

29 Apr 2013 (Updated )

DC Motor Driver Block using Soft PWM of WiringPi Library

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

Motor Driver Block using Soft PWM of WiringPi Library.
This block controls both the magnitude and direction of a DC motor with an H-bridge such as the DRV8833 or the SN754410 using Soft PWM of the WiringPi library.

The reference zero speed is set with high voltage at both motor terminals (both PWM signals at full duty cycle). For the DRV8833 driver this creates a highly linear response and eliminates the typical dead band around zero speed. This increases motor response but may have a larger power draw (this has not been measured).

More information can be found at our website, along with other device drivers:

http://minseg.webs.com/downloads

A complete Arduino library and curriculum is available here:
http://minseg.com/pages/downloads

Other driver blocks on the way:
- Quadrature encoder
- MPU6050

Stay tuned!

This development is part of the Mechatronics curriculum at Rensselaer Polytechnic University

Acknowledgements

Device Drivers inspired this file.

Required Products Simulink
Target Support Package
MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
09 Jul 2014 Marco

Hi Joshua,

when I try to download the model to raspberry I receive this error:

The call to realtime_make_rtw_hook, during the after_make hook generated the following error:
Error executing SSH command: make: Entering directory `/home/pi/DC_Motor_Driver_Block_RPi_rtt'
"gcc" -I"

[...blablabla...]

fatal error: /home/pi/wiringPi/wiringPi/gertboard.h: No such file or directory

What am I missing?

Thanks,

Marco

06 Apr 2014 Leo

James - did you press build in the s-function windows?

26 Mar 2014 James

I receive the following error when I try to run the Simulink model:

Error in S-function 'DC_Motor_Driver_Block_RPi/Volts To RPi PWM 754410 or DRV8833 PWM High is zero speed/Include WiringPi Libraries': S-Function 'Include_WiringPi' does not exist

I am using R2013b and applied the bug fix that is described in the Device Drivers article by Giampero Campa. Thanks in advance for your help.

03 Jul 2013 Paul Kassebaum  
10 May 2013 Michael Lundgren

Just what I have been searching for. Good job.

Updates
22 Aug 2014

updated links

Contact us