Tag: Also, the static keyword of the pulse span size is used to prepare for initialization.
Product Name: tower Pro (Huisheng) High Torque Steering Gear mg996r (mg995 upgrade product) 6 V/11 kg
Manufacturer no.: mg996r
Product net weight: 55 GB
Product size: 40.7*19.7*42.9mm
Product tensile force: 9.4 kg/cm (4.8 V), 11 kg/cm (6 V)
Response Speed: 0.17sec/60 degree (4.8 V) 0.14sec/60 degree (6 V)
Operating voltage: 4.8-7.2 v
Operating temperature: 0 ℃-55 ℃
Gear Form: Metal Gear
Dead Zone: 5us (microseconds)
Suitable models: 50-90 class methanol fixed wing and 26cc-50cc gasoline fixed wing aircraft
And then use another steering gear:
Hardware problems:
Question 1
The accuracy and response speed of the steering gear.
Use the buttons to adjust the steering gear,
674-median, left limit: 502-29 degrees left, (674-502)/30 = 5.73. Each degree is 5.73. 5.73/10000*20 = 0.01146 Ms = 11.46us. dead zone: 5us.
Right limit: (865-674 )*
However, when I press the button to adjust the value. Add 60 to the right of the rudder to increase the pulse width by MS for the first time. The left is good. Then hit 30 degrees on the right or hit 30 degrees on the left. When you return to the rudder, the response is very slow. You also need to add 50 to 60 to start the first time to return to the rudder. Then it is normal.
I'm going to change the steering gear. Let's try it.
Question 3:
After the camera adds a filter, the camera automatically enters the white balance adjustment. Remove the filter, adjust the white balance, and then put on the filter.
Software problems:
Question 1:
Problem: The Code of each module is normal and the value of the global variable is changed. It turns out that function Nesting is too deep, and stacks are pushed up.
Stm32 memory distribution-stack, heap, and static storage zone.
STACK:
Stack_size equ 0x00000400. s file kernel startup code. Specifies the stack size. The memory of local variables is distributed on the stack, and function calls are also performed on the stack. defining local variables avoids large arrays to prevent stack overflow.Stack size: 0x400 = 1024 bytes.
Heap_size equ 0x00000200 specifies the heap size. Use malloc or new to apply for heap memory. after use, free or delate the memory to be released. If not, memory leakage may occur,
Static storage area: static keyword, global variable,
Solution: We didn't use the heap memory malloc to apply for memory. Change the heap memory to 0, so the memory distribution is static storage zone + stack.
The. c file is first compiled into a. o file, and then linked to an executable file,
Question 2:
Data processing on the data size end.
The received data is in front of the high byte, and after the low byte, You have to process it,Question 3:
Determines the parameters of the steering gear PD algorithm,
Question 4:
The data collected by the camera is changed because the camera power supply and MCU power supply must be consistent. Therefore, software mean filtering is adopted. Various attempts .. However, the hardware power supply problem was discovered. It has been a long time. To solve the data jump problem. (I almost changed my camera ). Especially sad .. Potholes...
CheckSteps:
1. Check whether the camera data is output.
2. Check X, Y, and Encoder count again./***************** This is taken from the netizen blog ***************** *****/
Compile the project:After the project is successfully compiled in Keil, the following information is output in the bulid ouput window below:
Program size: code = 6320 ro-Data = 4864 RW-Data = 44 Zi-Data = 1636
Meaning:
Code: the size of the Code in the program.
Ro-data: the command and constant size defined in the Program (read only)
RW-data: variable size initialized in the Program (for personal understanding, ": read/write)
Zi-data: the size of uninitialized variables in the Program (personal understanding: Zero initialize)
Rom (flash) size = code + RO-Data + RW-data;
Ram size = RW-Data + Zi-Data
You can use. Map to view the flash and RAM used.
/***************** This is taken from the netizen blog ***************** *****/
Steering Gear & Data Processing & stm32 memory Stack Overflow (problems encountered)