Home > other >  Single chip microcomputer control motor, synchronous?
Single chip microcomputer control motor, synchronous?

Time:09-19

Recent want to be a self-balancing two-wheel vehicle
Hardware is ready, writing software is in trouble, hope to have a similar experience of predecessors can help me with,

1, motor encoder USES infrared tube, motor turning a circle 20 output pulse, slow than 50:1
Wheel rotation around a circle will produce 1000 pulses, because the encoder structure is simple, has led to the jitter of the input signal, the actual collection with external interrupt signal will be out of many, many more, then using logic analyzer caught waveform under just know, switch to scan timer count, basically solved the,
2, the motor start slow, stop delay: because motor full power can make the car was very reaction,
So want to wheel startup linear deceleration, smooth start-stop,
(the problem unresolved)
Around 3, synchronous operation of the motor, motor because it is a separate independent structure, program flow is: 1000 pulse motor commutator, didn't get the result within 5 seconds of two motor rotation is out of sync, with time, is this want two motor synchronous operation, output, at the same pace as the torque, in the shortest time synchronization,

Do not know to have had a similar experience of predecessors to give directions,

CodePudding user response:

Forget the 51 SCM experiment source code
Link: https://pan.baidu.com/s/1ZFyUlhCA5RKnPma3Mqollg extraction code: 4 h23

CodePudding user response:

Q2: accelerate the process between static to the output, if it is impulse control, the pulse frequency increased from 0 according to certain rate increase to the target frequency, if it is a PWM, pulse width 0 to a certain amount, the increase to the target pulse width
Q3: two motor synchronization must use PID

CodePudding user response:

The third question, I did not practice, just a piece of my mind,,
If without double synchronous PID, according to the balance of the car position information, you will pass a normal PID to calculate the speed of the two wheels should set,
Then if double speed out of sync, you can work out two motors on the motor encoder actual speed v1, v2, double synchronous PID speed value of (v1 + v2)/2, two motors were set and the actual speed difference to get the error, using PID, concludes that an optimized pulse value (assumption) by pulse control motor,
Then pose PID for pulse and double synchronous pulse value of the optimization of the PID is, was the actual motor pulse value,
Of course, this requires two separate motor control,
Also can consider to change a high precision of the motor, normally the same error between the two motors is not very big,

CodePudding user response:

Thank you, I go to see the pid algorithm
  • Related