Go to advanced search

by joan
Tue Jan 16, 2018 11:11 pm
Forum: General programming discussion
Topic: Raspberry PI Sonic Sensor for Pallet Detection
Replies: 1
Views: 30

Re: Raspberry PI Sonic Sensor for Pallet Detection

Yes, that is achievable.

Perhaps break down the job into smaller parts and join them together at the end?

Plenty of examples of using sonar rangers.
by joan
Tue Jan 16, 2018 11:06 pm
Forum: Beginners
Topic: drive a servo with a 2-axis button PS2 Controller Joystick
Replies: 4
Views: 70

Re: drive a servo with a 2-axis button PS2 Controller Joystick

Best to put code in code quotes for legibility.

What is the problem? What specific errors do you see?
by joan
Tue Jan 16, 2018 9:34 pm
Forum: Automation, sensing and robotics
Topic: Controlling 4 gear motors with encoders
Replies: 7
Views: 166

Re: Controlling 4 gear motors with encoders

However it is less than 6 revolutions per second Sometimes the encoder is not on the gear-reduced output shaft but is on the actual high-rpm motor-shaft so that's something to watch out for I've just bought a couple of motors with attached encoders. They are on the motor shaft with 30 vanes, no loa...
by joan
Tue Jan 16, 2018 8:47 pm
Forum: Automation, sensing and robotics
Topic: 2 motors and 16bit pwm...
Replies: 15
Views: 245

Re: 2 motors and 16bit pwm...

Fine. It's probably worth mentioning that you could use the Pi's hardware PWM channels Thanks, is that using pigpio and is 8 bit? pigpio general PWM (for want of a better term) is DMA timed and defaults to 250 steps, not quite 8 bits. I meant the hardware PWM channels used to drive audio which I gu...
by joan
Tue Jan 16, 2018 8:39 pm
Forum: Automation, sensing and robotics
Topic: Controlling 4 gear motors with encoders
Replies: 7
Views: 166

Re: Controlling 4 gear motors with encoders

320RPM is quite high for a wheeled robot with normal sized tires. However it is less than 6 revolutions per second so should not present much of a problem to read an attached encoder in software (assuming something like 30 detents per revolution).
by joan
Tue Jan 16, 2018 8:11 pm
Forum: Automation, sensing and robotics
Topic: 2 motors and 16bit pwm...
Replies: 15
Views: 245

Re: 2 motors and 16bit pwm...

Fine. It's probably worth mentioning that you could use the Pi's hardware PWM channels
by joan
Tue Jan 16, 2018 7:36 pm
Forum: Automation, sensing and robotics
Topic: 2 motors and 16bit pwm...
Replies: 15
Views: 245

Re: 2 motors and 16bit pwm...

It's a pity you don't have steppers.

Is there any feedback about the position? You may need to re-calibrate the PWM at each and every use as I'm not sure how a DC motor may be affected by load and temperature.
by joan
Tue Jan 16, 2018 7:32 pm
Forum: Other
Topic: Raspberry pi 3 RTOSes
Replies: 5
Views: 142

Re: Raspberry pi 3 RTOSes

The term real-time doesn't mean much. You need to specify the real-time constraints. Have you looked at the Pi specs?
by joan
Tue Jan 16, 2018 6:37 pm
Forum: Automation, sensing and robotics
Topic: 2 motors and 16bit pwm...
Replies: 15
Views: 245

Re: 2 motors and 16bit pwm...

I'm not sure PWM is going to help much in achieving accurate position with a DC motor. Are these a special type of motor?
by joan
Tue Jan 16, 2018 12:52 pm
Forum: Automation, sensing and robotics
Topic: Controlling 4 gear motors with encoders
Replies: 7
Views: 166

Re: Controlling 4 gear motors with encoders

How are you controlling four motors with one L298N? Are you driving two motors in parallel? Treat those encoder motors as two devices, one DC motor plus one encoder. Plenty of software is available to read encoders. I'm not convinced encoders are a great deal of use for simple robots. They take no a...
by joan
Mon Jan 15, 2018 9:53 pm
Forum: Troubleshooting
Topic: NEED HELP! COMBINING ULTRASONIC SENSOR AND LED DIODE
Replies: 7
Views: 137

Re: NEED HELP! COMBINING ULTRASONIC SENSOR AND LED DIODE

Perhaps you could collaborate with this guy?

viewtopic.php?f=91&t=202289
by joan
Mon Jan 15, 2018 5:27 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI: Chip Enable 0 doesn't work
Replies: 5
Views: 102

Re: SPI: Chip Enable 0 doesn't work

Perhaps you need to use

Code: Select all

Name:   spi-gpio35-39
Info:   Move SPI function block to GPIO 35 to 39
Load:   dtoverlay=spi-gpio35-39
Params: <None>
by joan
Mon Jan 15, 2018 5:26 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI: Chip Enable 0 doesn't work
Replies: 5
Views: 102

