No,  That is not going to work.  PWM is where to send a square wave but
very the duty cycle of the wave is resolution of at least one part in 256
or better to one part in 1024.

If for some reason all you had was a serial port them you build a little
 device using say, maybe an Arduino-nano that reads numbers from a serial
line the output PWM to match the number it got.   The code for that would
be nearly trivial.  You could use the Arduino PWM example code with just a
few edits.

Does this make sense?  Only if you have to send PWM out a serial port, then
you'd need the nano or something like it.   I actually made a system like
this.  I used a bare 8-pin AVR micro controller with Arduino boot loader
installed.  I sends out PWM on one pin to control a DC fan.  The other pin
was directly connected to a temperature sensor.  The program in the AVR
keeps the temperer sensor at a constant temperature.     So "anything" to
PWM is do-abe with just a 50 cent chip.

The problem you will find however is the serial port under Linux has some
lag.  There is some software buffing and then the hardware has a FIFO
buffer   Your control loop will have delay, not good.

Better way is to send the "target speed" over serial port to the
processor.  And also route the encoder to the same processor.

Sometimes it is best to step back and see bigger picture.  I would not work
hard on  getting a serial port to do PWM.  Even if my some magic it works,
there is a better why at about the same cost.



On Fri, Feb 2, 2018 at 6:28 PM, jeremy youngs <jcyoung...@gmail.com> wrote:

> Can serport be used to supply +-10 v pwm for servo drive control? Is the
> voltage output controllable? Wiki says 232 voltage can be +-13 or +- 24 so
> I think voltage could be an issue.
> I got the serport docs here ,
> http://www.linuxcnc.org/docs/html/man/man9/serport.9.html
> Is there anything else I need to know? Thank you
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>



-- 

Chris Albertson
Redondo Beach, California
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to