toothache

Steering gear tester

 
Overview

      Hello everyone, what I brought this time is a servo tester, which costs less than 10 yuan and includes schematic diagram, PCB and program.

  1.  The servos are models such as SG90 and MG90. The servos can rotate as the knob is turned, and there is a digital tube that can display the real-time power supply voltage value.
  2.  When using it, I found that there is a problem with the button triggering. When switching modes, the switching may not be successful. This should be the reason for debounce. I will continue to improve the code.
  3.  Its function includes two modes: one is manual mode, and the other is neutral mode. There are two indicator lights that will prompt you. Manual mode is the default. As long as you turn the potentiometer, the servo will rotate accordingly. Neutral mode requires Press the button in the lower right corner. At this time, the servo will automatically return to the middle position and the potentiometer will no longer work. But the voltage value will be displayed no matter which mode.
  4. The chip I used is STM32F030K6T6. Because it is the first time to use the F0 chip, I encountered some problems. Let me explain these problems:
  • It was my first time to use F0, so I downloaded the F0 support package, but the downloaded package was new. The old version of 5.14 keil I used before could not adapt, so I had to install the new 5.29 keil.
  • keil Since version 5.25, the new version of the burner firmware in the computer will be used by default, so the J-LINK I bought before does not match the 6.46 version of the J-LINK firmware that somehow came from the computer. I have to buy a new one. J-LINK, either install the firmware back to the old version, otherwise problems will occur in the simulation, and the simulation will automatically exit after a few steps. So back to the old version.
  • Regarding the clock issue, since there is no external crystal oscillator connected and the chip uses its own clock source, the internal program needs to be changed. Please see this link    https://www.cnblogs.com/beiyhs/p/11211691.html   , there is a detailed explanation, because when using the internal clock source, the highest frequency is 48M, and the external clock source reaches the highest 72M. If the program is not changed, the timing will be inaccurate. For example, if the written light lights up for 1s, it is found during the test that the light will not It lights up for more than 6 seconds, which is already the case for lights, let alone high-precision clocks such as timers. In this program, the main things written about time are the frequency of pwm and the sampling frequency of ADC. PWM changes the prescaler value, and ADC changes the frequency divider value of the sampling frequency. You can look at the code for details.
  • ADC problem, because two channels of AD conversion are used, one measures the power supply voltage, and the other measures the voltage returned by the potentiometer. When using it, the channels need to be continuously changed, but only changing the function of the control channel will cause the AD value to be confused. Please write it correctly. See  https://blog.csdn.net/mrlixirong/article/details/78930275

These are the main problems encountered, now look at the demonstration video

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-22 07:14:36

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号