background image

                                                                                                                                     

 

 

 

 

32 

 

Figure 4-1-1 Schematic diagram of the steering gear 

4.1.2 Working principle 

The control signal enters the signal modulation chip by the receiver channel, gets the DC bias voltage. 

The steering gear has a reference circuit which generates a reference signal with a period of 20ms and a 

width of 1.5ms. Comparing the obtained DC bias voltage with the voltage of the potentiometer and 

obtaining the output voltage difference. Finally, the positive and negative output voltage difference in the 

motor driver chip decide the positive and negative rotation of motor. When the speed of motor is certain, the 

cascade reducer gear will drive potentiometer to rotate so that the voltage difference is reducing to 0, the 

motor will stop rotating. 

When the control circuit receives the control signal, the motor will rotate and drive a series of gear sets, 

the signal will move to the output steering wheel when the motor decelerates. The the output shaft of 

steering gear is connected with the position feedback potentiometer, the potentiometer will output a voltage 

signal to the control circuit board to feedback when the steering gear rotates, then the control circuit board 

decides the rotation direction and speed of the motor according to the position, so as to achieve the goal. The 

working process is as follows: control signal

control circuit board

motor rotation

gear sets deceleration

steering wheel rotation

position feedback potentiometer

control circuit board feedback. 

The control signal is 20MS pulse width modulation (PWM), in which the pulse width varies linearly from 

0.5-2.5MS, the corresponding steering wheel position varies from 0-180 degrees, which means the output 

shaft will maintain certain corresponding degrees if providing the steering gear with certain pulse width. No 

matter how the external torque changes, it only changes position until a signal with different is provided as 

shown in Fig.3.2.4.4. The steering gear has an internal reference circuit which can produce reference signal 

with 20MS period and 1.5MS width, there is a comparator which can detect the magnitude and direction of 

the external signal and the reference signal, thereby produce the motor rotation signal. 

Содержание ATMEGA328P-PU

Страница 1: ...1 Panther Tank 4 0 Instruction Manual V 1 1 Get last update from https github com keywish keywish panther tank ...

Страница 2: ...2 Revised Version Of History Date Version Description Author 2019 8 14 V 1 0 Create Carl Du 2019 8 27 V1 1 Update the picture Abbott Chen ...

Страница 3: ...metal backplane copper column and battery installation 17 3 1 2 load bearing wheels pedrail and motor installation 19 3 1 3 Servo and UNO board installation 24 3 1 4 Upper acrylic floor mounting 29 Chapter 4 Experiment 31 4 1 Servo 31 4 1 1 Servo Introduction 31 4 1 2 Working principle 32 4 1 3 steering test test 33 4 2 RGB WS2812B Experiment 34 4 2 1 RGB WS2812B Description 34 4 2 2 RGB WS281B wo...

Страница 4: ...erimental procedure 52 4 7 PS2 Wireless Control optional 52 4 7 1 Introduction to the kit 52 4 7 2 Experimental steps 54 4 7 3 Software Design 55 4 8 CC2540 Bluetooth Module Test Experiment 57 4 8 1 Introduction to Bluetooth Module 57 4 8 2 TI CC2540 Bluetooth Module Parameters 57 4 8 3 Bluetooth module test experiment steps 58 4 9 ESP M2 Wifi Module Test Experiment Optional 62 4 9 1 Introduction ...

Страница 5: ...s strictly tested to ensure the accuracy and precision Moreover you can easily find the library files in the corresponding file folder and download through the UART simulator to the BLE uno board for the corresponding functions You can debug each module according to the course or directly assemble the car to enjoy the fun of a maker 1 2 Product Introduction Tank is ATMEGA328P PU as the main contro...

Страница 6: ...alog inputs and a 16 MHz ceramic resonator 1 USB connection 1 power socket 1 ICSP head and 1 reset button It contains everything that supports the microcontroller You just need to connect it to a computer via a USB cable or start with an AC DC adapter or battery Figure 2 1 1 Arduino BLE UNO R3 Board Technical specifications Working voltage 5V BLE chip TI CC2540 BLE work channel 2 4G Bluetooth tran...

