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
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.
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%)
- 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?