fixing a mess i made, probably...

More
17 May 2024 16:50 #300846 by tommylight
A few days back i posted a reply regarding analog and PWM where i think i stated that alanog outputs can be set to output +5V only, that is corrct, but then i went on to state that it will work for PWM inputs <this is not correct, so i need to fix this if i can find the topic, so if anyone bumps into it, please let me knwo so i can fix it and delete this topic.
Thank you.
From PWM to analog 5V is easy to do, just in case anyone ever needs it, not the other way around.

Please Log in or Create an account to join the conversation.

More
18 May 2024 20:37 #300936 by andypugh
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
18 May 2024 23:55 #300944 by tommylight
YES! :)
Twice i searched for it, and then every day trying to figure out where it might be after the two tries failed!
Thank you, edited and notified.
Leaving this till you get to read it, then deleting.
Again, thank you, i can sleep better now.
The following user(s) said Thank You: pmchetan

Please Log in or Create an account to join the conversation.

More
22 May 2024 15:56 #301154 by pmchetan

A few days back i posted a reply regarding analog and PWM where i think i stated that alanog outputs can be set to output +5V only, that is corrct, but then i went on to state that it will work for PWM inputs <this is not correct, so i need to fix this if i can find the topic, so if anyone bumps into it, please let me knwo so i can fix it and delete this topic.
Thank you.
From PWM to analog 5V is easy to do, just in case anyone ever needs it, not the other way around.

How can I get a varying analog voltage from 5v pwm? I see a lot of RC low pass filter as digital to analog converter online. I have a drive which takes analog PWM input to control the speed of a bldc motor. Help me out with either a link to build a robust DAC for the purpose or readily available solution to buy would be good too.

Please Log in or Create an account to join the conversation.

More
22 May 2024 17:33 #301156 by besriworld
forum.linuxcnc.org/24-hal-components/329...i76e?start=40#295082

You can look here. My psb also works but requires 5v source without ripples.

Please Log in or Create an account to join the conversation.

More
22 May 2024 19:51 #301162 by tommylight
Analog and PWM are not the same thing, so your drive has either one or the other.
PWM to analog works with just a resistor and capacitor, wont be the best but it works.
A 100 Ohm reistor in series from PWM out to analog in, and a 0.1 to 1 microFarad capacitor parallel with analog input should be a nice starting point, bigger capacity = slower raise/fall time, and vice-versa.

Please Log in or Create an account to join the conversation.

More
23 May 2024 07:34 - 23 May 2024 07:35 #301186 by pmchetan
Ok, the drive has PWM input mode. The seller has sent me a arduino code asking me to make the following circuit and says it can control the motor speed and direction with PWM signals (0-5V square wave)

 

(In the arduino code, I saw analog write function used to write to the pin and got confused with the whole analog pwm thing)

I don't have arduino, I will get it in a couple of days but I have 7i76 setup and it is sending 60hz to 1khz pwm signals as I change the velocity during test/tune axis in PNCconf. The voltage is 4.74V but the output from the transistor is about 0.3V which I think is comming from the drive power supply (turning the power to drive off leaves it at 0V.

If someone understands this circuit do explain what is the transistor even doing? Because if I'm understanding it, the PWM from 7i76 to base of the transistor shorts the collector (drive ground) to drive SV which should do nothing right?
 
Attachments:
Last edit: 23 May 2024 07:35 by pmchetan.

Please Log in or Create an account to join the conversation.

More
23 May 2024 13:02 #301200 by Aciera
I'd say what you need is a lowpass filter.
Maybe this helps:
www.allaboutcircuits.com/technical-artic...o-an-analog-voltage/

Please Log in or Create an account to join the conversation.

More
23 May 2024 15:25 #301215 by tommylight
PWM, the transistor is there to just invert the signal from active high to active low.
If that info is correct, you can controll it using parallel port as it can easily do PWM.
BTW, PWM does not chage frequency, just the pulse width/duration.
The frequency can be set once and it does not change.
Any idea what that frequency should be?
Not very important as most will work with quite a wide range of frequencies, so you can easily test.
And i am pretty sure there is no need for filters for this.

Please Log in or Create an account to join the conversation.

More
24 May 2024 07:05 #301290 by pmchetan
I thought the transistor is there for switching which connects the collector and emitter at the pwm frequency at the base of the transistor. But I think I'm wrong because with PWM mode selected on the drive, it should drive the motor if I supply 5v volts to sv pin (its the same as 100% duty cycle) but it doesn't.
How is the transistor inverting the signal from active high to active low in this circuit?

Please Log in or Create an account to join the conversation.

Time to create page: 0.090 seconds
Powered by Kunena Forum