Страница 7: ...protocol and power supply without external power supply Support ISP download function Digital I O port 14 4 PWM output ports Analog input port 6 DC Current I O Port 40mA DC Current 3 3V Port 50mA Flash memory 32 KB ATmega328 0 5 KB for bootloader SRAM 2 KB ATmega328 EEPROM 1 KB ATmega328 Size 75x55x15mm 2 1 2 MotorDriverBoard Expansion board interface diagram Figure 2 1 2 Expansion Board Interface...

Страница 8: ...OldSoftwareReleases previous After opening the link we can see the interface as shown in Figure 2 2 1 In this interface we can see the different versions of the IDE and different operating environments Everyone can download according to their own computer system of course There will be a downloaded installation package on our companion CD but only the Windows version because this tutorial is all r...

Страница 9: ... exe again to enter the IDE programming interface Figure 2 2 2 Arduino IDE Installation Package Figure 2 2 3 Extracted files When finish the installation of the IDE connect to the Arduino motherboard click My Computer Properties Device Manager Viewing Ports COM and LTP If you can see as the Figure 2 2 4 Figure 2 2 4 Driver installation success interface ...

Страница 10: ...he computer does not respond Right click My Computer and select Open Device Manager then find viewing port com lpt If there is no com or lpt or only an unknown device there is a problem with the controller board or the USB cable 2 Right click My Computer and select Device Manager find the viewing ports COM and LPT If there is a yellow Arduino UNO exclamation point this means you need to install th...

Страница 11: ...orts COM and LPT At this point you will see a USB Serial Port right click USB Serial Port and select the Update Driver Software option Figure 2 2 6 Updated Driver Interface 2 Next select the Browse my computer for driver software option Figure 2 2 7 Driver Update Selection Screen ...

Страница 12: ...NO _Driver ccxxxx_usb_cdc inf click next as shown in figure 2 2 8 Figure 2 2 8 Driver file selection interface 4 If you have already installed the following figure will automatically inform you that the driver was successful ...

Страница 13: ...his time we return to the Device Manager interface the computer has successfully identified Arduino as shown in the below Figure 2 2 10 then open the Arduino compilation environment you can open the Arduino trip Figure 2 2 10 Driver Success Recognition Interface ...

Страница 14: ...ick the OK button 4 The system will reboot to the Select an option screen 5 Select Troubleshooting from the Select an option screen 6 Select Advanced Options from the Troubleshoot screen 7 Select Windows startup settings screen from Advanced Options 8 Click the Restart button 9 10 Select Disable Driver Signature Enforcement 11 Once the system is booted you can install Arduino driver the same as Wi...

Страница 15: ...nners The Preference option It s mainly about the parameter settings such as language fonts and so on Figure 2 2 13 File Menu Bar Options 3 Click Tools the interface shown in Figure 2 2 14 will pop up Here we can see two options Board and Port In the board option we can see the commonly used Arduino development board model we only need to choose according to their own development board In the Port...

Страница 16: ...ompleted all the work The next step is actual experiments Open any program in Examples First compile the program If it is compiled correctly it can be directly downloaded to the development board and the corresponding device of the connection number With wires you can see the corresponding phenomenon ...

Страница 17: ...reful when installing to prevent some devices from being lost 3 1 1 Lower metal backplane copper column and battery installation Step 1 The installation of the copper plate under the metal bottom plate Figure 3 1 1 Schematic diagram of copper column installation on lower metal bottom plate Figure 3 1 2 Under metal floor copper column installation effect diagram ...

Страница 18: ...ation effect diagram Step 3 Welding DC head Connect the power cable Firstly find the matching two power cables the same as the wires used by the motor one red and one black and connect the two cables to the DC power head The DC power connector is shown in Figure3 1 5The rubber ring marked as 1 can be removed to open the shell and then welding the wires to the 12V and GND as shown in Fig 3 1 6 Figu...

