Show Posts
|
|
Pages: [1]
|
|
5
|
Using Arduino / Project Guidance / Matlab IO Chirp Signal
|
on: February 14, 2012, 03:31:43 pm
|
|
Hi, Forgive my ignorance i am new to this, and i have done a few (unsuccessful) searches to try and solve this.
i am trying to output a chirp signal from my arduino mega pwm out, from maltab. however i cannot put a function as the output. I have tried to use a for loop to solve this but have come to no avail! any help or suggestions would be much appreciated. the code i have tried to use is as follows.
clear all; clc;
%connect board
a = arduino('/dev/cu.usbserial-A9007LCD')
%specify pin modes
a.pinMode(3,'output');
t = [0:0.01:10];
ch = chirp(t,0.0001,10,10);
for i = 0:numel(ch) a.analogWrite(3,ch(i,:)) pause(0.01) end
Thanks very much
Ran
|
|
|
|
|
6
|
Topics / Science and Measurement / matlab io chirp signal
|
on: February 14, 2012, 01:47:16 pm
|
|
Hi, Forgive my ignorance i am new to this, and i have done a few (unsuccessful) searches to try and solve this.
i am trying to output a chirp signal from my arduino mega pwm out, from maltab. however i cannot put a function as the output. I have tried to use a for loop to solve this but have come to no avail! any help or suggestions would be much appreciated. the code i have tried to use is as follows.
clear all; clc;
%connect board
a = arduino('/dev/cu.usbserial-A9007LCD')
%specify pin modes
a.pinMode(3,'output');
t = [0:0.01:10];
ch = chirp(t,0.0001,10,10);
for i = 0:numel(ch) a.analogWrite(3,ch(i,:)) pause(0.01) end
Thanks very much
Ran
|
|
|
|
|
8
|
Using Arduino / Project Guidance / Re: PWM Sine Wave
|
on: November 25, 2011, 09:29:22 am
|
|
Sorry I realise this has got confused. Obviously I didn't word my question correctly to begin with. I know the pwm output is a square form signal. I need to generate sinusoids within the Arduino software which are then output as equivalent pwm signals, that I can record.
I understand that creating a low pass filter is relatively simple however my tutor would like me construct a model to determin the RC values , so I don't really have a choice.
|
|
|
|
|
9
|
Using Arduino / Project Guidance / Re: PWM Sine Wave
|
on: November 25, 2011, 08:36:39 am
|
|
Thanks very much. Once i have created a repeating square wave how do I record it to a file on a computer? Do I need any special kit? Thanks again
|
|
|
|
|
10
|
Using Arduino / Project Guidance / PWM Sine Wave
|
on: November 25, 2011, 08:09:12 am
|
|
Hi all, I am completely new to arduino. For a 3rd year Mechanical Engineering project I have been asked to create an arduino control system for a single axis shaking table.
I want to use a low pass filter to convert the PWM output of the arduino board to an analogue signal to then input into the analogue to PWM converter inbuilt in the pre-existing actuator (the rig itself is many years old). Removing the analogue to PWM converter from the actuator for the shaking table doesn’t seem feasible at this point.
What I would like to know is how I can get the arduino to implement a sine wave in PWM and record it to a file I can open in Matlab/Simulink. This I hope would allow me to run simulations and determine the best RC values for the filter.
Thanks in advance R
|
|
|
|
|