I searched the NG-firmware for the parameter, which set’s the deadband of the AINSER-inputs. I found this:
#define MIOS32_AIN_DEADBAND 31
But if I change that to f.e. 100 or more it doesn’t change anything. My problem is, that my slide potentiometer have some jittering (even when the pinrange is set) when they are not at 0 or 127.
I also found the parameter
#define MIOS32_AIN_IDLE_CTR 3000
But changing this value also doesn’t make any difference.
thanks for your reply.
It’s not jittering like a lot of values are send by the slide pot. It’s just like every now and then (like every 2-3 seconds but sometimes it stays stable for ever) it sends a value. So maybe I want to have it too perfect ;-) What I’d like to have is a kind of “IDLE” function, which I found in the mios32_ain.h in /svn/mios32/trunk/include/mios32/
It’s description reads:
// define the deadband which is used when an AIN pin is in "idle" state // this helps to avoid sporadical jittering values // Set this value to 0 to disable the feature (it's enabled by default) #ifndef MIOS32\_AIN\_DEADBAND\_IDLE #define MIOS32\_AIN\_DEADBAND\_IDLE 230 #endif // define after how many conversions the AIN pin should go into "idle" state // - "idle" state is left once MIOS32\_AIN\_DEADBAND\_IDLE is exceeded. // - "idle" state is entered once MIOS32\_AIN\_DEADBAND hasn't been exceeded for // MIOS32\_AIN\_IDLE\_CTR conversions // 3000 conversions are done in ca. 3 seconds (depends on number of pins!) // allowed range: 1..65535 #ifndef MIOS32\_AIN\_IDLE\_CTR #define MIOS32\_AIN\_IDLE\_CTR 3000 #endif
I thought it may be possible to move the slider into the desired position f.e. to value 64 and “lock” it so it only sends any further CCs if the slide pot changes significantly.
Regarding my wiring: The slide pots are mounted on a PCB which I designed. 5V track is at 0,8mm and GND is designed as plane. The faders are scanned through an AINSER64 module. But this I also designed by myself. The 74HC595 and the MCP3208 are sitting on the mainboard, while the 4051 are directly mounted on the fader-PCB. The cable to the fader PCB is about 30cm. The faders are running at 7bit. 11bit leads to a lot of jitter. Power through USB at the moment, but I’ll change that too a MeanWell 5V powersupply.
I will say you have a design/layout/PSU problem that cause unexpected jitter
I don’t now about mux with distant wire, maybe buffer is requested for strong data over long trace, is your “jitter” random regarding value or “around” the actual pot position ?
Also, how is the layout of your 5V trace used for 3208 analogue Vref and slider servo track ?
The expectation is to have a separated trace for this, without power distribution for anything else from Vref at 3208 to sliders
You can check with DMM at lower mV setting what you get between 3208 0V and slider 0v, you can then monitor how “stong” is you 0V ref as consistency over the plane/wire, change the load by on/off led and button state if you have some.
Do the same between 3208 Vref and slider 5V.
Another idea is maybe to check how reliable are your slider ? replace one with two resistor in series (equivalent serial value as slider) use the middle as wiper and check if jitter is better ?
By the way what is the ref and stroke length of you fader/slider ?
For “critical” operation, like 11bit low or no jitter, and in some circumstance, local precision regulation is a good option…
I don’t think being concerned about jitter at 7bit is too perfect , you can for sure improve your result !!!
Just to add that in my design the safe “don’t send when not used” function is handled at .NGC with a if_equal linked to touch sensor of the respective fader/slider EVENT_AINSER. I suspect you don’t have touch detection at your slider, but you can use button for this.
I don’t now about mux with distant wire, maybe buffer is requested for strong data over long trace, is your “jitter” random regarding value or “around” the actual pot position ?
it’s around the actual position. If the fader is at 105, it sometimes jitters on 106 / 107 f.e.
VREF is the big trace on the very top of the PCB. J1 is the input, J2 forwards the unused analog inputs of IC2, which I need for nine faders on this PCB.
I’ll do what you suggested! Thank you for your help!
-J1 and J2 only use one wire (ribbon) for 5v and 0v, ribbon is very thin wire… you can expect voltage drop/change/instability anytime you have small load change.
Try cut the ribbon at 0 and 5v and replace with 0.25 or 0.5 mm2 wire (direct soldering at connector pin for test)
-what side is your ground plane ?
-Did all fader have same jitter or position in the PCB have impact ?
-IIRC unused 4051 pin are better clamped to ground !
: I had no time yet to follow up on your suggestions. But I’ll do as soon as possible.
Maybe you can answer another question: Is it possible (f.e. by modifying the source code) to set the resolution on a per-pin-base and not on a per-chip base? I ask because if I connect pedals as well as pitch to my board, than I don’t need 11bit on the pedals, but I need them on the pitchwheel. I don’t want to waste an IC just for one analog input
No. What I was asking is: If you configure your analog inputs via the AINSER command (AINSER n=1 enabled=1 cs=0, etc. pp.) the resolution of the EVENT_AINSERs that belong to this configuration of course use the resolution you entered in the AINSER configuration.
I basically use the AINSER64. And using the standard method for the configuration allows me to set ONE resolution for the whole AINSER64 module. But what if I need a resolution of 7bit for the first 8 inputs and 11bit on the second 8 inputs? Hmmmm
As AINSER64 is a multiplexed solution to one AIN mcp3208 I don’t think it is possible.
Just set the device at 11bit (max if possible regarding jitter), then your event_ainser definition will take care of the effective bit depth you specify here.
I don’t see the reason/use case you need to scale this at chips ?
You are totally right. That doesn’t make any sense
Today I checked what you suggested. In the end it were the WS2812 LEDs that caused the potentiometers to jitter… if I don’t connect them, everything works great… so I need to find another way to implement them into my setup…
: Thanks for your suggestions. If you take a look at my screenshot above you will notice 9 4pin-pinheaders right next to the faders. This where the WS2812-PCB sits on. Do you think it makes sense to remove those headers and connect the LEDs directly? Maybe it’s a problem that both (faders & LEDs) share the same PCB?
BTW: I use a MeanWell RS15-5 Powersupply and I have 6 LEDs next to each fader => 6*9 = 54 LEDs. And none of them running at full power. They are at about 20%…
I need to measure the current of the whole circuit. Maybe I should upgrade the PSU to MeanWell EPS-35-5?
//edit: While my current PSU RS15-5 has a load regulation of ±1,5% which means 75mV the EPS-35-5 has a load regulation of 1% => 50mV.
So you would suggest to add another power supply that is just connected to the LEDs? What is sense detection? I’d be happy to NOT add another power supply because I already have two supplys in the housing… 19V and 5V.
I think you already spot the problem so yes the answer is your led and AIN don’t like to be close together.
I’m not used to this color LEDs but they use PWM to acheave 20% power and color change right ?
PWM can introduce noise which can also be the reason you notice jitter, in conjunction with voltage drop if there is any ?
Can’t say about PSU choice, you have to measure current and pick one accordingly
By the way, what for the 19V rail is? because you can maybe use this on to add a small regulator (like LM317L) for the critical AIN and slider Vref
My first test will be to locally separate AINSER circuit and LED circuit, not sharing VDD/VSS locally, but only at PSU terminal in the manner of star power distribution, if your design allow it.
Sense detection, is a sense input that some PSU have to attach at the load, tracking voltage at that point, an maintain it.
I’m not used to this color LEDs but they use PWM to acheave 20% power and color change right ?
Yes! Correct!
31 minutes ago, Zam said:
PWM can introduce noise which can also be the reason you notice jitter, in conjunction with voltage drop if there is any ?
I tried to measure this with my DMM. But I’m afraid my DMM is not the best. I’ll use my oscilloscope to check that.
32 minutes ago, Zam said:
By the way, what for the 19V rail is?
This is for a small computer which sits in the housing. It’s a great idea to use a small regulator… but like you said: I’ll start with separating the PCBs.
: Some more informations on this. Today I tried to use a separate powersupply for the LEDs. The LEDs are still attached to the fader-pcb… I already created a new PCB, but this needs to be produced first. Anyway: the jitter stays… also I found out that the jitter also occurs if the LEDs are not even switched on! Meanwhile I think it’s more a problem wit shielding… I took a piece of copper foil, attached a cable to it and connected it to GND. When I put this piece of foil between the LED-strip and the fader the jitter will slow down but does not disappear.
: I followed up on this today. Meanwhile I received the new PCBs where the LEDs are not sitting on the fader-PCBs. The jitter has improved a lot. Thanks for the suggestion. I also tried, not using the USB-power directly from a computer which also improved the stability and the jitter-issues. Anyway: If both PCBs (and the core of course) are powered from the same power supply, I still get some jittering. Way less than before. But it’s still there. The only solution for now is, to use a totally separate power supply for the LEDs, but share GND with the core & fader PCB. This works great… but I’m not totally satisfied with using two power supplies.
I did some experimenting with direct USB-power. Like I wrote it’s not good, to power everything from the same port. But, and that is kind of weird, if I use one USB-port for the core & faders / AIN and another USB-port from the same computer for the LEDs, it works great too. I don’t think it has something to do with power consumption because I tested it with 16 LEDs at low brightness. They shouldn’t draw too much current.
I also measured with an oscilloscope. I’m not very experienced with that… but I noticed some voltage drop when switching the colors from the LEDs and it seems that this will influence the AIN. So my question is: Is there a way to power everything from one power supply but add some filtering before the LEDs (or AIN?) ? Do you have any recommendations on this?