Страница 19: ... Figure 3 1 6 Schematic diagram of wire welding 3 1 2 load bearing wheels pedrail and motor installation Step 1 Installation of load bearing wheels Figure 3 1 7 load bearing wheels installation checklist ...

Страница 20: ...bearing wheels installation Note The load bearing wheels must be reserved for 1mm from the inner nut Figure 3 1 9 Effect diagram of load bearing wheels installation Step 2 Install the motor Figure 3 1 10 Schematic diagram of motor installation ...

Страница 21: ...nstallation Firstly insert the motor into the circular hole of the coupling make sure that the hole of the coupling just reaches the flat position of the motor shaft and screw the black top wire into the hole of the coupling as shown in Figure 3 1 13 Note Do not move the coupling when twisting the black set screw Figure 3 1 13 ...

Страница 22: ...4 Effect diagram of coupling installation Step 4 Install the drive wheel Figure 3 1 15 Schematic diagram of drive wheel installation Figure 3 1 16 Effect diagram of drive wheel installation Step 5 Install the pedrail ...

Страница 23: ...ematic diagram of the pedrail disassembly Note Disassemble the proper size of the pedrai for installation Figure 3 1 18 Schematic diagram of the pedrail installation Figure 3 1 19 Effect diagram of the pedrail installation ...

Страница 24: ...24 3 1 3 Servo and UNO board installation Step1 Install UNO board Figure 3 1 20 Schematic diagram of UNO board installation Figure 3 1 21 Effect diagram of UNO board installation ...

Страница 25: ...25 Step 2 Install servo Figure 3 1 22 Schematic diagram of servo installation Figure 3 1 23 Effect diagram of servo installation ...

Страница 26: ...und brown then connect the servo signal cable orange to the I2C servo 1 and install the steering pad without first fixing the screws See Figure 3 1 24 Show Figure 3 1 24 Figure 3 1 24 Steering gear connection diagram After burning the program to the UNO board do not unplug the USB cable and plug the battery into the UNO board to power it Then open the serial monitor of the Arduino IED as shown in ...

Страница 27: ...her the serial data inByte Serial read Read data the serial port can only read 1 character temp inByte The characters read into temporary variables inside the cache Continue to determine the serial port there is no data know all the data read out Determine whether the temporary variable is empty if temp angle temp toInt Convert variable string type to integer Serial print Servo degree Serial print...

Страница 28: ...c diagram of ultrasonic bracket installation Figure 3 1 29 First fix the rudder paddle and the ultrasonic bracket as shown in Figure 3 1 30 Figure 3 1 30 Effect diagram of ultrasonic bracket installation Step 4 Ultrasonic module and uno expansion board installation ...

Страница 29: ...asonic module and uno expansion board installation Figure 3 1 32 Effect diagram of ultrasonic module and uno expansion board installation 3 1 4 Upper acrylic floor mounting Figure 3 1 33 Schematic diagram of upper acrylic baseboard installation ...

Страница 30: ...s been completed We believe you have some basic knowledge of your car s structure function and some modules through a short period of time then you can achieve the corresponding functions only by downloading the program to the development board each function has a corresponding program in CD so please enjoy playing However if you can read the program and write your own program there will be more f...

Страница 31: ...us joint movements of the robot The steering gear is the control of the steering of the trolley The mechanism has the characteristics of small size large torque simple external mechanical design and high stability Whether in hardware design or software design the steering gear design is an important part of the car control Generally speaking the steering gear is mainly composed of the following Th...

Страница 32: ...dback potentiometer the potentiometer will output a voltage signal to the control circuit board to feedback when the steering gear rotates then the control circuit board decides the rotation direction and speed of the motor according to the position so as to achieve the goal The working process is as follows control signal control circuit board motor rotation gear sets deceleration steering wheel ...

Страница 33: ...f the servo and the servo can be controlled by I2C communication The position of the servo test program is courseware code module test program rudder test program Servo_Test Servo_Test ino I O digital input Pins 5 and 6 are also integrated into the library and the servo pin pins are defined as shown in Figure 4 1 6 Emakefun_Servo mServo1 mMotorDriver getServo 1 Initialize the IIC servo 1 4 is the ...

