Hot answers tagged

12

The diagram you show looks like it would produce a pretty rough trapezoidal Back-EMF. I'm assuming that the gates that are at 100% are the lower legs of the motor drive bridge. I can't think of a reason you would want to do this. In general you want the gate voltage of the return leg to be the complement of the gate voltage of the supply leg. In six-step ...


12

There is a fair deal of literature on the implementation of brushless motor control but here is an overview. To understand the differences between commutation waveforms it is important to understand how brushless motors operate. A three phase (two pole) motor will have three coils around a single magnet in the center. The goal is to energize the coils in ...


11

The glaring issue I see at the moment is that you are forcing polarity on the I and D terms. In general, you are using a lot of sign checks, sign assignments, and conditional programming. None of that belongs in a PID controller. The entire controller should look like: pError = Input - Output; iError = iError + pError*dt; dError = (pError - previousError);...


8

Gearboxes are probably your best bet if you never want to go fast. You may be able to make it work better if you give it pulsed power (PWM in a way, but pulsed at a speed low enough that the motor actually gets going and then slows down each time. See Controlling Motors in the Presence of Friction and Backlash for details on the technique. You can almost ...


5

When you PWM the voltage to the motor you are effectively controlling the current to the motor which is related to torque (acceleration). The "jamming up" that you notice is basically the inability of the motor to overcome friction. Think about the PWM as the gas pedal in your car, to get to a constant speed you may push all the way down, gradually back ...


4

analogWrite() does not support a higher range of duty cycle. However the timers on the AVR chip do support higher precision/resolution, so you can bang the registers directly, especially if you don't need to use the rest of the Arduino libraries. I recommend using avr-gcc with avr-libc and avrdude for programming, and let go of Arduino IDE/libraries ...


4

As I see it there are two main questions here. The first is, how do I model a robot? This is frequently done with a state-space formulation of the equations of motion. The exact equations depend on the physical construction of your robot. Yes, in order to model them with PWM input then you need to determine the transfer function from the PWM values you ...


4

If you want to have a good balancing, PID loop timing is very important. Standard Raspberry OS, like Raspbian can't guarantee you any precise timing, so once your loop period may be 10ms, once it can be 1s, resulting in a robot to fall. You can try to run some real time operating system on RPi, like FreeRTOS, that would have preemptive capabilities (so a ...


3

You won't ever get 'exactly' 2042.8878 RPM, so going with your measurement accuracy I will assume you mean 2042.8878 +/- 0.0005 RPM. This is approximately an error of 1 part in 4 million. So let's assume you can set up a timer which counts up to around 4 million and resets, and use that for the PWM. Assuming a two pole motor, 2042 RPM is 34 electrical ...


3

Yes, as this motor is rated for 100amps stall at 12V you should probably be using a motor controller capable of supplying that amount of current. Regarding how to drive the motor, the following may be of use: A voltage regulator cannot be used to drive a motor. What it does is convert a certain voltage to another voltage, for example 5v to 12v. It does ...


3

Digital servos accept the same pulse width and pulse repetition rate as regular analog servos. a b With many RC servos -- both digital and analog -- as long as the "frame rate" (how many times per second the pulse is sent over the control wires to the servo, aka the pulse repetition rate) is in a range of 40 Hz to 200 Hz, the exact value of the frame rate ...


3

Many (perhaps most) radio control transmitters multiplex all the "RC PWM" channels into a single physical wire, using a system called "RC PPM" (radio-control pulse position modulation). (a) (b) (c) (d) (e) (f) (g) Often this "PPM" signal is transferred from the a student's RC transmitter through the buddy box wire to the teacher's RC transmitter. The "...


3

While I do not know how to fix the root cause of the problem, a work around is to use closed-loop feedback. If you can measure the speed of each wheel (for example, with encoders), you can use a PID-like algorithm to adjust the speeds of your wheels so the robot goes straight. A compass or gyroscope would also be suitable for this task.


2

When I'm processing quadrature encoder input in an ISR, I prefer to have a simple ISR running on a timer that's guaranteed to run fast enough to catch every state (not state change) of the encoder. Interrupting on every pin transition invites a situation where the processor gets bogged down if a pin starts bouncing. Interrupting at a fixed rate may use up ...


2

Interrupt service routines should always do the absolute minimum. Remember that while your MCU is servicing an interrupt, it is doing nothing else. For a simple quadrature encoder, it should be possible to have a pair of ISR's, one triggered by a change on the A channel, the other triggered by a change on the B channel. Pretty much the only thing these ...


2

The accepted answer to your previous question presents several ways of developing enough drive for the vibrating motor, in its section called “Converting PWM signals into something that can drive a motor”. One of the most direct ways is using one ULN2803 device per 8 motors, or one ULN2003 per 7 motors. In some packages these devices support up to 500 mA/...


2

For each motor the output should be: A value at which the power from the 4 motors roughly keeps the quadcopter airborne, for instance 1500ms. Plus or minus the influence of the throttle. For instance with your throttle is in the 0:1 range you could apply 600 * (throttle - 0.5), which will put the motors output in the 1200:1800ms range. Plus or minus the ...


2

I use those RCtimer ESCs and they have always worked great for me, generally thease (and most) ESCs will be looking for 50Hz pwm with a period between 1-2ms, though generally you will not damage them by altering the pwm output. I would recommended cutting the 5v supply on each ESC as they can act funny and even damage themselves when they are all tied to ...


2

Multiple channels are time sliced onto "one-wire". The real wire count is usually three. Typically there is a positive voltage wire (may not be there depending on whether both ends have their own power or not) and always a shared ground wire. Perhaps 40-100 times per second the transmitter broadcast the settings of all controls which map to servos on ...


2

In addition to the RPi, as TobiasK suggests, the Arduino boards have: PWM support; USB support is possible with the addition of an inexpensive USB shield, and; node.js is possible, see: Arduino Experimenter's Guide for NodeJS; A Practical Introduction to IoT using Arduino, Node.js and Plotly, and; Controlling a Motorbot Using Arduino and Node.js to ...


2

Your question kind of boils down to, what is real time ? In the end real time is what you want/specify for your system to work, whether it be hard real time or soft real time. In practice ROS is not hard real-time, but is sufficient enough for most robotics applications. It seems to be that you are trying to take into account the latency between your ...


2

If you want to test the motor, just apply a DC source to it directly rather than using the l298. A 12V car battery is a source you likely have access to that can supply enough current so you can test the torque and speed. Regarding the pwm control, you need to have sensor feedback. Then you will be able to use a control algorithm to, in effect, sense when ...


1

You could also consider the ESP8266. It can be programmed directly with the Arduino Developers Kit (see ESP8266 Arduino). In that sense the developer community overlaps heavily with that of the Arduino family. The way it integrates into the Arduino SDK basically makes it just another flavor of Arduino, although the pinouts aren't physically compatible. The ...


1

You will find only two boards with a larger developer community and one of them is supporting node.js, PWMs and USB-interfaces. It is the raspberry Pi.


1

The PWM signal should not be the limiting factor in achieving the accuracy you seek. For some applications, PWM signals are chopped > 100 kHz, so, given the correct DSP or microcontroller output to create the PWM, you will have as much control over the power going into the motor as you need. Most of the motion control system I've built have had PWM ...


1

An ESC needs to have the throttle limits adjusted before you can use it. While there are many options you can set from a programming menu (see page 4 of this PDF for reference), the throttle adjustment is pretty straightforward: Disconnect the battery from the ESC Send and hold a full throttle signal to the ESC Connect the battery to the ESC Wait 2 seconds ...


1

It doesn't seem like those motors are well matched to your battery. They recommend a 2or3 cell LiPo (7.2V or 11.1V) while you are using a 1 cell LiPo (3.6V). I think you'll find most motors will recommend 2 or 3 cells. With only 1 cell you won't likely get enough lift for a multirotor. Also as a side note, your ESCs should be set to have no cut-off when ...


1

FYI, iRobot has released the spec for the motor interface here: http://www.irobot.com/~/media/MainSite/PDFs/About/STEM/Create/Create_2_Wheel_Hack.pdf


1

The motors get a PWM'd battery voltage which is around 18V. I assume it is safe to run at that voltage at 100% duty cycle. I imagine you could run a higher voltage but you run the risk of burning out your brushes. Lower voltages work fine if your bot is small. I have successfully run a small Roomba wheel module robot off of 8 AA batteries (about 12V).


1

Multiple PWM channels generally aren't shoved into a single wire (Or I've never heard of it). If you need to send multiple data channels over the same wire then using a higher level protocol (such as UART or SPI) would be the way to go. While PWM is technically digital, it isn't like other digital protocols where data can be shoved in and expected to come ...


Only top voted, non community-wiki answers of a minimum length are eligible