#include <PWM.h>int32:t frequency = 1000; //Hz// and then in the loop function:pwmWrite(Pin, Val)
converting the PWM-signal to a smooth signal, is that what i DAC does,
My problem is that I need to flatten out the signal or my Pizo might start to vibrate.
Should I but a resistor (R) and a Capasitor(C) and solder my own LP-filter?
Can I buy this as a neat small thing with input PWM and output smooth?
What frequency do you want this smoothed signal to change at?Have you read this:-http://www.thebox.myzen.co.uk/Tutorial/PWM.html
A piezo transducer is already a capacitor by its nature - you may only need a series resistor to get low-pass filtering. Some experimentation needed of course.
So, I need to move my piezo quickly, take a picture and then move again.I'd like a framrate of 200Hz. That means that after I take a picture, with a short short shutter speed, the piezo has less than 0,005s to move to a new position and become stationary.
That is a whole new ball game and not at all what you asked in the first post. I also suspect that it is not going to happen.What are you trying to do, this is coming across as a classic x-y problem.So explain what you want to do and with what equipment and give a link to this piezo that looks like it has to move a camera. It doesn't sound like it is a project for an Arduino.
Is it possible to buy this circuit?
I am searching for help on the design of a LP filter (or something else) that can smooth out a PWM-signal.
When it comes to the filter order i think 1st or 2nd should be adequate.
The Zero has the following hardware capabilities:10 pins which default to 8-bit PWM, like the AVR-based boards. These can be changed to 12-bit resolution.1 pin with 10-bit DAC (Digital-to-Analog Converter).By setting the write resolution to 10, you can use analogWrite() with values between 0 and 1023 to exploit the full DAC resolution
Is it not possible to use an I2C DAC?