PWM H-Bridge signal

More
27 Oct 2014 18:44 #52425 by sirbuctin
Hello ,

I have a question about the servo signals.
In the following example from etch servo :

net Xdir => parport.0.pin-06-out
net Xdir => parport.0.pin-07-out
setp parport.0.pin-07-out-invert TRUE
net Xpwm => parport.0.pin-05-out

As I understand :
the pin 7 (signal B) is always pin 6 inverted (signal A inverted), the pin 5 is the pwm (Enable signal).

In an H-Bridge there are the following condition :

When pwm is low : free running or motor stop (not takeing A or B in account).

When pwm is high : Signal A High , Signal B low is a forward condition.
Signal A Low , Signal B high is a reverse condition.
Signal A = Signal B (both high or both low) is a fast stop condition.

So because Signal B is always inverted signal A the third condition for a fast motor stop cannot be used.

This happens only in etch servo example ?
Is linuxcnc able to output separate A and B signals and it knows to make use of the fast stop function ?

Also with the current example configuration if a motor overshots , the software will command the motor to go back without a stop, so if the motor is high weight and still in inertia in the forward direction if we apply a reverse output we can damage the motor.

I am new to linuxcnc, searched a bit on this subject but didn't find out ,, so sorry if this have been discussed elseware .
Also excuse by bad English.

Have a nice day.

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

More
27 Oct 2014 20:31 #52430 by andypugh
Replied by andypugh on topic PWM H-Bridge signal
etch-servo is a "toy" configuration designed for specific drivers and motors to drive an etch-a-sketch.
emergent.unpythonic.net/projects/01142347802

The parallel port is a bit slow for generating the PWM for most servo motors. Typical frequency is a few kHz, (maybe 20kHz in PDM mode but I don't know if that counts)

In a servo system you don't normally use "fast stop", if you want to slow the motor rapidly you apply the reverse voltage. The PID control will do this automatically. I don't even know how you would distinguish between "stopping" and slowing and/or reversing.

Reverse input won't damage a servo motor, they are designed for 4-quadrant operation.

What are you trying to control? I don't know of any real servo systems using a bare parallel port (except experimentally, such as this example : )

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

More
27 Oct 2014 20:39 - 27 Oct 2014 20:53 #52431 by PCW
Replied by PCW on topic PWM H-Bridge signal
Having 2 direction lines is specific to the etch servo hardware (L298)
some PWM interfaces have just PWM and DIR or PWM-UP, PWM-DOWN or just PWM (50% = 0 drive)

Using the fast stop feature could easily be done with a L298 by adding "OR2"
and "NOT" components in the HAL file.

Note that fast stop can damage motors just like full reversal.
To prevent motor damage (if demagnetizing overcurrents are possible),
the H bridge must incorporate current limiting.
Last edit: 27 Oct 2014 20:53 by PCW.

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

More
28 Oct 2014 02:56 #52454 by sirbuctin
Replied by sirbuctin on topic PWM H-Bridge signal
Hello again,

Thanks for your answers,

Mr. andypugh I am trying to make exactly that kind of "toy" but on 3 axis (the Z would be a stepper).
The stepper part is easy, the servo is more difficult.
By servo I mean simple DC brushed motor with quadrature encoder attached that would be controlled by L298N.

I have read the emergent.unpythonic.net/projects/01142347802 and he is saying about the function what Mr.PCW suggested :
" (In fact, I did write a tiny amount of code, but only because I was unware of a HAL component called 'or2') " but the emc2 configuration link on
that site is broken so I cant see how he implemented it in hal file.

Mr. PCW can you please give me an example implementing "OR2"
and "NOT" components ? (only if you have time.. ofc)

Mr. andypugh how exactly the frequency limit of lpt limits the operation? I mean, a 50% duty cycle on L298 imput with say 12V motor voltage that would be translated into 6v on motor pins, if I need higher duty cycle that cant be achived due to limits can't be passed by increasing voltage motor ? lets say 24V at 25% duty cycle it would mean the same 6V on motor pins with lower signal period?

I have read that the lpt frequency is a limit for the encoder reading if they are high resolution.

Thanks

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

More
28 Oct 2014 03:09 #52455 by andypugh
Replied by andypugh on topic PWM H-Bridge signal

Mr. andypugh how exactly the frequency limit of lpt limits the operation?


Well, ideally you want the PWM frequency to be faster than the motor electrical and mechanical response time, so that the PWM becomes an average current rather than spikes of max current and zero current, and also at a rate that won't make the motor rotor vibrate.
There is also the point that you don't really want to hear the motor singing at PWM frequency.

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

More
30 Aug 2020 02:25 #180000 by Profed81
Replied by Profed81 on topic PWM H-Bridge signal
Were you able to combine servo motors and stepper motors in one hal file? I mean, could you run servo and stepper motors on the same machine?

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

More
30 Aug 2020 06:18 #180029 by tommylight
Replied by tommylight on topic PWM H-Bridge signal

Were you able to combine servo motors and stepper motors in one hal file? I mean, could you run servo and stepper motors on the same machine?

Yes, i am running analogue servos and a stepper on an industrial retrofit, here :
forum.linuxcnc.org/show-your-stuff/34986...nuxcnc-and-proma-thc
The following user(s) said Thank You: Aciera

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

Time to create page: 0.175 seconds
Powered by Kunena Forum