POV-Ray : Newsgroups : povray.off-topic : For a price Server Time
5 Sep 2024 15:26:49 EDT (-0400)
  For a price (Message 21 to 26 of 26)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: scott
Subject: Re: For a price
Date: 19 Aug 2009 03:24:30
Message: <4a8ba8ae@news.povray.org>
> Thinking about it, I don't know that I would use pressure sensors unless
> you wanted pressure measurements. I don't know if that would matter for
> pedals, as the pressure is going to be checked only once you have
> already pushed it down. Simple dial resistors on each pedal would tell
> you how far down they were pressed; optical encoders would work too
> (dead mice scroll wheels, if you want those cheap). For more accuracy
> than that, I would have to think about it more. Magnetic sensors might
> work, but you would have to calibrate the whole set.

I've made a few sets of pedals for car racing games (where I think the 
forces on the brake pedals are much higher than what would typically be used 
to activate an organ pedal).  The usual construction is to have the pedal 
rotating on a bearing with a big stiff spring giving the resistance force, 
then a simple rotary potentiometer (variable resistor) is wired up as a 
voltage divider (0V on one end, 5V on the other end) on the pedal axle with 
an ADC (as you say often part of the microcontroller itself) converting the 
centre tap into a digital signal that can be sent to the PC via USB.  This 
setup is accurate enough to give good control over controlling the brakes in 
a car racing game without any noise or spurious signals, so it should be 
fine for controlling an organ pipe :-)

It would be a nice little project, you can buy ready-made PCBs with USB 
interface and analog/digital interfaces if you don't feel like doing too 
much of the electronics and microcontroller software yourself.


Post a reply to this message

From: Invisible
Subject: Re: For a price
Date: 19 Aug 2009 06:05:49
Message: <4a8bce7d$1@news.povray.org>
>>> Then you could go to the pub and tell some random girl, "Hey, baby, 
>>> you ever dated a guy who wired his own base?" :)
>>
>> *facepalm*
> 
> What, girls like a guy who can get things done! :)

They also hate nerds with a passion.


Post a reply to this message

From: Darren New
Subject: Re: For a price
Date: 19 Aug 2009 11:49:56
Message: <4a8c1f24$1@news.povray.org>
Sabrina Kilian wrote:
> Elaborate? $8 micro-controllers are absurdly powerful now, and very easy
> to program. Granted, most of the time it is assembly or some odd looking
> java-esque language,

Many of them even have BASIC interpreters on chip, don't they? Or FORTH? 
Weird stuff like that?

-- 
   Darren New, San Diego CA, USA (PST)
   "We'd like you to back-port all the changes in 2.0
    back to version 1.0."
   "We've done that already. We call it 2.0."


Post a reply to this message

From: Sabrina Kilian
Subject: Re: For a price
Date: 19 Aug 2009 15:32:27
Message: <4a8c534b$1@news.povray.org>
Darren New wrote:
> Sabrina Kilian wrote:
>> Elaborate? $8 micro-controllers are absurdly powerful now, and very easy
>> to program. Granted, most of the time it is assembly or some odd looking
>> java-esque language,
> 
> Many of them even have BASIC interpreters on chip, don't they? Or FORTH?
> Weird stuff like that?
> 

I know that some of the PIC boards come with BASIC software, google says
that they also have support for FORTH. From what little time I have used
PIC BASIC, it isn't something I would recommend. In the version I had,
you could only read or set one I/O pin per instruction, even digital
pins, instead of reading and setting 8 pin banks. For what I was doing,
and for a 25 pedal controller, that seems just a bit slow. For FORTH, I
don't have any more info than what google just showed me, that there
isn't a GCC port for PICs, and that most of the compilers are
proprietary. Don't have a clue how many are free and proprietary.


Post a reply to this message

From: Invisible
Subject: Re: For a price
Date: 20 Aug 2009 05:55:23
Message: <4a8d1d8b@news.povray.org>
>> You realise that MIDI is a serial communications protocol, right? It's
>> not like you just connect each sensor to a different pin on the plug;
>> you need some fairly elaborate electronics in there.
> 
> At the very simplest form, one input pin on any ol' micro-controller for
> each pedal.

Micro-controller? Ouch.

> Controller can just poll each
> pin, or batches of pins where speed is an issue, and create the MIDI
> packet to send.

Not quite.

MIDI sends note-on and note-off messages, so the controller needs to 
"remember" the previous pin state to decide whether anything has changed.

> Just make sure to have an optoisolator on
> . . . crud, it has been forever since I did anything MIDI, I don't
> remember if it is on the TX or RX wire.