Re: SPI: Chip Enable 0 doesn't work

I think the Linux driver was changed to toggle the chip selects itself rather than using the hardware. That would explain why the GPIO are in mode OUTPUT rather than ALT0. Perhaps this is simply a driver code error and the driver is defaulting still to GPIO8 for CE0 and GPIO7 for GPIO1. I would expl...
by joan
Mon Jan 15, 2018 3:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI: Chip Enable 0 doesn't work
Replies: 5
Views: 102

Re: SPI: Chip Enable 0 doesn't work

The power-up modes of the GPIO are fixed as defined in https://www.raspberrypi.org/documentati ... herals.pdf page 102.

Are you using the Linux SPI driver? As a matter of interest do GPIO 7/8 act properly if left in ALT0 mode when running the test?
by joan
Mon Jan 15, 2018 9:24 am
Forum: Python
Topic: Controlling a robot using 2 raspberry pi's
Replies: 5
Views: 134

Re: Controlling a robot using 2 raspberry pi's

There are plenty of options, a few examples.
by joan
Mon Jan 15, 2018 12:18 am
Forum: Python
Topic: Controlling a robot using 2 raspberry pi's
Replies: 5
Views: 134

Re: Controlling a robot using 2 raspberry pi's

Yes, that is easy.

There is a little bit more required though. How will that control a motor?
by joan
Sun Jan 14, 2018 7:42 pm
Forum: Beginners
Topic: Connecting 50 sensors
Replies: 3
Views: 116

Re: Connecting 50 sensors

Of course this will be possible.

Whether it is practical or not depends on the sensor and how frequently you expect to communicate with each.
by joan
Sun Jan 14, 2018 7:38 pm
Forum: Python
Topic: Controlling a robot using 2 raspberry pi's
Replies: 5
Views: 134

Re: Controlling a robot using 2 raspberry pi's

Yes, you may connect the two Pi via Ethernet and use that to communicate.

Usually a technique called TCP sockets would be used to send and receive messages.

What messages are you thinking of?
by joan
Sun Jan 14, 2018 6:13 pm
Forum: Beginners
Topic: Controlling Externally Powered Motors
Replies: 1
Views: 45

Re: Controlling Externally Powered Motors

The Pi is a 3V3 device. As long as your motor controller can handle 3V3 signals you should be fine. Generally 2 GPIO are used per motor (0 0 off, 0 1 clockwise, 1 0 counterclockwise, 1 1 off) with PWM applied to the high GPIO to control speed.
by joan
Sun Jan 14, 2018 1:13 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Why this GPIO-sequence and which GPIOs for Interfaces?
Replies: 7
Views: 302

Re: Why this GPIO-sequence and which GPIOs for Interfaces?

PWM is available on every GPIO if software timing of the pulses is used. The Pi has several GPIO which can be configured in a PWM mode where internal hardware is used to time the pulses. The number of those GPIO brought out to the expansion header varies between 1 for the earliest Pi models, to 4 fo...
by joan
Sun Jan 14, 2018 12:52 pm
Forum: Beginners
Topic: SPI or I2C for ADC for Analog Sensors
Replies: 2
Views: 54

Re: SPI or I2C for ADC for Analog Sensors

Swings and roundabouts I guess.

I doubt it matters.

SPI allows higher transfer speeds but that doesn't matter for a lot of applications.

In your situation I would probably go for SPI simply to get experience of using that bus rather than I2C.
by joan
Sun Jan 14, 2018 11:05 am
Forum: Troubleshooting
Topic: Pi 2 & 3 not detcting i2C devices, Pi 1 does ...
Replies: 9
Views: 234

Re: Pi 2 & 3 not detcting i2C devices, Pi 1 does ...

The early Pi Bs used bus 0 not bus 1. You must have a later model B for i2cdetect to work (by the way you should not need to use sudo with i2cdetect). I would start from a fresh recent Rasbian image on the Pi3. I think we need photos of the Pi and connections as I find it hard to believe so many Pis...
by joan
Sat Jan 13, 2018 10:23 pm
Forum: Troubleshooting
Topic: GPIO current on startup, is this normal?
Replies: 12
Views: 285

Re: GPIO current on startup, is this normal?

GPIO4 has a weak internal pull-up to 3V3 enabled at power-up. That is probably what you are noticing. Try a higher numbered GPIO like GPIO8. That has a weak internal pull-down to ground enabled at boot.
by joan
Sat Jan 13, 2018 8:36 pm
Forum: Beginners
Topic: Fan control without transistor?
Replies: 1
Views: 38

Re: Fan control without transistor?

No, you need a transistor or equivalent to switch the fan on and off.

Go to advanced search