Страница 34: ...d power down reset circuit Cascading port transmission signal by single line Any two point the distance less than 5 Meters transmission signal without any increase circuit When the refresh rate is 30fps the cascade number is at least 1024 pixels Send data at speed of 800Kbps For more parameters of WS2812 please check the file in CD Document WS281B pdf 4 2 2 RGB WS281B working principle IC uses sin...

Страница 35: ... Data signal input 4 VSS Ground WS281B Pin function Picture 4 2 1 WS281B Pin configuration 4 2 3 WS281B drive principle WS281B The low level is represented by T0 consists of a 0 5µs high level and 2µs low level The high level is represented by T1 consists of a 2µs high level 0 5µs low level When low level last more than 50µs there will be a reset signal T0H 0 code high voltage time 0 5µs T1H 1 cod...

Страница 36: ...vice that uses DC voltage to power electronic products for sound devices Buzzers are mainly divided into active buzzer and passive buzzer The main difference between the two type device is as follow The ideal signal for active buzzer operation is direct current usually labeled at VDC VDD etc There is a simple oscillating circuit inside the buzzer As long as it is energized it can motivate the moly...

Страница 37: ...e is the current through the electromagnetic coil making the electromagnetic coil generated magnetic field to drive the vibration film audible Therefore a certain amount of current is required to drive it while the ARDUINOI O pin outputs a lower voltage Arduino output level can hardly drive the buzzer so it needs to add an amplifier circuit And transistor S8050 is used here as an amplification cir...

Страница 38: ...hich a note should be sung The beat means how long a note should be sung The commonly used method is look up table method this method is complex where you have to find the corresponding frequency of each note according to the note the frequency comparison and then according to the formula converted to the corresponding time take half cycle and then through the delay function implementation Finally...

Страница 39: ... Alto 1 523 25 955 56 1 5 554 37 901 93 2 587 33 851 31 2 5 622 25 803 53 3 659 26 758 43 4 698 46 715 86 4 5 739 99 675 69 5 783 99 637 76 5 5 830 61 601 97 6 880 00 568 18 6 5 932 33 536 29 7 987 77 506 19 Treble 1 1046 50 477 78 1 5 1108 73 450 97 2 1174 66 425 66 2 5 1244 51 401 77 3 1318 51 379 22 4 1396 91 357 93 4 5 1479 98 337 84 5 1567 98 318 88 5 5 1661 22 300 98 6 1760 00 284 09 6 5 186...

Страница 40: ...cause the microcontroller is set by the loop to the port connected to the buzzer reset to make the sound so it is a half cycle Because I use a passive buzzer the active buzzer is full cycle Then follow the above principle one by one and use the delay function to achieve because each note has a different conversion frequency or use multiple delay functions to achieve accurate pitch frequency one by...

Страница 41: ...ime you want to sing into the two arrays Then in the main programming through the delay function to reach the corresponding frequency sing it over stop for a while and then sing it all the conversion is complete we get the following frequency Table 3 and beat Do 262 Re 294 Mi 330 Fa 349 Sol 392 La 440 Si 494 Do_h 523 Si_h 988 Mi_h 659 La_h 880 Sol_h 784 Fa_h698 Re_h 587 Table 3 Happy Birthday Song...

Страница 42: ...h Si La Fa_h Fa_h Mi_h Do_h Re_h Do_h Beats time float durt 0 5 0 5 1 1 1 1 1 0 5 0 5 1 1 1 1 1 0 5 0 5 1 1 1 1 1 0 5 0 5 1 1 1 1 1 void setup pinMode BUZZER_PIN OUTPUT get scale length length sizeof scale sizeof scale 0 Serial begin 9600 void loop for int x 0 x length x tone BUZZER_PIN scale x rgbled_A3 setColor 1 scale x 425 scale x 500 scale x 95 rgbled_A3 setColor 2 scale x 425 scale x 500 sca...

