Control Motor speed and timing

Thread Starter

Tobias

Joined May 19, 2008
158
Building a piece to control four motors. The four motors are in sets of two. Its going to work to build this controller to handle two sets of motors.

The motors are 1/4hp turning around 100 rpm on 24v. I am getting the required speed from a GPS controller. The GPS controller has a speed output for each individual motor. The sets of motors need to not only run at the same speed but also be timed with each other. Each motor has an eight tooth sprocket. So I am using a hall-effect style sensor to not only monitor the speed but also the timing of the motors relative to each other. For this deal, I need to see the sprocket evenly spaced between each motor. So I will see even time between sprocket teeth between the two mated motors.

I have checked the four motors and when all four are being powered at the same time with the same power source, the rpm isn't exactly the same. Exact being a couple revs off, over time this is critical.

The attached schematic takes in the four GPS signals into two Microchip 16F876A chips. I have to use two chips because I am using the Hardware PWM outputs to control the speed of the motors. Each chip has two HPWM’s. Anyway, I read in the required speed from the GPS signals labeled Pulse Ground on the schematic. The pic then outputs a PWM through a P type MOSFET outputting to the PWM1-4 channels on the schematic.

To monitor the timing of a set of motors I am using the Hall Effects to turn on and off a flip flip. One sprocket/hall effect turns on the flip flop and the other will turn off the flip flop. The output of the flip flop goes into the pic. I will count the time the input is high and low. If I see the time not 50/50 I will then adjust the HPWM for the required motor to get it back in time. This time measurement will also be used to calculate the true rpm of the motor and I will compare that with the Pulse Ground input (required rpm) and also adjust the HPWM accordingly.

Is this the right approach?


 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Building a piece to control four motors. The four motors are in sets of two. Its going to work to build this controller to handle two sets of motors.

The motors are 1/4hp turning around 100 rpm on 24v. I am getting the required speed from a GPS controller.
Explain more about this GPS controller.

The GPS controller has a speed output for each individual motor. The sets of motors need to not only run at the same speed but also be timed with each other.
Wait a minute - if the GPS has a speed output for each individual motor, then how can you control them individually? You need to re-state your requirements, as they are in conflict.

Each motor has an eight tooth sprocket. So I am using a Hall-effect style sensor to not only monitor the speed but also the timing of the motors relative to each other. For this deal, I need to see the sprocket evenly spaced between each motor. So I will see even time between sprocket teeth between the two mated motors.
Eight teeth mean sixteen possible transitions per revolution. If your motors were geared to the earth, synchronization wouldn't be a problem. However, you will have slippage errors. You'll somehow need to compensate for the slippage errors.

I have checked the four motors and when all four are being powered at the same time with the same power source, the rpm isn't exactly the same. Exact being a couple revs off, over time this is critical.
This isn't a big surprise.

The attached schematic takes in the four GPS signals into two Microchip 16F876A chips. I have to use two chips because I am using the Hardware PWM outputs to control the speed of the motors. Each chip has two HW PWM’s. Anyway, I read in the required speed from the GPS signals labeled Pulse Ground on the schematic. The pic then outputs a PWM through a P type MOSFET outputting to the PWM1-4 channels on the schematic.
I'm wondering why you're using PIC16F876A's, as the more modern and much less expensive PICs are the 16F886 variety? You don't even need the xtal oscillator, as they have internal clocks available.

To monitor the timing of a set of motors I am using the Hall Effects to turn on and off a flip flip. One sprocket/Hall effect turns on the flip flop and the other will turn off the flip flop.
Why not just use one per sprocket? If a tooth is near, it'll turn on; if not, it'll turn off.
The output of the flip flop goes into the pic. I will count the time the input is high and low. If I see the time not 50/50 I will then adjust the HPWM for the required motor to get it back in time. This time measurement will also be used to calculate the true rpm of the motor and I will compare that with the Pulse Ground input (required rpm) and also adjust the HPWM accordingly.
You can't go by the ratio of ON to OFF time, although that may figure in to the errors.

You really need to restate your problem more clearly, and eliminate the ambiguities.

You should also re-draw your schematic with inputs on the left, outputs towards the right, more positive voltages towards the top, more negative voltages towards the bottom - where applicable.

The PIC16F87x uC's will probably be discontinued in the not too distant future.
The PIC16F88x uC's are their more modern counterparts.

Don't base a new design on a part that's at the end-of-life cycle.
 
Top