Technology is at the forefront of the 4.0, IoT, and edge revolutions. Let's see how to create a controlled robotic arm.
introduce
Robotics, along with artificial intelligence and artificial intelligence, are at the forefront of Industry 4.0 and the edge revolution.
So I thought it would be fun to create a basic robot arm project that we can work our way back to and add a few features to, such as:
- Inverse Kinematics - Determine the position of the end effector.
- /ML – Object classification during operation.
- Control - Enable remote control at the edge.
This example will use a robotic arm that controls six servos on a Zynq SoC. You can use a simple software interface or use two for direct control.
Servo control
The first thing we need to do is figure out how to control the servo position. Servos are one of the simplest motors to drive and are ideal for robotics because they maintain relative position as long as we keep the drive the same.
So what is the driving signal for the servo? Most of the servos we use use a 60Hz PWM waveform. In the 16.66 ms period of the 60Hz waveform, the signal will be high between 0.5 ms and 2.5 ms. The duration of the signal will drive the servo between 0 and 180 degrees.
A 0.5 ms pulse drives the 0 degree position, while a 2.5 ms pulse will drive the 180 degree position. Therefore, 90 degrees can be maintained by driving the signal as a 1.5 ms pulse.
Therefore, increasing or decreasing the pulse width by 13.9 us will move the servo by 1 degree.
The next thing to solve is how to generate the drive signal. The PWM expansion board (above) uses four 8-bits to drive each PWM signal.
The on register defines the count of times the signal goes high, and the off register defines the count of times the signal goes low.
Therefore, we can set the on time to 0 and then define the count of the off signal to get the desired signal width.
Vivo Build
- Zynq PS - This is the Zynq Processing System
- AXI I - implemented in PL
Once the PL design is completed, we can build the design and export it to the software.
Software Design
We will be developing most of our application in software. Since we want to use it in multiple modes and make future upgrades to it, we need a modular approach.
Therefore, a function was developed for each joint that could be called and used as needed. Each joint is able to receive an unsigned 8-bit value and then add or subtract that 8-bit value from a 90 degree (1.5 ms) pulse width to obtain the desired angle.
I do this for several reasons:
- A single byte can contain the desired position.
- The value read from the joystick is also 8 bits.
Therefore, we need to ensure that the movement between the joystick and the arm is aligned.
Of the two joysticks, the first one is connected to JA and the second one is connected to JB (JA and JB are PMOD interfaces, which are ordinary GPIO).
JA When moved in the X direction, it moves the arm forward or backward; when moved in the Y direction, it moves the arm up or down.
JB rotates the wrist when it moves in the X direction, and moves the wrist up and down when it moves in the Y direction.
The code for each move function is very similar and can be found in the code provided later, however, the up and down functions are provided below for reference.
void up_dwn(u8 YData){
SendBuffer[0] = 0x0A;
SendBuffer[1] = 0x00;
XIic_Send(iic.BaseAddress,IIC_SLAVE_ADDR,(u8 *)&SendBuffer, sizeof(SendBuffer),XIIC_STOP);
SendBuffer[0] = 0x0B;
SendBuffer[1] = 0x00;
XIic_Send(iic.BaseAddress,IIC_SLAVE_ADDR,(u8 *)&SendBuffer, sizeof(SendBuffer),XIIC_STOP);
SendBuffer[0] = 0x0C;
u16 signal;
if( YData < 128 ){
signal = 122 + (YData * 1.91);
}
else if (YData == 128){
signal = 369;
}
else{
signal = 369 + ((YData - 128) * 1.91);
}
u8 cent_l_off, cent_h_off;
cent_l_off = (u8)signal;
cent_h_off = (u8) (signal >>8);
SendBuffer[1] = cent_l_off;
XIic_Send(iic.BaseAddress,IIC_SLAVE_ADDR,(u8 *)&SendBuffer, sizeof(SendBuffer),XIIC_STOP);
SendBuffer[0] = 0x0D;
SendBuffer[1] = cent_h_off;
XIic_Send(iic.BaseAddress,IIC_SLAVE_ADDR,(u8 *)&SendBuffer, sizeof(SendBuffer),XIIC_STOP);
}
The rest of the software application structure is:
- Initialize the PWM expansion board and Pmod joystick.
- Perform a self-test on the arm and position all servos at 90 degrees.
- Receives commands via 232 or from a joystick.
Of course, if we want to hard code in commands to perform repetitive tasks, we can.
Preliminary testing
Once Vivado is built and the initial software is available, the next step is to ensure the software can move the servos correctly.
When the joystick is moved, the PWM signal can be measured.
As the joystick is moved, the pulse width gradually changes from 0.5 ms to 2.5 ms.
Previous article:Components of an industrial robot
Next article:iTR Robot iScrubbot series cleaning robots realize digital management
- Popular Resources
- Popular amplifiers
- Using IMU to enhance robot positioning: a fundamental technology for accurate navigation
- Researchers develop self-learning robot that can clean washbasins like humans
- Universal Robots launches UR AI Accelerator to inject new AI power into collaborative robots
- The first batch of national standards for embodied intelligence of humanoid robots were released: divided into 4 levels according to limb movement, upper limb operation, etc.
- New chapter in payload: Universal Robots’ new generation UR20 and UR30 have upgraded performance
- Humanoid robots drive the demand for frameless torque motors, and manufacturers are actively deploying
- MiR Launches New Fleet Management Software MiR Fleet Enterprise, Setting New Standards in Scalability and Cybersecurity for Autonomous Mobile Robots
- Nidec Drive Technology produces harmonic reducers for the first time in China, growing together with the Chinese robotics industry
- DC motor driver chip, low voltage, high current, single full-bridge driver - Ruimeng MS31211
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- PWM output of MSP430 library timer TA
-
[NXP Rapid IoT Review] +
NXP Rapid IoT, a simplest cloud server prototype - Welcome to chat with me, guys~
- EEWORLD University ---- Computer Control Technology
- You are invited to watch Tektronix Live Lecture Series - Power Supply!
- Please advise, why do you need to remove the motherboard before burning the flash?
- Antenna packaging issues
- DA output waveform test
- Common Problems in Using MSP430 Emulator
- TI High-Speed Signal Conditioning Product Selection Guide