How to Radio control a gear motor with encoder

Hello,

I need this kind of gear motor (Roboblock 12V, 30:1 Gear Motor w / Encoder Product code : RB-Rbk-22)
on my RC ship model to roll/unroll the gennaker (one of the spherical sail).

But I would like to know what kind of other materials (except RX and Tx ) I need to control this motor knowing that I need to have roughly 25 turns max in a way and the other to roll the sail? What kind of simple programs could I use?

Hope it is clear enough, as my english is still improving!
Thanks a lot
Timcent

Hello Casmat,

1/could you please give me a reference of a microcontroller to be activated with R/C input and all the materials needed for programming? AS I’ve no backgrounf in electronics and programming, I need something that could be easily implemented!

Here are some more informations
-2 gear motors are needed: one for the foc the other for the gennaker
-25turns are needed to roll the gennaker, and 15 for the foc
-Max torque 3N.cm
-current used 7.2V
-2 actions at different time: 1/ roll the gennaker and unroll the foc; 2/the contrary: unroll the gennaker and roll the foc. Between those actions the gear motors are stopped.

Thanks.
Timcent

Hi every body,

any ideas or news!?
I really would like to learn something and the way to do it, ie, spend some money!!!
tks
T

Hi all,

just let me know which microcontroller and what other materials for programming I need, then I will be able to order!

Thanks
T

Hi timcent,

As Carlos indicated, if you want to count exactly 25 revolutions, you need “something” that can count - in this case a microcontroller. Counting can be done one of many ways, though an encoder may be the easiest to implement. As the encoder turns, it sends digital pulses to your microcontroller which keeps count. Since teh direction of the motor is known (you are controlling it), you can use the two to get the number of turns. The microcontroller would be connected to a motor controller (since on its own it cannot provide enough current to the motor). To start the process of unrolling the sails, the microcontroller needs to receive a signal - in this case all you have is a receiver which sends out servo pulses. A servo pulse is a timed pulse between 500us and 2500us (1500us being neutral) at 5V. Since most microcontrollers have built-in timers, you can connect the receiver to one of the microcontroller’s digital pins, as well as the ground pin. You would need to write code (looped) which measures the time between the pulses and if they are greater than a certain time, move the motor in one direction until the sail is unrolled (counting the number of digital pulses from the encoder), then wait for another signal. If the time between pulses is less than a certain value, roll the sail (counting the number of pulses from the encoder). As you can see, the setup is a bit complex and requires programming. We’re certain there is more than one way to do what you want, and encourage you to see what other people have done with their R/C boats. Some pseudo code:

loop
{
time the pulse output from the receiver
if time > value1
read encoder pulse and do the following until the pulses reach a certain value
activate motor clockwise
reset the encouder counter

if time < value2
read encoder pulse and do the following until the pulses reach a certain value
activate motor counterclockwise
reset the encoder counter
}

Hope this helps,

Hi,

There are many possible combinations of products which would work. For example, consider the DFRobot Wheel Encoders (you only really need one but they are sold in pairs). This would mount to the DFRobot 6V,180rpm Micro DC Geared Motor with Back Shaft which you could then install in your boat. To control this, you can use the DFRobot ROMEO, which has a dual motor controller and easy to access IO pins. You would also use the ROMEO to read and time the signal received from the R/C receiver. You would need to program it to know exactly what to do once it received a signal (unfurl at a certain speed; unfurl completely etc.). Again, this is only one possible combination of products and we hope it gives you an idea of what you might use.

Sincerely,

Hello timcent and welcome to the RobotShop Forum.

In order to control the winding of the sail as you describe, you will need to count how many turns the sail did. In order to do this, the best option is to use a small microcontroller connected to a DC motor controller.

Basically the controller will take the R/C input signal and trigger the winding of the sale by activating the motor until a specific number of turns has been reached. This will of course require a bit of programming.