How can I use PWM (Pulse-width modulation) to control a robotic arm? What concepts should I teach myself to figure this out
Update:The robotic arm has already been created by the team for my professor. My job is to teach myself how to use PWM to control the arm to be a part of this team. He left me with a very vague task
Copyright © 2024 QUIZLS.COM - All rights reserved.
Answers & Comments
Verified answer
You'll want to decide what kind of servo or motor to use in the robotic arm first. The datasheets for that device will tell you what kind of inputs it requires to perform according to its design specifications. Then find a microcontroller with a PWM module built-in. If the servo requires more than 5V at roughly 10mA (I'm sure it will), you'll also need to design some level-shifting and current increasing scheme in to the electronics between the MCU and the servo, probably using operational amplifiers or driver chips. Most of Microchip Technology's MCU's have a PWM module built in. I recommend starting with an eight-bit microcontroller in Microchip's PIC18F family if you're new to this. It won't matter which MCU you use as long as it has a PWM module on it and any other modules on it that you'll need for your robot. You'll at least want an ADC (analog to digital) module on the MCU. During the debug process, it'll be nice to be able to use a variable resistor to control the voltage input to the ADC module, as a means to vary the PWM (duty cycle) level in to the servo that moves the robot arm. By using the ADC module in conjunction with the PWM module (all on board the MCU and all accessible through the code you write), you'll be able to turn a knob to change the duty cycle of the PWM to adjust the speed of movement of the arm in one direction. You can use the PWM output in to an LED to learn how to use the PWM module. The MCU will drive the LED directly. Get to where you can use the variable resistor input in to the ADC module, to change the duty cycle of the PWM that goes in to the LED. You can't dim an LED by lowering it's voltage input. But you can dim an LED by changing the duty cycle while maintaining a constant voltage value in to it. You'll need to learn and use either assembly language or C programming for the MCU you're using. Reading and understanding the MCU datasheet will be critical. You can buy a $30.00 device programmer that interfaces to a PC to program the MCU chip with. You'll need to learn how to program embedded chips this way. You could forgo the MCU and use a PC but your robot arm will never be capable of autonomous operation if you go that path. So you'll need some circuit design abilities or help from someone who can do that for you. You'll need to learn to write either assembly or C code. The better code you learn to write, the more the arm will be capable of doing. You'll need to learn to read datasheets and find hardware that either matches or can be made to match the controller to the arm it controls. You might be able to find a kit that does all of this for you. If all of this seems foreign to you, you'll need this kind of kit to start with. Once you understand how the kit does it, you can start getting creative in what you do without the kit. If you have an electronics and code writing background, you might be able to take the leap in to the deep end of the pool by doing everything from scratch, finding and designing with components of your choice.