Страница 43: ...ce addresses due to The IC is powered on to retain the LED All Call address E0h 1110 000 and Software Reset address 06h 0000 0110 There are only 62 available device addresses Therefore in theory one I2C interface can control the channel 16 62 992 PWM the pin control device address is shown in the figure below Figure 4 4 1 Schematic diagram of device address For detailed use of the chip please refe...

Страница 44: ...to the analog load in a repeating pulse sequence of ON or OFF When the DC power is applied to the load the power is disconnected when the power is turned off Any analog value can be encoded using PWM as long as the bandwidth is sufficient The output voltage value is calculated by the on and off times Output voltage on time pulse time maximum voltage value Figure 4 4 2 is the voltage corresponding ...

Страница 45: ... can easily control the car The test procedure is as follows include Arduino h include Wire h include Emakefun_MotorDriver h Emakefun_MotorDriver mMotorDriver Emakefun_MotorDriver Emakefun_DCMotor DCMotor_1 mMotorDriver getMotor 1 Emakefun_DCMotor DCMotor_2 mMotorDriver getMotor 2 void setup Serial begin 9600 mMotorDriver begin 50 DCMotor_1 setSpeed 100 DCMotor_2 setSpeed 100 void loop DCMotor_1 r...

Страница 46: ...on board just need to plug the expansion board into the Arduino and in the program defined pins 8th number IO the IR receiver head has three pins including power supply feet grounding and signal output feet The circuit is shown in the picture 4 5 2 The ceramic capacitor 0 1uf is a decoupling capacitor which filters out the interference from the output signal The 1 terminal is the output of the dem...

Страница 47: ...ntrols the pulse amplitude at a certain level regardless of the distance between the IR transmitter and the receiver The AC signal enters the bandpass filter the bandpass filter can pass the load wave of 30KHZ to 60KHZ through the demodulation circuit and the integral circuit to enter the comparator the comparator outputs the high and low level restores the signal waveform of the transmitting end ...

Страница 48: ...Ir Code 0x45 and keyname 1 where 0x45 is the code of a button on the remote control and 1 is the name of the button function of the remote control The total encoding value of the supporting remote control is shown in Figure 4 5 4 include IRremote h IRremote ir 12 unsigned char keycode char str 128 void setup Serial begin 9600 ir begin void loop if keycode ir getCode String key_name ir getKeyMap ke...

Страница 49: ... corrects the ranging result and uses GPIO communication mode with a watchdog inside which is stable and reliable The module includes an ultrasonic transmitter a receiver and a control circuit Figure 4 6 1 is a relatively common ultrasonic sensor Figure 4 6 1 Ultrasonic module physical map 4 6 2 Module parameter Working voltage 4 5V 5 5V In particular it is absolutely not allowed to exceed 5 5V Po...

Страница 50: ...g sequence first the trigger signal starts the HC RS04 distance measurement module which means the MCU sends an at least 10us high level to trigger the HC RS04 the signal sent inside of the module is responded automatically by the module so we do not have to manage it the output signal is what we need to pay attention to The output high level of the signal is the transmitting and receiving time in...

Страница 51: ...sducer and shorten the free oscillation time The receiving circuit is composed of the ultrasonic sensor two stage amplifier circuit and a PLL circuit The reflected signal received by the ultrasonic sensor is very weak which can be and amplified by the two stage amplifier PLL circuit will send the interrupt request to the microcontroller when receiving the signal with required frequency The center ...

Страница 52: ...nal 4 7 1 Introduction to the kit The PS2 handle is the remote control handle of the Sony game console Sony s series of game consoles are very popular all over the world I don t know when someone got the idea of the PS2 controller and cracked the communication protocol so that the handle can be connected to other devices for remote control such as remote control of the familiar four wheelers and r...

Страница 53: ...will enter Standby mode if this station last for some time the light will go out At this time you need to press the START button to wake up handle The receiver is connected to the Arduino and powered by Arduino such as the picture 3 2 40 in an unpaired condition a green light will flash If the handle is open the receiver is powered the handle and receiver will automatically pair then the lamp is a...

