0
\$\begingroup\$

this is my first post and I'm just asking a little bit about motor control in a team project, where I'm member of.

This is a bit of a "not so serious" project so probably the solar panel system consumes much more energy than it generates but anyways... Our parts budget for the project was not very extensive and we just had whatever was available at the school for parts.

So, we are using 1x DC motor to control the rotation of a solar panel tracker system. It was given to us by our teacher so we don't know much about it. We did test that it works at full speed in both directions, but as the supply voltage became too low, it didn't work so good. (less than 3v wasnt very good)

The system works like this basically

  • there is a solar panel plate on which the actual solar panel attaches on a hinge, and the other end of the solar panel has a hinge and a part into which the "top-end" of screw attaches, and solar panel is able to tilt, by using a screw, which is turned by the stepper ("bottom-end" of screw is attached at the stepper"). The stepper is mounted on a hinge at the solar panel plate
  • also that solar panel plate has wheels at the bottom,
  • then there is a second "baseplate" and the solar panel plate rests on that baseplate.
  • baseplate has the dc motor which turns the solar panel plate, the rotation part

Then we have that L298n chip.

The tilting axis is controlled with a separate stepper motor

I think we are connecting 12v into the power of the DC motor, but this results in too fast of a speed for the motor.

I think that after consulting an arduino tutorial (and the chip L298 datasheet), it was recommended to use PWM into the enableB pin, to control speed.

We are using SCtimer functionality from the lpcxpresso to pulse the PWM

questions

  1. it appears that on this website, it was recommended to PWM into the in3 and in4 pins L298n PWM frequency . Is it better solution to PWM into the in3 and in4 pins, as opposed to the enableB pin? We require good speed control in our project, and the motor speed should be able to be fairly slow, and we would want to have the ability to rapidly stop also... Overall, I would say that we require of the motor: slow speed, ability to stop quickly, ability for direction changes.

  2. I would say that of course one channel PWM into the enableB pin is the simplest PWM in the software to configure. But, I suppose that we could also make a two channel PWM, while leaving the enableB pin = TRUE. Then, we could control the directions, by changing the dutycycles of in3, and in4, by switching around the dutycycles like (0%,25%) and vice-versa. I suppose we could also have the stop motor at (0%,0%)

    1. Is there any way to know a good PWM frequency for a DC motor, if you don't know much about that motor directly in terms of specs and datasheet, and make&model? I think that we succeeded in some early tests with 1khz PWM freq, but some of our classmates had used that same DC motor with about 400hz PWM freq?
\$\endgroup\$
0
\$\begingroup\$

As the braking force is a function of the turning speed, you'll probably seen not too much of a difference between braking and simply turning of when the motor only runs at slow speeds. But that will definitely the fun part figuring out what works best, you might even try a short reverse impulse, depending of the driven mass.

You probably want the PWM frequency to be outside of the audible band, but not too high to struggle with the raise time of your driver. Around 30khz is not uncommon. Beside the noise it can produce the low pass characteristic of your complete system defines the lowest frequency you are able to use. With a complete solar panel attached to a motor plus gearbox you won't have any problems with something like 100hz, beside the terrifying sound of it.

\$\endgroup\$
  • \$\begingroup\$ do you have any opinion on the enableB pin, vs controlling both input3 and input4 pins with the PWM? I don't understand what's the difference between so-called "free-wheeling" that happens with DC motor when enableB pin is being used with the pwm, vs the other scenario (not-free-wheeling) \$\endgroup\$ – Late347 Dec 22 '18 at 7:31
  • \$\begingroup\$ That's what I implied by the braking. The difference between free wheeling and braking becomes more noticable at higher turning speeds. Free wheeling is equivalent to not connected at all vs braking is shorted. There are probably better ways to explain it. \$\endgroup\$ – wiebel Dec 22 '18 at 7:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.