MIDI is simplex, not duplex. A single MIDI cable carries messages in one 
direction only. And I'm pretty sure it's the receiving end that's 
supposed to be opto-isolated. (I.e., I don't have to do anything.)



> Elaborate? $8 micro-controllers are absurdly powerful now, and very easy
> to program. Granted, most of the time it is assembly or some odd looking
> java-esque language, but GCC will cross-compile to AVR and ARM chips.
> The soldering might be tough, but for a prototype just breadboard it.

1. I'd be very surprised if you can buy any sort of microcontroller for 


2. A microcontroller on its own isn't going to do much good - unless I 
also go out and buy a RAM ship and either a PROM and burner or some 
flash RAM. I would think a PIC would be the way to go.

3. Even a PIC is probably vastly too difficult to program. And if it 
doesn't work? It's not like you can debug it...


Post a reply to this message

From: Sabrina Kilian
Subject: Re: For a price
Date: 20 Aug 2009 11:26:05
Message: <4a8d6b0d@news.povray.org>
Invisible wrote:
>>> You realise that MIDI is a serial communications protocol, right? It's
>>> not like you just connect each sensor to a different pin on the plug;
>>> you need some fairly elaborate electronics in there.
>>
>> At the very simplest form, one input pin on any ol' micro-controller for
>> each pedal.
> 
> Micro-controller? Ouch.
> 
>> Controller can just poll each
>> pin, or batches of pins where speed is an issue, and create the MIDI
>> packet to send.
> 
> Not quite.
> 
> MIDI sends note-on and note-off messages, so the controller needs to
> "remember" the previous pin state to decide whether anything has changed.
> 

So, you need RAM, no problem. Poll the pins, compare the state, and
construct the packets to send. Even without RAM, a few bytes of cache
would be enough. Even with 25 pedals and 10-bit ADC, that is still only
250 bits.

>> Just make sure to have an optoisolator on
>> . . . crud, it has been forever since I did anything MIDI, I don't
>> remember if it is on the TX or RX wire.
> 
> MIDI is simplex, not duplex. A single MIDI cable carries messages in one
> direction only. And I'm pretty sure it's the receiving end that's
> supposed to be opto-isolated. (I.e., I don't have to do anything.)
> 

> 

Shows how long it's been since I've done anything with MIDI. But if you
have a controller, why not have it capable of receiving MIDI
instructions? May want to use it for something else later.

>> Elaborate? $8 micro-controllers are absurdly powerful now, and very easy
>> to program. Granted, most of the time it is assembly or some odd looking
>> java-esque language, but GCC will cross-compile to AVR and ARM chips.
>> The soldering might be tough, but for a prototype just breadboard it.
> 
> 1. I'd be very surprised if you can buy any sort of microcontroller for

> 

Atmel's ATmega168 in DIP form are under $3 each. The 128, which has
enough digital I/O pins for 25 pedals is under $10. For 25 analog pins,
you may have to look elsewhere. Off hand I can't think of any, so
multiplexers might be the only way. Still, a $3 controller and a few $1
mux chips.

> 2. A microcontroller on its own isn't going to do much good - unless I
> also go out and buy a RAM ship and either a PROM and burner or some
> flash RAM. I would think a PIC would be the way to go.
> 

Most of them, now days, have built in flash memory for code, EEPROM that
the code can store stuff in over power loss, and built in RAM. The 168
has 1kB of RAM, 512B EEPROM, built in serial and 16kB of flash.

For programing, serial to a simple JTAG programmer (6 wires, right from
the serial port to certain pins) works great. If you prefer USB, look at
something like the Arduino, with built in USB, a custom bootloader, and
an development environment.

> 3. Even a PIC is probably vastly too difficult to program. And if it
> doesn't work? It's not like you can debug it...

Why can't you debug them? Connect it to a PC via USB or serial, throw
some printf statements in to chat over the serial conncetion, and watch
what happens. Or use an in circuit debugger. It isn't what programmers
normally think of as debugging, but you could have it print blocks of
memory out, and only work through the next step of code when you send a
certain command. Takes longer to program that way. Some chips probably
have in chip debuggers, I think I have seen that on some Motorola or
another.

For easy programing, assuming C doesn't feel too low-level, take a look
at the Arduino. Lots of different forms, from really small breadboard
units, to full programers, a variety of chips for various pin counts,
with or without USB and headers for lots of external devices, and for
the most part they are around $30; 10 for breadboard kits, around 50 or
60 for larger pre-made boards with lots of I/O pins and RAM.


All prices are in USD, and as you can guess I use AVRs a lot more than
most of the other chips. I don't want to start the avr/pic/arm/mips holy
war here, those are just the chips I know.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.