Страница 54: ...andle this signal is relative to DI the signal is a 8bit serial data synchronously transmitted to the clock down the edge NC Empty port GND Ground VDD The 3 5V power supply CS SEL Providing trigger signals for handles the level is low during communication CLK The clock signal is sent by the host to maintain data synchronization NC Empty port ACK the response signal from the handle to the host This...

Страница 55: ...d vice versa the LED light flashes continuously Finally we open the serial monitor press any button on the remote control you can see the corresponding data on the serial monitor as shown in Figure 4 7 4 Figure 4 7 4 Serial Monitor data display 4 7 3 Software Design Ps2 Control program in Lesson Comprehensive Experiment PantherTank_PS2X PantherTank_PS2X ino In above programs we just finished the e...

Страница 56: ... arm is optional Joystick Left Control the left and right rotation of the base of the robot arm the arm is optional 0 89 degrees or 270 360 degrees to control the bottom steering right turn 90 269 degrees to control the bottom steering left turn Joystick Right control the left and right steering of the robot arm the arm is optional 44 135 degrees to control the right steering right turn 224 315 de...

Страница 57: ...ide Android and IOS mobile phone demo You can quickly develop a communication with mobile phone hardware equipment as now very popular wearable mobile phone peripheral equipment can use Ble Nano this development platform you can use a Ble UNO is connected with bluetooth 4 0 wireless transmission between two bluetooth devices master slave machine Settings Even with PC bluetooth HID connections AT t...

Страница 58: ...ly Vin6 12V 5V 4 8 3 Bluetooth module test experiment steps 1 Open the Arduino IDE connect the serial port as shown in Figure 4 8 1 open the serial port monitor as shown in Figure 3 2 8 2 figure 4 8 1 figure 4 8 2 2 The test AT instruction is shown in figure 4 8 3 Set the USB and bluetooth data transmission mode of BLE UNO to USB serial port data and BLE transmission as shown in figure 4 8 4 ...

Страница 59: ...hone and open the test app The interface is shown in Figure 4 8 5 Find the corresponding Bluetooth name Ble Nano and click to connect As shown in Figure 4 8 6 there will be 4 options for testing different functions because here we only test whether Bluetooth can ...

Страница 60: ...igure 4 8 6 Figure 4 8 7 Figure 4 8 8 4 We select SK KEYPRESSED click on it as shown in Figure 4 8 9 We can see that there is a write button click to enter the interface shown in Figure 4 8 10 in Figure 4 8 10 We click on the red box to enter the data you want to send After the input is completed click send to send the data as shown in Figure 4 8 10 ...

Страница 61: ...e Bluetooth module can send data normally Of course in order to test the accuracy you can Test a few more times and try to test in different environments Figure 4 8 11 6 As shown in Figure 3 2 8 12 we can input the content you want to send on the serial monitor After clicking Send you can send the data to the mobile APP via Bluetooth as shown in Figure 4 8 13 is shown Figure 4 8 12 ...

Страница 62: ...Bm adopts imported original chip design supports standard IEEE802 11 b g n protocol complete TCP IP protocol stack Users can use this module to add networking capabilities to existing devices or to build separate network controllers The module data can be found in the ESP M2 Wifi module ESP M2 product manual The physical picture of the Wifi module is shown in Figure 4 9 1 Figure 4 9 1 ESP M2 Wifi ...

Страница 63: ...ifi Module Wifi module test APP installation package installation package and open it Install the test software TCP Test apk in the directory to the mobile phone currently only supported in Android system On the phone 2 Open data ESP M2 Wifi Module WifiModule_Test WifiModule_Test ino 3 Burn the WifiModule_Test ino program to BLE UNO R3 align the serial port pins of the Wifi module with the mother ...

Страница 64: ...ction click on the connection as shown in Figure 4 9 4 enter 192 168 4 1 in the address bar and then enter 9000 in the port field Just connect the point We only test whether the Wifi module can send and receive data normally Click to enter the Figure 4 9 5 we click on the red box to enter the data you want to send click blue box after the input is complete the data will be sent out as shown in Fig...

Отзывы: