How do I generate sin cos signals from arduino

I have an Advanced Motion Controls sinusoidal servo amplifier that I want to experiment with. It doesn't work like the other ones that use ±10v signals. This one takes an analog sine and cosine as input. The angle corresponds to the angle of the field you want to generate in the stator winding, and the voltage corresponds to the current or force of the field you want. Anyway, I want to know the best way to generate the sin cos signal.

What about something like this?

link to amplifier data sheet
http://www.a-m-c.com/download/datasheet/s30a8.pdf

You need to know what sort of frequency you want. And we need to know what sort of Arduino you have. But basically this is the code to start from :-
http://interface.khm.de/index.php/lab/interfaces-advanced/arduino-dds-sinewave-generator/

I'm not sure a single ended signal will work. Correct me if I'm wrong, but it seems like I'd need 2 h-bridges also to do it that way. I need a sine cos signal ±5 right?

Just AC couple if you want a signal that swings arround ground.

Your fault here is that you have not told us what you are driving from the Arduino. Links to data sheet needed and posted correctly so those of us on mobile devices can follow them, the icon to do this is the link chain.

You do not drive a H- bridge with a sin wave.

Grumpy_Mike:
Just AC couple if you want a signal that swings arround ground.

Your fault here is that you have not told us what you are driving from the Arduino. Links to data sheet needed and posted correctly so those of us on mobile devices can follow them, the icon to do this is the link chain.

You do not drive a H- bridge with a sin wave.

I fixed the links so they're clickable. The arduino isn't driving anything but the two 40kohm reference inputs on the amplifier. I meant you can drive an h-bridge with sinusoidal pwm, and then to create the bottom half of the wave, flip the h-bridge. I will need to drive the amp with a reference input frequency as low as 0hz, and on the high end, the higher the better, but it's not important. My thought are leaning towards a DAC like the MCP4922. It's 2 channel 16-bit so a huge increase in resolution, and it's just a few dollars. Since the sin angle will essentially be the angle of the amp's output, supposing I was driving a servo motor, with pwm&filter, I would only have 1.4 degrees of resolution. Sounds kinda sucky.

I meant you can drive an h-bridge with sinusoidal pwm, and then to create the bottom half of the wave, flip the h-bridge.

Can you? Sounds an odd sort of do to me. I am not at all sure how you drive a H-bridge with PWM and then flip it. Have you got a diagram of how you would do that?

My thought are leaning towards a DAC like the MCP4922. It's 2 channel 16-bit

No it's not it is a 12 bit DAC. It is also a single ended 5V chip so it will not give you the +/- you say you are looking for.

The SA30A8 amplifier has a differential input. You can bias the -ve input at 2.5V with two resistors from 5V and then swing the other input to 5V and 0V to get your sin wave going +ve and -ve.

I made ya a video. hbridge thingy That's a nice idea with the resistors. I think that's the way I'm going to do it. I've never used SPI before btw. I found another DAC that does ±10v output, MAX 5322. They also have the MAX680 charge pump thingy that makes ±10 supplies from 5v logic supply. Between MAX 5322 and the MCP4922, which one should I go with?

MCP has absolute max of -0.3 to +6.5V
Absolute Maximum Ratings †
VDD....................................................................... 6.5V
All inputs and outputs w.r.t .....VSS –0.3V to VDD+0.3V

So a +/-10V output seems unlikely.

The MAX5322 dual, 12-bit, serial-interface, digital-to-analog
converter (DAC) provides bipolar ±5V to ±10V outputs
from ±12V to ±15V analog power-supply voltages, or
unipolar 5V to 10V outputs from a single 12V to 15V analog
power-supply voltage.

So +/-10V input will leave you somewhat below +/-10V on the outputs.

You could check out DACs at AnalogDevices, www.analog.com, see what they have for rail to rail outputs.

Or add a rail-to-rail opamp with a little gain to get to +/-10V from whatever the MAX5322 outputs.

I made ya a video. hbridge thingy

Sorry no idea what that shows.
It appears to be a H-bridge switched at 10Hz but what it is switching I have no idea, in place of the normal power and ground the bridge is connected to it some sort of output at the top end and through a 2K resistor at the bottom end. I have no idea what it is supposed to do and I can't see it doing anything to the 10pF cap in the middle.

Grumpy_Mike:
I am not at all sure how you drive a H-bridge with PWM and then flip it. Have you got a diagram of how you would do that?

It's a 555 timer modulated with a triangle wave to create a sinusoidal PWM single ended signal. Then, it goes into an hbridge that's flipped at half the frequency of the modulating triangle wave. The resistor and cap make an RC filter to smooth the PWM into a biopolar sine wave output. With an arduino, it's way simpler. You just generate the sinusoidal pwm in code, you flip the h-bridge in code, and you get a bipolar sine wave output.

CrossRoads:
MCP has absolute max of -0.3 to +6.5V
Absolute Maximum Ratings †
VDD....................................................................... 6.5V
All inputs and outputs w.r.t .....VSS –0.3V to VDD+0.3V

So a +/-10V output seems unlikely.

So +/-10V input will leave you somewhat below +/-10V on the outputs.

I see I'd have to get a ±15v supply for ±10v output, but it's not a huge deal because there's a gain switch on the amp that let's it use ±5 or ±10 on the input.

Hello,
Just wondering what has happened to your project are you still developing it?

Regards
dafydd.